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, race (GUICG2)
21 from GUIDefines
import *
30 global RaceWindow
, TextAreaControl
, DoneButton
33 GemRB
.LoadWindowPack("GUICG", 800 ,600)
34 RaceWindow
= GemRB
.LoadWindow (8)
36 RaceCount
= CommonTables
.Races
.GetRowCount ()
38 SubRacesTable
= GemRB
.LoadTable ("SUBRACES")
41 Button
= RaceWindow
.GetControl (i
)
42 Button
.SetFlags (IE_GUI_BUTTON_RADIOBUTTON
,OP_OR
)
45 Button
= RaceWindow
.GetControl (i
+2)
46 Button
.SetText (CommonTables
.Races
.GetValue (i
,0) )
47 Button
.SetState (IE_GUI_BUTTON_ENABLED
)
48 Button
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, RacePress
)
49 Button
.SetVarAssoc ("BaseRace", CommonTables
.Races
.GetValue (i
, 3) )
51 BackButton
= RaceWindow
.GetControl (11)
52 BackButton
.SetText (15416)
53 BackButton
.SetFlags(IE_GUI_BUTTON_CANCEL
,OP_OR
)
55 DoneButton
= RaceWindow
.GetControl (0)
56 DoneButton
.SetText (36789)
57 DoneButton
.SetState (IE_GUI_BUTTON_DISABLED
)
58 DoneButton
.SetFlags (IE_GUI_BUTTON_DEFAULT
,OP_OR
)
60 TextAreaControl
= RaceWindow
.GetControl (9)
61 TextAreaControl
.SetText (17237)
63 DoneButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, NextPress
)
64 BackButton
.SetEvent (IE_GUI_BUTTON_ON_PRESS
, BackPress
)
65 RaceWindow
.SetVisible(WINDOW_VISIBLE
)
69 global RaceWindow
, SubRacesTable
70 Race
= GemRB
.GetVar ("BaseRace")
71 GemRB
.SetVar ("Race", Race
)
72 RaceID
= CommonTables
.Races
.GetRowName (CommonTables
.Races
.FindValue (3, Race
) )
73 HasSubRaces
= SubRacesTable
.GetValue (RaceID
, "PURE_RACE")
75 TextAreaControl
.SetText (CommonTables
.Races
.GetValue (RaceID
,"DESC_REF") )
76 DoneButton
.SetState (IE_GUI_BUTTON_ENABLED
)
80 GemRB
.SetNextScript ("SubRaces")
86 GemRB
.SetNextScript ("CharGen2")
87 GemRB
.SetVar ("BaseRace",0) #scrapping the race value
93 GemRB
.SetNextScript ("CharGen3") #class