From: Laszlo T. <ave...@us...> - 2004-03-28 16:01:08
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/how In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7954/how Modified Files: CharGen.py Log Message: Various fixes in the iwd/iwd2 chargen scripts: name field gets focus, IWD can actually finish the chargen process Index: CharGen.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/how/CharGen.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CharGen.py 21 Mar 2004 18:58:09 -0000 1.5 --- CharGen.py 28 Mar 2004 15:49:44 -0000 1.6 *************** *** 82,85 **** --- 82,86 ---- MageSpellsTextArea = 0 MageSpellsDoneButton = 0 + MageSpellsSelectPointsLeft = 0 AppearanceButton = 0 *************** *** 114,158 **** CharGenState = 0 ! GenderButton = GemRB.GetControl(CharGenWindow, 0) GemRB.SetButtonState(CharGenWindow, GenderButton, IE_GUI_BUTTON_ENABLED) GemRB.SetEvent(CharGenWindow, GenderButton, IE_GUI_BUTTON_ON_PRESS, "GenderPress") GemRB.SetText(CharGenWindow, GenderButton, 11956) ! RaceButton = GemRB.GetControl(CharGenWindow, 1) GemRB.SetButtonState(CharGenWindow, RaceButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, RaceButton, IE_GUI_BUTTON_ON_PRESS, "RacePress") GemRB.SetText(CharGenWindow, RaceButton, 11957) ! ClassButton = GemRB.GetControl(CharGenWindow, 2) GemRB.SetButtonState(CharGenWindow, ClassButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, ClassButton, IE_GUI_BUTTON_ON_PRESS, "ClassPress") GemRB.SetText(CharGenWindow, ClassButton, 11959) ! AlignmentButton = GemRB.GetControl(CharGenWindow, 3) GemRB.SetButtonState(CharGenWindow, AlignmentButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, AlignmentButton, IE_GUI_BUTTON_ON_PRESS, "AlignmentPress") GemRB.SetText(CharGenWindow, AlignmentButton, 11958) ! AbilitiesButton = GemRB.GetControl(CharGenWindow, 4) GemRB.SetButtonState(CharGenWindow, AbilitiesButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, AbilitiesButton, IE_GUI_BUTTON_ON_PRESS, "AbilitiesPress") GemRB.SetText(CharGenWindow, AbilitiesButton, 11960) ! SkillsButton = GemRB.GetControl(CharGenWindow, 5) GemRB.SetButtonState(CharGenWindow, SkillsButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, SkillsButton, IE_GUI_BUTTON_ON_PRESS, "SkillsPress") GemRB.SetText(CharGenWindow, SkillsButton, 11983) ! AppearanceButton = GemRB.GetControl(CharGenWindow, 6) GemRB.SetButtonState(CharGenWindow, AppearanceButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, AppearanceButton, IE_GUI_BUTTON_ON_PRESS, "AppearancePress") GemRB.SetText(CharGenWindow, AppearanceButton, 11961) ! BiographyButton = GemRB.GetControl(CharGenWindow, 16) GemRB.SetButtonState(CharGenWindow, BiographyButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, BiographyButton, IE_GUI_BUTTON_ON_PRESS, "BiographyPress") GemRB.SetText(CharGenWindow, BiographyButton, 18003) ! NameButton = GemRB.GetControl(CharGenWindow, 7) GemRB.SetButtonState(CharGenWindow, NameButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, NameButton, IE_GUI_BUTTON_ON_PRESS, "NamePress") --- 115,159 ---- CharGenState = 0 ! GenderButton = GemRB.GetControl(CharGenWindow, 0) GemRB.SetButtonState(CharGenWindow, GenderButton, IE_GUI_BUTTON_ENABLED) GemRB.SetEvent(CharGenWindow, GenderButton, IE_GUI_BUTTON_ON_PRESS, "GenderPress") GemRB.SetText(CharGenWindow, GenderButton, 11956) ! RaceButton = GemRB.GetControl(CharGenWindow, 1) GemRB.SetButtonState(CharGenWindow, RaceButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, RaceButton, IE_GUI_BUTTON_ON_PRESS, "RacePress") GemRB.SetText(CharGenWindow, RaceButton, 11957) ! ClassButton = GemRB.GetControl(CharGenWindow, 2) GemRB.SetButtonState(CharGenWindow, ClassButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, ClassButton, IE_GUI_BUTTON_ON_PRESS, "ClassPress") GemRB.SetText(CharGenWindow, ClassButton, 11959) ! AlignmentButton = GemRB.GetControl(CharGenWindow, 3) GemRB.SetButtonState(CharGenWindow, AlignmentButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, AlignmentButton, IE_GUI_BUTTON_ON_PRESS, "AlignmentPress") GemRB.SetText(CharGenWindow, AlignmentButton, 11958) ! AbilitiesButton = GemRB.GetControl(CharGenWindow, 4) GemRB.SetButtonState(CharGenWindow, AbilitiesButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, AbilitiesButton, IE_GUI_BUTTON_ON_PRESS, "AbilitiesPress") GemRB.SetText(CharGenWindow, AbilitiesButton, 11960) ! SkillsButton = GemRB.GetControl(CharGenWindow, 5) GemRB.SetButtonState(CharGenWindow, SkillsButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, SkillsButton, IE_GUI_BUTTON_ON_PRESS, "SkillsPress") GemRB.SetText(CharGenWindow, SkillsButton, 11983) ! AppearanceButton = GemRB.GetControl(CharGenWindow, 6) GemRB.SetButtonState(CharGenWindow, AppearanceButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, AppearanceButton, IE_GUI_BUTTON_ON_PRESS, "AppearancePress") GemRB.SetText(CharGenWindow, AppearanceButton, 11961) ! BiographyButton = GemRB.GetControl(CharGenWindow, 16) GemRB.SetButtonState(CharGenWindow, BiographyButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, BiographyButton, IE_GUI_BUTTON_ON_PRESS, "BiographyPress") GemRB.SetText(CharGenWindow, BiographyButton, 18003) ! NameButton = GemRB.GetControl(CharGenWindow, 7) GemRB.SetButtonState(CharGenWindow, NameButton, IE_GUI_BUTTON_DISABLED) GemRB.SetEvent(CharGenWindow, NameButton, IE_GUI_BUTTON_ON_PRESS, "NamePress") *************** *** 194,201 **** --- 195,205 ---- global CharGenWindow, CharGenState global GenderButton, RaceButton, ClassButton, AlignmentButton, AbilitiesButton, SkillsButton, AppearanceButton, BiographyButton, NameButton + + GemRB.SetToken("CHARNAME","") if CharGenState > 0: CharGenState = CharGenState - 1 if CharGenState > 6: CharGenState = 6 + if CharGenState == 0: GemRB.SetButtonState(CharGenWindow, RaceButton, IE_GUI_BUTTON_DISABLED) *************** *** 216,223 **** --- 220,230 ---- GemRB.SetButtonState(CharGenWindow, AppearanceButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonState(CharGenWindow, SkillsButton, IE_GUI_BUTTON_ENABLED) + elif CharGenState == 6: GemRB.SetButtonState(CharGenWindow, NameButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonState(CharGenWindow, BiographyButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonState(CharGenWindow, AppearanceButton, IE_GUI_BUTTON_ENABLED) + GemRB.SetButtonState(CharGenWindow, AcceptButton, IE_GUI_BUTTON_DISABLED) + SetCharacterDescription() return *************** *** 230,233 **** --- 237,276 ---- def AcceptPress(): + global CharGenWindow + MyChar = GemRB.CreatePlayer("charbase",GemRB.GetVar("Slot") ) + GemRB.SetPlayerStat(MyChar, IE_SEX, GemRB.GetVar("Gender") ) + GemRB.SetPlayerStat(MyChar, IE_RACE, GemRB.GetVar("Race") ) + #base class + #Class=GemRB.GetVar("BaseClass") + #GemRB.SetPlayerStat(MyChar, IE_CLASS, Class) + #kit + #GemRB.SetPlayerStat(MyChar, IE_KIT, GemRB.GetVar("Class") ) + + GemRB.SetPlayerStat(MyChar, IE_CLASS, GemRB.GetVar("Class") ) + GemRB.SetPlayerStat(MyChar, IE_KIT, 0x4000) + t=GemRB.GetVar("Alignment") + GemRB.SetPlayerStat(MyChar, IE_ALIGNMENT, t) + TmpTable=GemRB.LoadTable("repstart") + t=GemRB.FindTableValue(AlignmentTable,3,t) + t=GemRB.GetTableValue(TmpTable,t,0) + GemRB.SetPlayerStat(MyChar, IE_REPUTATION, t) + TmpTable=GemRB.LoadTable("strtgold") + GemRB.SetPlayerStat(MyChar, IE_EA, 2 ) + Str=GemRB.GetVar("Ability 1") + GemRB.SetPlayerStat(MyChar, IE_STR, Str) + if Str==18: + GemRB.SetPlayerStat(MyChar,IE_STREXTRA,GemRB.GetVar("StrExtra")) + else: + GemRB.SetPlayerStat(MyChar, IE_STREXTRA,0) + + GemRB.SetPlayerStat(MyChar, IE_INT, GemRB.GetVar("Ability 2")) + GemRB.SetPlayerStat(MyChar, IE_WIS, GemRB.GetVar("Ability 3")) + GemRB.SetPlayerStat(MyChar, IE_DEX, GemRB.GetVar("Ability 4")) + GemRB.SetPlayerStat(MyChar, IE_CON, GemRB.GetVar("Ability 5")) + GemRB.SetPlayerStat(MyChar, IE_CHR, GemRB.GetVar("Ability 6")) + + GemRB.FillPlayerInfo(MyChar,PortraitName+"S", PortraitName+"L") + GemRB.UnloadWindow(CharGenWindow) + GemRB.SetNextScript("PartyFormation") return *************** *** 238,242 **** GemRB.TextAreaAppend(CharGenWindow, TextArea, 1047) GemRB.TextAreaAppend(CharGenWindow, TextArea, ": ") ! GemRB.TextAreaAppend(CharGenWindow, TextArea, GemRB.GetToken("Name")) GemRB.TextAreaAppend(CharGenWindow, TextArea, "", -1) if CharGenState > 0: --- 281,285 ---- GemRB.TextAreaAppend(CharGenWindow, TextArea, 1047) GemRB.TextAreaAppend(CharGenWindow, TextArea, ": ") ! GemRB.TextAreaAppend(CharGenWindow, TextArea, GemRB.GetToken("CHARNAME")) GemRB.TextAreaAppend(CharGenWindow, TextArea, "", -1) if CharGenState > 0: *************** *** 493,500 **** def RaceSelectPress(): ! global RaceWindow, RaceDoneButton, RaceTable, RaceTextArea Race = GemRB.GetVar("Race") - 1 GemRB.SetText(RaceWindow, RaceTextArea, GemRB.GetTableValue(RaceTable, Race, 1) ) ! GemRB.SetButtonState(RaceWindow, RaceDoneButton, IE_GUI_BUTTON_ENABLED) return --- 536,543 ---- def RaceSelectPress(): ! global RaceWindow, RaceDoneButton, RaceTable, RaceTextArea Race = GemRB.GetVar("Race") - 1 GemRB.SetText(RaceWindow, RaceTextArea, GemRB.GetTableValue(RaceTable, Race, 1) ) ! GemRB.SetButtonState(RaceWindow, RaceDoneButton, IE_GUI_BUTTON_ENABLED) return *************** *** 548,552 **** GemRB.SetVarAssoc(ClassWindow, ClassSelectButton , "Class", i + 1) ! ClassMultiButton = GemRB.GetControl(ClassWindow, 10) if HasMulti == 0: GemRB.SetButtonState(ClassWindow, ClassMultiButton, IE_GUI_BUTTON_DISABLED) --- 591,595 ---- GemRB.SetVarAssoc(ClassWindow, ClassSelectButton , "Class", i + 1) ! ClassMultiButton = GemRB.GetControl(ClassWindow, 10) if HasMulti == 0: GemRB.SetButtonState(ClassWindow, ClassMultiButton, IE_GUI_BUTTON_DISABLED) *************** *** 556,560 **** GemRB.SetText(ClassWindow, ClassMultiButton, 11993) ! ClassSpecialButton = GemRB.GetControl(ClassWindow, 11) GemRB.SetButtonState(ClassWindow, ClassSpecialButton, IE_GUI_BUTTON_ENABLED) GemRB.SetEvent(ClassWindow, ClassSpecialButton, IE_GUI_BUTTON_ON_PRESS, "ClassSpecialPress") --- 599,603 ---- GemRB.SetText(ClassWindow, ClassMultiButton, 11993) ! ClassSpecialButton = GemRB.GetControl(ClassWindow, 11) GemRB.SetButtonState(ClassWindow, ClassSpecialButton, IE_GUI_BUTTON_ENABLED) GemRB.SetEvent(ClassWindow, ClassSpecialButton, IE_GUI_BUTTON_ON_PRESS, "ClassSpecialPress") *************** *** 1175,1182 **** def RacialEnemySelectPress(): ! global RacialEnemyWindow, RacialEnemyDoneButton, RacialEnemyTable, RacialEnemyTextArea RacialEnemy = GemRB.GetVar("RacialEnemyIndex") + GemRB.GetVar("RacialEnemy") - 1 GemRB.SetText(RacialEnemyWindow, RacialEnemyTextArea, GemRB.GetTableValue(RacialEnemyTable, RacialEnemy, 1) ) ! GemRB.SetButtonState(RacialEnemyWindow, RacialEnemyDoneButton, IE_GUI_BUTTON_ENABLED) return --- 1218,1225 ---- def RacialEnemySelectPress(): ! global RacialEnemyWindow, RacialEnemyDoneButton, RacialEnemyTable, RacialEnemyTextArea RacialEnemy = GemRB.GetVar("RacialEnemyIndex") + GemRB.GetVar("RacialEnemy") - 1 GemRB.SetText(RacialEnemyWindow, RacialEnemyTextArea, GemRB.GetTableValue(RacialEnemyTable, RacialEnemy, 1) ) ! GemRB.SetButtonState(RacialEnemyWindow, RacialEnemyDoneButton, IE_GUI_BUTTON_ENABLED) return *************** *** 1374,1396 **** def MageSpellsSelect(): ! global CharGenWindow, MageSpellsWindow, MageSpellsTable, MageSpellsTextArea, MageSpellsDoneButton GemRB.SetVisible(CharGenWindow, 0) MageSpellsWindow = GemRB.LoadWindow(7) MageSpellsTable = GemRB.LoadTable("MAGESP") MageSpellsCount = GemRB.GetTableRowCount(MageSpellsTable) MageSpellsSelectPointsLeft = 2 - SpellButton = range (0, 24) for i in range (0, 24): ! SpellButton[i] = GemRB.GetControl(MageSpellsWindow, i + 2) ! GemRB.SetButtonFlags(MageSpellsWindow, SpellButton[i], IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_RADIOBUTTON, OP_OR) if (i < MageSpellsCount): ! GemRB.SetButtonBAM(MageSpellsWindow, SpellButton[i], GemRB.GetTableValue(MageSpellsTable, i, 0), 1, 0, 64) ! GemRB.SetButtonState(MageSpellsWindow, SpellButton[i], IE_GUI_BUTTON_ENABLED) ! GemRB.SetEvent(MageSpellsWindow, SpellButton[i], IE_GUI_BUTTON_ON_PRESS, "MageSpellsSelectPress") ! #GemRB.SetVarAssoc(MageSpellsWindow, SpellButton[i], "SpellIndex", i) else: ! GemRB.SetButtonState(MageSpellsWindow, SpellButton[i], IE_GUI_BUTTON_DISABLED) GemRB.SetToken("number", str(MageSpellsSelectPointsLeft)) --- 1417,1443 ---- def MageSpellsSelect(): ! global CharGenWindow, MageSpellsWindow, MageSpellsTable, MageSpellsTextArea, MageSpellsDoneButton, MageSpellsSelectPointsLeft GemRB.SetVisible(CharGenWindow, 0) MageSpellsWindow = GemRB.LoadWindow(7) MageSpellsTable = GemRB.LoadTable("MAGESP") MageSpellsCount = GemRB.GetTableRowCount(MageSpellsTable) + GemRB.SetVar("MageSpellBook", 0) MageSpellsSelectPointsLeft = 2 + PointsLeftLabel = GemRB.GetControl(MageSpellsWindow, 0x1000001b) + GemRB.SetLabelUseRGB(MageSpellsWindow, PointsLeftLabel, 1) + GemRB.SetText(MageSpellsWindow, PointsLeftLabel, str(MageSpellsSelectPointsLeft)) for i in range (0, 24): ! SpellButton = GemRB.GetControl(MageSpellsWindow, i + 2) ! GemRB.SetButtonFlags(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_CHECKBOX, OP_OR) if (i < MageSpellsCount): ! # Color is no good yet :-( ! GemRB.SetButtonBAM(MageSpellsWindow, SpellButton, GemRB.GetTableValue(MageSpellsTable, i, 0), 1, 0, 63) ! GemRB.SetButtonState(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ENABLED) ! GemRB.SetEvent(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ON_PRESS, "MageSpellsSelectPress") ! GemRB.SetVarAssoc(MageSpellsWindow, SpellButton, "SpellMask", 1 << i) else: ! GemRB.SetButtonState(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_DISABLED) GemRB.SetToken("number", str(MageSpellsSelectPointsLeft)) *************** *** 1413,1419 **** def MageSpellsSelectPress(): ! global MageSpellsWindow, MageSpellsTable, MageSpellsTextArea, MageSpellsDoneButton ! Spell = GemRB.GetVar("SpellIndex") ! GemRB.SetText(MageSpellsWindow, MageSpellsTextArea, GemRB.GetTableValue(MageSpellsTable, Spell, 1) ) return --- 1460,1494 ---- def MageSpellsSelectPress(): ! global MageSpellsWindow, MageSpellsTable, MageSpellsTextArea, MageSpellsDoneButton, MageSpellsSelectPointsLeft ! MageSpellsCount = GemRB.GetTableRowCount(MageSpellsTable) ! MageSpellBook = GemRB.GetVar("MageSpellBook") ! SpellMask = GemRB.GetVar("SpellMask") ! Spell = abs(MageSpellBook - SpellMask) ! ! i = -1 ! while (Spell > 0): ! i = i + 1 ! Spell = Spell >> 1 ! GemRB.SetText(MageSpellsWindow, MageSpellsTextArea, GemRB.GetTableValue(MageSpellsTable, i, 1)) ! ! if (SpellMask < MageSpellBook): ! MageSpellsSelectPointsLeft = MageSpellsSelectPointsLeft + 1 ! for i in range (0, MageSpellsCount): ! SpellButton = GemRB.GetControl(MageSpellsWindow, i + 2) ! if (((1 << i) & SpellMask) == 0): ! GemRB.SetButtonState(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ENABLED) ! GemRB.SetButtonState(MageSpellsWindow, MageSpellsDoneButton, IE_GUI_BUTTON_DISABLED) ! else: ! MageSpellsSelectPointsLeft = MageSpellsSelectPointsLeft - 1 ! if MageSpellsSelectPointsLeft == 0: ! for i in range (0, MageSpellsCount): ! SpellButton = GemRB.GetControl(MageSpellsWindow, i + 2) ! if (((1 << i) & SpellMask) == 0): ! GemRB.SetButtonState(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_DISABLED) ! GemRB.SetButtonState(MageSpellsWindow, MageSpellsDoneButton, IE_GUI_BUTTON_ENABLED) ! ! PointsLeftLabel = GemRB.GetControl(MageSpellsWindow, 0x1000001b) ! GemRB.SetText(MageSpellsWindow, PointsLeftLabel, str(MageSpellsSelectPointsLeft)) ! GemRB.SetVar("MageSpellBook", SpellMask) return *************** *** 1437,1440 **** --- 1512,1546 ---- def MageSpellsMemorize(): + global CharGenWindow, MageMemorizeWindow, MageMemorizeDoneButton + GemRB.SetVisible(CharGenWindow, 0) + MageMemorizeWindow = GemRB.LoadWindow(16) + + MageMemorizeDoneButton = GemRB.GetControl(MageMemorizeWindow, 0) + GemRB.SetButtonState(MageMemorizeWindow, MageMemorizeDoneButton, IE_GUI_BUTTON_DISABLED) + GemRB.SetEvent(MageMemorizeWindow, MageMemorizeDoneButton, IE_GUI_BUTTON_ON_PRESS, "MageMemorizeDonePress") + GemRB.SetText(MageMemorizeWindow, MageMemorizeDoneButton, 11973) + GemRB.SetButtonFlags(MageMemorizeWindow, MageMemorizeDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) + + MageMemorizeCancelButton = GemRB.GetControl(MageMemorizeWindow, 29) + GemRB.SetButtonState(MageMemorizeWindow, MageMemorizeCancelButton, IE_GUI_BUTTON_ENABLED) + GemRB.SetEvent(MageMemorizeWindow, MageMemorizeCancelButton, IE_GUI_BUTTON_ON_PRESS, "MageMemorizeCancelPress") + GemRB.SetText(MageMemorizeWindow, MageMemorizeCancelButton, 13727) + + GemRB.SetVisible(MageMemorizeWindow, 1) + return + + def MageMemorizeDonePress(): + global CharGenWindow, MageMemorizeWindow, SkillsState + GemRB.UnloadWindow(MageMemorizeWindow) + SkillsState = 4 + GemRB.SetVisible(CharGenWindow, 1) + SkillsPress() + return + + def MageMemorizeCancelPress(): + global CharGenWindow, MageMemorizeWindow, SkillsState + GemRB.UnloadWindow(MageMemorizeWindow) + SkillsState = 0 + GemRB.SetVisible(CharGenWindow, 1) return *************** *** 1443,1446 **** --- 1549,1583 ---- def ClericSpellsMemorize(): + global CharGenWindow, ClericMemorizeWindow, ClericMemorizeDoneButton + GemRB.SetVisible(CharGenWindow, 0) + ClericMemorizeWindow = GemRB.LoadWindow(17) + + ClericMemorizeDoneButton = GemRB.GetControl(ClericMemorizeWindow, 0) + GemRB.SetButtonState(ClericMemorizeWindow, ClericMemorizeDoneButton, IE_GUI_BUTTON_DISABLED) + GemRB.SetEvent(ClericMemorizeWindow, ClericMemorizeDoneButton, IE_GUI_BUTTON_ON_PRESS, "ClericMemorizeDonePress") + GemRB.SetText(ClericMemorizeWindow, ClericMemorizeDoneButton, 11973) + GemRB.SetButtonFlags(ClericMemorizeWindow, ClericMemorizeDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) + + ClericMemorizeCancelButton = GemRB.GetControl(ClericMemorizeWindow, 29) + GemRB.SetButtonState(ClericMemorizeWindow, ClericMemorizeCancelButton, IE_GUI_BUTTON_ENABLED) + GemRB.SetEvent(ClericMemorizeWindow, ClericMemorizeCancelButton, IE_GUI_BUTTON_ON_PRESS, "ClericMemorizeCancelPress") + GemRB.SetText(ClericMemorizeWindow, ClericMemorizeCancelButton, 13727) + + GemRB.SetVisible(ClericMemorizeWindow, 1) + return + + def ClericMemorizeDonePress(): + global CharGenWindow, ClericMemorizeWindow, SkillsState + GemRB.UnloadWindow(ClericMemorizeWindow) + SkillsState = 4 + GemRB.SetVisible(CharGenWindow, 1) + SkillsPress() + return + + def ClericMemorizeCancelPress(): + global CharGenWindow, ClericMemorizeWindow, SkillsState + GemRB.UnloadWindow(ClericMemorizeWindow) + SkillsState = 0 + GemRB.SetVisible(CharGenWindow, 1) return *************** *** 1730,1733 **** --- 1867,1871 ---- GemRB.SetVisible(NameWindow, 1) + GemRB.SetControlStatus(NameWindow, NameField, IE_GUI_CONTROL_FOCUSED) return *************** *** 1742,1749 **** def NameDonePress(): global CharGenWindow, CharGenState, NameWindow, NameField, AcceptButton ! GemRB.SetToken("Name", GemRB.QueryText(NameWindow, NameField) ) GemRB.UnloadWindow(NameWindow) - GemRB.SetButtonState(CharGenWindow, AcceptButton, IE_GUI_BUTTON_ENABLED) CharGenState = 8 SetCharacterDescription() GemRB.SetVisible(CharGenWindow, 1) --- 1880,1887 ---- def NameDonePress(): global CharGenWindow, CharGenState, NameWindow, NameField, AcceptButton ! GemRB.SetToken("CHARNAME", GemRB.QueryText(NameWindow, NameField) ) GemRB.UnloadWindow(NameWindow) CharGenState = 8 + GemRB.SetButtonState(CharGenWindow, AcceptButton, IE_GUI_BUTTON_ENABLED) SetCharacterDescription() GemRB.SetVisible(CharGenWindow, 1) *************** *** 1752,1760 **** def NameCancelPress(): global CharGenWindow, NameWindow GemRB.UnloadWindow(NameWindow) GemRB.SetVisible(CharGenWindow, 1) return - # Import Character --- 1890,1899 ---- def NameCancelPress(): global CharGenWindow, NameWindow + + GemRB.SetToken("CHARNAME", "") GemRB.UnloadWindow(NameWindow) GemRB.SetVisible(CharGenWindow, 1) return # Import Character |