From: <ave...@us...> - 2003-10-28 21:21:07
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts In directory sc8-pr-cvs1:/tmp/cvs-serv12895 Modified Files: CharGen.py Added Files: GUICG1.py GUICG24.py Log Message: More CG scripts (character import) --- NEW FILE: GUICG1.py --- #character generation, gender (GUICG1) import GemRB CharGenWindow = 0 GenderWindow = 0 TextAreaControl = 0 CharGenPhase = 1 def OnLoad(): global CharGenWindow, GenderWindow, TextAreaControl, CharGenPhase CharGenPhase=1 GemRB.LoadWindowPack("GUICG") CharGenWindow = GemRB.LoadWindow(0) GenderWindow = GemRB.LoadWindow(1) PortraitButton = GemRB.GetControl(CharGenWindow, 12) GemRB.SetButtonFlags(CharGenWindow, PortraitButton, IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_NO_IMAGE,OP_SET) GenderButton = GemRB.GetControl(CharGenWindow,0) GemRB.SetText(CharGenWindow,GenderButton,11956) GemRB.SetButtonState(CharGenWindow,GenderButton,IE_GUI_BUTTON_DISABLED) RaceButton = GemRB.GetControl(CharGenWindow,1) GemRB.SetText(CharGenWindow,RaceButton, 11957) GemRB.SetButtonState(CharGenWindow,RaceButton,IE_GUI_BUTTON_DISABLED) ClassButton = GemRB.GetControl(CharGenWindow,2) GemRB.SetText(CharGenWindow,ClassButton, 11959) GemRB.SetButtonState(CharGenWindow,ClassButton,IE_GUI_BUTTON_DISABLED) AlignmentButton = GemRB.GetControl(CharGenWindow,3) GemRB.SetText(CharGenWindow,AlignmentButton, 11958) GemRB.SetButtonState(CharGenWindow,AlignmentButton,IE_GUI_BUTTON_DISABLED) AbilitiesButton = GemRB.GetControl(CharGenWindow,4) GemRB.SetText(CharGenWindow,AbilitiesButton, 11960) GemRB.SetButtonState(CharGenWindow,AbilitiesButton,IE_GUI_BUTTON_DISABLED) SkillButton = GemRB.GetControl(CharGenWindow,5) GemRB.SetText(CharGenWindow,SkillButton, 17372) GemRB.SetButtonState(CharGenWindow,SkillButton,IE_GUI_BUTTON_DISABLED) AppearanceButton = GemRB.GetControl(CharGenWindow,6) GemRB.SetText(CharGenWindow,AppearanceButton, 11961) GemRB.SetButtonState(CharGenWindow,AppearanceButton,IE_GUI_BUTTON_DISABLED) NameButton = GemRB.GetControl(CharGenWindow,7) GemRB.SetText(CharGenWindow,NameButton, 11963) GemRB.SetButtonState(CharGenWindow,NameButton,IE_GUI_BUTTON_DISABLED) BackButton = GemRB.GetControl(CharGenWindow, 11) GemRB.SetText(CharGenWindow, BackButton, 15416) AcceptButton = GemRB.GetControl(CharGenWindow, 8) GemRB.SetText(CharGenWindow, AcceptButton, 11962) GemRB.SetButtonState(CharGenWindow,AcceptButton,IE_GUI_BUTTON_DISABLED) ImportButton = GemRB.GetControl(CharGenWindow, 13) GemRB.SetText(CharGenWindow, ImportButton, 13955) CancelButton = GemRB.GetControl(CharGenWindow, 15) GemRB.SetText(CharGenWindow, CancelButton, 13727) BiographyButton = GemRB.GetControl(CharGenWindow, 16) GemRB.SetText(CharGenWindow, BiographyButton, 18003) TextAreaControl= GemRB.GetControl(CharGenWindow,9) GemRB.SetText(CharGenWindow, TextAreaControl, 16575) GemRB.SetEvent(CharGenWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") GemRB.SetEvent(CharGenWindow, BackButton, IE_GUI_BUTTON_ON_PRESS, "BackPress") GemRB.SetEvent(CharGenWindow, GenderButton, IE_GUI_BUTTON_ON_PRESS, "NextPress") GemRB.SetVisible(CharGenWindow,1) GemRB.ShowModal(GenderWindow) return def BackPress(): GemRB.UnloadWindow(CharGenWindow) GemRB.UnloadWindow(GenderWindow) GemRB.SetNextScript("CharGen") return def NextPress(): GemRB.UnloadWindow(CharGenWindow) GemRB.UnloadWindow(GenderWindow) GemRB.SetNextScript("GUICG2") #gender return def CancelPress(): GemRB.UnloadWindow(CharGenWindow) GemRB.UnloadWindow(GenderWindow) GemRB.SetNextScript("Start") return --- NEW FILE: GUICG24.py --- #character generation, import (GUICG24) import GemRB ImportWindow = 0 def OnLoad(): global ImportWindow GemRB.LoadWindowPack("GUICG") ImportWindow = GemRB.LoadWindow(24) TextAreaControl = GemRB.GetControl(ImportWindow, 0) GemRB.SetText(ImportWindow, TextAreaControl, 53605) FileButton = GemRB.GetControl(ImportWindow, 1) GemRB.SetText(ImportWindow, FileButton, 53604) SavedGameButton = GemRB.GetControl(ImportWindow,2) GemRB.SetText(ImportWindow, SavedGameButton, 53602) CancelButton = GemRB.GetControl(ImportWindow,3) GemRB.SetText(ImportWindow, CancelButton, 13727) GemRB.SetEvent(ImportWindow, FileButton, IE_GUI_BUTTON_ON_PRESS, "FilePress") GemRB.SetEvent(ImportWindow, SavedGameButton, IE_GUI_BUTTON_ON_PRESS, "GamePress") GemRB.SetEvent(ImportWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") GemRB.ShowModal(ImportWindow) return def FilePress(): GemRB.UnloadWindow(ImportWindow) GemRB.SetNextScript("Start") return def GamePress(): GemRB.UnloadWindow(ImportWindow) GemRB.SetNextScript("Start") return def CancelPress(): GemRB.UnloadWindow(ImportWindow) GemRB.SetNextScript("CharGen") return Index: CharGen.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/CharGen.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CharGen.py 28 Oct 2003 20:02:37 -0000 1.3 --- CharGen.py 28 Oct 2003 21:20:44 -0000 1.4 *************** *** 69,72 **** --- 69,73 ---- GemRB.SetEvent(CharGenWindow, BackButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") GemRB.SetEvent(CharGenWindow, GenderButton, IE_GUI_BUTTON_ON_PRESS, "NextPress") + GemRB.SetEvent(CharGenWindow, ImportButton, IE_GUI_BUTTON_ON_PRESS, "ImportPress") GemRB.ShowModal(CharGenWindow) return *************** *** 81,82 **** --- 82,89 ---- GemRB.SetNextScript("Start") return + + def ImportPress(): + GemRB.UnloadWindow(CharGenWindow) + GemRB.SetNextScript("GUICG24") #import + return + |