1 # GemRB - Infinity Engine Emulator
2 # Copyright (C) 2003 The GemRB Project
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #character generation, biography (GUICG23)
26 global BioWindow
, EditControl
28 GemRB
.LoadWindowPack ("GUICG", 640, 480)
29 BioWindow
= GemRB
.LoadWindow (23)
31 EditControl
= BioWindow
.GetControl (3)
32 BIO
= GemRB
.GetToken("BIO")
33 EditControl
= EditControl
.ConvertEdit (5)
34 EditControl
.SetVarAssoc ("row", 0)
35 EditControl
.SetStatus (IE_GUI_CONTROL_FOCUSED
)
37 EditControl
.SetText (BIO
)
39 EditControl
.SetText (15882)
42 OkButton
= BioWindow
.GetControl (1)
43 OkButton
.SetText (11973)
45 ClearButton
= BioWindow
.GetControl (4)
46 ClearButton
.SetText (34881)
49 CancelButton
= BioWindow
.GetControl (2)
50 CancelButton
.SetText (12896)
51 CancelButton
.SetFlags (IE_GUI_BUTTON_CANCEL
, OP_OR
)
53 OkButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, OkPress
)
54 ClearButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, ClearPress
)
55 CancelButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, CancelPress
)
56 BioWindow
.SetVisible (WINDOW_VISIBLE
)
60 global BioWindow
, EditControl
66 #there is no way to get the entire TextArea content
67 #this hack retrieves the TextArea content row by row
68 #there is no way to know how much data is in the TextArea
70 GemRB
.SetVar ("row", row
)
71 EditControl
.SetVarAssoc ("row", row
)
72 line
= EditControl
.QueryText ()
80 GemRB
.SetNextScript ("CharGen9")
81 GemRB
.SetToken ("BIO", BioData
)
87 GemRB
.SetNextScript ("CharGen9")
91 EditControl
.SetText ("")