From: <gu...@us...> - 2004-02-28 15:09:55
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21406 Modified Files: CharGen.py Log Message: work on skills and spells selection and some bug fixes Index: CharGen.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd/CharGen.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CharGen.py 24 Feb 2004 22:14:58 -0000 1.4 --- CharGen.py 28 Feb 2004 15:00:22 -0000 1.5 *************** *** 60,63 **** --- 60,67 ---- SkillsDoneButton = 0 + SpellsWindow = 0 + SpellsTextArea = 0 + SpellsDoneButton = 0 + AppearanceButton = 0 AppearanceWindow = 0 *************** *** 362,366 **** GemRB.SetEvent(RaceWindow, RaceDoneButton, IE_GUI_BUTTON_ON_PRESS, "RaceDonePress") GemRB.SetText(RaceWindow, RaceDoneButton, 11973) ! GemRB.SetButtonFlags(GenderWindow, RaceDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) RaceCancelButton = GemRB.GetControl(RaceWindow, 10) --- 366,370 ---- GemRB.SetEvent(RaceWindow, RaceDoneButton, IE_GUI_BUTTON_ON_PRESS, "RaceDonePress") GemRB.SetText(RaceWindow, RaceDoneButton, 11973) ! GemRB.SetButtonFlags(RaceWindow, RaceDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) RaceCancelButton = GemRB.GetControl(RaceWindow, 10) *************** *** 453,457 **** GemRB.SetEvent(ClassWindow, ClassDoneButton, IE_GUI_BUTTON_ON_PRESS, "ClassDonePress") GemRB.SetText(ClassWindow, ClassDoneButton, 11973) ! GemRB.SetButtonFlags(GenderWindow, ClassDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) ClassCancelButton = GemRB.GetControl(ClassWindow, 14) --- 457,461 ---- GemRB.SetEvent(ClassWindow, ClassDoneButton, IE_GUI_BUTTON_ON_PRESS, "ClassDonePress") GemRB.SetText(ClassWindow, ClassDoneButton, 11973) ! GemRB.SetButtonFlags(ClassWindow, ClassDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) ClassCancelButton = GemRB.GetControl(ClassWindow, 14) *************** *** 530,534 **** GemRB.SetEvent(AlignmentWindow, AlignmentDoneButton, IE_GUI_BUTTON_ON_PRESS, "AlignmentDonePress") GemRB.SetText(AlignmentWindow, AlignmentDoneButton, 11973) ! GemRB.SetButtonFlags(GenderWindow, AlignmentDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) AlignmentCancelButton = GemRB.GetControl(AlignmentWindow, 13) --- 534,538 ---- GemRB.SetEvent(AlignmentWindow, AlignmentDoneButton, IE_GUI_BUTTON_ON_PRESS, "AlignmentDonePress") GemRB.SetText(AlignmentWindow, AlignmentDoneButton, 11973) ! GemRB.SetButtonFlags(AlignmentWindow, AlignmentDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) AlignmentCancelButton = GemRB.GetControl(AlignmentWindow, 13) *************** *** 624,628 **** GemRB.SetEvent(AbilitiesWindow, AbilitiesDoneButton, IE_GUI_BUTTON_ON_PRESS, "AbilitiesDonePress") GemRB.SetText(AbilitiesWindow, AbilitiesDoneButton, 11973) ! GemRB.SetButtonFlags(GenderWindow, AbilitiesDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) AbilitiesCancelButton = GemRB.GetControl(AbilitiesWindow, 36) --- 628,632 ---- GemRB.SetEvent(AbilitiesWindow, AbilitiesDoneButton, IE_GUI_BUTTON_ON_PRESS, "AbilitiesDonePress") GemRB.SetText(AbilitiesWindow, AbilitiesDoneButton, 11973) ! GemRB.SetButtonFlags(AbilitiesWindow, AbilitiesDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) AbilitiesCancelButton = GemRB.GetControl(AbilitiesWindow, 36) *************** *** 853,857 **** GemRB.SetEvent(ProficienciesWindow, ProficienciesDoneButton, IE_GUI_BUTTON_ON_PRESS, "ProficienciesDonePress") GemRB.SetText(ProficienciesWindow, ProficienciesDoneButton, 11973) ! GemRB.SetButtonFlags(GenderWindow, ProficienciesDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) ProficienciesCancelButton = GemRB.GetControl(ProficienciesWindow, 77) --- 857,861 ---- GemRB.SetEvent(ProficienciesWindow, ProficienciesDoneButton, IE_GUI_BUTTON_ON_PRESS, "ProficienciesDonePress") GemRB.SetText(ProficienciesWindow, ProficienciesDoneButton, 11973) ! GemRB.SetButtonFlags(ProficienciesWindow, ProficienciesDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) ProficienciesCancelButton = GemRB.GetControl(ProficienciesWindow, 77) *************** *** 920,923 **** --- 924,951 ---- def ProficienciesDonePress(): + global CharGenWindow, ProficienciesWindow, TextArea, SkillsButton, AppearanceButton, CharGenState + GemRB.SetVisible(ProficienciesWindow, 0) + GemRB.UnloadWindow(ProficienciesWindow) + GemRB.SetVisible(CharGenWindow, 1) + + ClassName = GemRB.GetTableRowName(ClassTable, GemRB.GetVar("Class") - 1) + if ClassName == "RANGER" or ClassName == "THIEF" or ClassName == "FIGHTER_THIEF" or ClassName == "FIGHTER_MAGE_THIEF" or ClassName == "MAGE_THIEF" or ClassName == "CLERIC_THIEF" or ClassName == "CLERIC_RANGER": + SkillsSelect() + if ClassName == "MAGE" or ClassName == "CLERIC" or ClassName == "DRUID" or ClassName == "PALADIN" or ClassName == "BARD" or ClassName == "FIGHTER_MAGE" or ClassName == "FIGHTER_CLERIC" or ClassName == "FIGHTER_DRUID" or ClassName == "FIGHTER_MAGE_THIEF" or ClassName == "MAGE_THIEF" or ClassName == "CLERIC_MAGE" or ClassName == "CLERIC_THIEF" or ClassName == "FIGHTER_MAGE_CLERIC" or ClassName == "CLERIC_RANGER": + SpellsSelect() + + GemRB.TextAreaAppend(CharGenWindow, TextArea, "", -1) + GemRB.TextAreaAppend(CharGenWindow, TextArea, 9466, -1) + for i in range(0,15): + ProficiencyValue = GemRB.GetVar("Proficiency" + str(i) ) + if ProficiencyValue > 0: + GemRB.TextAreaAppend(CharGenWindow, TextArea, GemRB.GetTableValue(ProficienciesTable, i, 2), -1) + j = 0 + while j < ProficiencyValue: + GemRB.TextAreaAppend(CharGenWindow, TextArea, "+") + j = j + 1 + GemRB.SetButtonState(CharGenWindow, SkillsButton, IE_GUI_BUTTON_DISABLED) + GemRB.SetButtonState(CharGenWindow, AppearanceButton, IE_GUI_BUTTON_ENABLED) + CharGenState = 6 return *************** *** 928,931 **** --- 956,962 ---- return + + # Skills Selection + def SkillsSelect(): global CharGenWindow, SkillsWindow, SkillsTextArea, SkillsDoneButton, RaceTable, ClassTable *************** *** 958,962 **** GemRB.SetEvent(SkillsWindow, SkillsDoneButton, IE_GUI_BUTTON_ON_PRESS, "SkillsDonePress") GemRB.SetText(SkillsWindow, SkillsDoneButton, 11973) ! GemRB.SetButtonFlags(GenderWindow, SkillsDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) SkillsCancelButton = GemRB.GetControl(SkillsWindow, 25) --- 989,993 ---- GemRB.SetEvent(SkillsWindow, SkillsDoneButton, IE_GUI_BUTTON_ON_PRESS, "SkillsDonePress") GemRB.SetText(SkillsWindow, SkillsDoneButton, 11973) ! GemRB.SetButtonFlags(SkillsWindow, SkillsDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) SkillsCancelButton = GemRB.GetControl(SkillsWindow, 25) *************** *** 987,990 **** --- 1018,1052 ---- + # Spells Selection + + def SpellsSelect(): + global CharGenWindow, SpellsWindow + GemRB.SetVisible(CharGenWindow, 0) + SpellsWindow = GemRB.LoadWindow(7) + + SpellsDoneButton = GemRB.GetControl(SpellsWindow, 0) + GemRB.SetButtonState(SpellsWindow, SpellsDoneButton, IE_GUI_BUTTON_DISABLED) + GemRB.SetEvent(SpellsWindow, SpellsDoneButton, IE_GUI_BUTTON_ON_PRESS, "SpellsDonePress") + GemRB.SetText(SpellsWindow, SpellsDoneButton, 11973) + GemRB.SetButtonFlags(SpellsWindow, SpellsDoneButton, IE_GUI_BUTTON_DEFAULT, OP_OR) + + SpellsCancelButton = GemRB.GetControl(SpellsWindow, 29) + GemRB.SetButtonState(SpellsWindow, SpellsCancelButton, IE_GUI_BUTTON_ENABLED) + GemRB.SetEvent(SpellsWindow, SpellsCancelButton, IE_GUI_BUTTON_ON_PRESS, "SpellsCancelPress") + GemRB.SetText(SpellsWindow, SpellsCancelButton, 13727) + + GemRB.SetVisible(SpellsWindow, 1) + return + + def SpellsDonePress(): + return + + def SpellsCancelPress(): + global CharGenWindow, SpellsWindow + GemRB.UnloadWindow(SpellsWindow) + GemRB.SetVisible(CharGenWindow, 1) + return + + # Appearance Selection |