From: <ave...@us...> - 2003-10-29 22:49:04
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts In directory sc8-pr-cvs1:/tmp/cvs-serv16797 Modified Files: CharGen.py GUICG1.py Added Files: GUICG12.py Log Message: Appearance dialog --- NEW FILE: GUICG12.py --- #character generation, appearance (GUICG12) import GemRB AppearanceWindow = 0 PortraitButton = 0 def OnLoad(): global AppearanceWindow, PortraitButton GemRB.LoadWindowPack("GUICG") AppearanceWindow = GemRB.LoadWindow(11) TextAreaControl = GemRB.GetControl(AppearanceWindow, 7) GemRB.SetText(AppearanceWindow, TextAreaControl,"") # why is this here? PortraitButton = GemRB.GetControl(AppearanceWindow, 1) GemRB.SetButtonFlags(AppearanceWindow, PortraitButton, IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_NO_IMAGE,OP_SET) LeftButton = GemRB.GetControl(AppearanceWindow,2) RightButton = GemRB.GetControl(AppearanceWindow,3) BackButton = GemRB.GetControl(AppearanceWindow,5) GemRB.SetText(AppearanceWindow,BackButton,15416) DoneButton = GemRB.GetControl(AppearanceWindow,0) GemRB.SetText(AppearanceWindow,DoneButton,11973) GemRB.SetEvent(AppearanceWindow,LeftButton,IE_GUI_BUTTON_ON_PRESS,"LeftPress") GemRB.SetEvent(AppearanceWindow,RightButton,IE_GUI_BUTTON_ON_PRESS,"RightPress") GemRB.SetEvent(AppearanceWindow,DoneButton,IE_GUI_BUTTON_ON_PRESS,"NextPress") GemRB.SetEvent(AppearanceWindow,BackButton,IE_GUI_BUTTON_ON_PRESS,"BackPress") GemRB.SetVisible(AppearanceWindow,1) return def RightPress(): #Portrait=GetNextPortrait() #SetPicture(AppearanceWindow, PortraitButton, Portrait) return def LeftPress(): #Portrait=GetPrevPortrait() #SetPicture(AppearanceWindow, PortraitButton, Portrait) return def BackPress(): GemRB.UnloadWindow(AppearanceWindow) GemRB.SetNextScript("GUICG1") GemRB.SetVar("Gender",0) #scrapping the gender value return def NextPress(): GemRB.UnloadWindow(AppearanceWindow) GemRB.SetNextScript("GUICG2") #appearance return Index: CharGen.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/CharGen.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CharGen.py 29 Oct 2003 18:52:15 -0000 1.5 --- CharGen.py 29 Oct 2003 22:49:01 -0000 1.6 *************** *** 5,11 **** TextAreaControl = 0 CharGenPhase = 0 def OnLoad(): ! global CharGenWindow, TextAreaControl, CharGenPhase CharGenPhase=0 --- 5,12 ---- TextAreaControl = 0 CharGenPhase = 0 + ImportButton = 0 def OnLoad(): ! global CharGenWindow, TextAreaControl, CharGenPhase, ImportButton CharGenPhase=0 *************** *** 52,55 **** --- 53,57 ---- BackButton = GemRB.GetControl(CharGenWindow, 11) GemRB.SetText(CharGenWindow, BackButton, 15416) + GemRB.SetButtonState(CharGenWindow,BackButton,IE_GUI_BUTTON_ENABLED) AcceptButton = GemRB.GetControl(CharGenWindow, 8) *************** *** 59,68 **** --- 61,73 ---- ImportButton = GemRB.GetControl(CharGenWindow, 13) GemRB.SetText(CharGenWindow, ImportButton, 13955) + GemRB.SetButtonState(CharGenWindow,ImportButton,IE_GUI_BUTTON_ENABLED) CancelButton = GemRB.GetControl(CharGenWindow, 15) GemRB.SetText(CharGenWindow, CancelButton, 13727) + GemRB.SetButtonState(CharGenWindow,CancelButton,IE_GUI_BUTTON_ENABLED) BiographyButton = GemRB.GetControl(CharGenWindow, 16) GemRB.SetText(CharGenWindow, BiographyButton, 18003) + GemRB.SetButtonState(CharGenWindow,BiographyButton,IE_GUI_BUTTON_DISABLED) TextAreaControl= GemRB.GetControl(CharGenWindow,9) *************** *** 73,80 **** --- 78,92 ---- GemRB.SetEvent(CharGenWindow, GenderButton, IE_GUI_BUTTON_ON_PRESS, "NextPress") GemRB.SetEvent(CharGenWindow, ImportButton, IE_GUI_BUTTON_ON_PRESS, "ImportPress") + GemRB.SetEvent(CharGenWindow, BiographyButton, IE_GUI_BUTTON_ON_PRESS, "BiographyPress") GemRB.ShowModal(CharGenWindow) return + def BiographyPress(): + GemRB.UnloadWindow(CharGenWindow) + GemRB.SetNextScript("GUICG23") #biography + return + def NextPress(): + GemRB.SetButtonState(CharGenWindow,ImportButton,IE_GUI_BUTTON_DISABLED) GemRB.UnloadWindow(CharGenWindow) GemRB.SetNextScript("GUICG1") #gender Index: GUICG1.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/GUICG1.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GUICG1.py 29 Oct 2003 18:52:15 -0000 1.6 --- GUICG1.py 29 Oct 2003 22:49:01 -0000 1.7 *************** *** 13,18 **** CharGenPhase = 1 GemRB.LoadWindowPack("GUICG") GenderWindow = GemRB.LoadWindow(1) ! CharGenWindow = GemRB.LoadWindow(0) BackButton = GemRB.GetControl(GenderWindow,6) GemRB.SetText(GenderWindow,BackButton,15416) --- 13,42 ---- CharGenPhase = 1 GemRB.LoadWindowPack("GUICG") + CharGenWindow = GemRB.LoadWindow(0) GenderWindow = GemRB.LoadWindow(1) ! ! for i in range(0,7): ! Button = GemRB.GetControl(CharGenWindow,i) ! GemRB.SetButtonState(CharGenWindow,Button,IE_GUI_BUTTON_DISABLED) ! ! PortraitButton = GemRB.GetControl(CharGenWindow, 12) ! GemRB.SetButtonFlags(CharGenWindow, PortraitButton, IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_NO_IMAGE,OP_SET) ! ! 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) ! GemRB.SetButtonState(CharGenWindow,ImportButton,IE_GUI_BUTTON_DISABLED) ! ! CancelButton = GemRB.GetControl(CharGenWindow, 15) ! GemRB.SetText(CharGenWindow, CancelButton, 8159) ! GemRB.SetButtonState(CharGenWindow,CancelButton,IE_GUI_BUTTON_ENABLED) ! ! BiographyButton = GemRB.GetControl(CharGenWindow, 16) ! GemRB.SetText(CharGenWindow, BiographyButton, 18003) ! GemRB.SetButtonState(CharGenWindow,BiographyButton,IE_GUI_BUTTON_DISABLED) ! BackButton = GemRB.GetControl(GenderWindow,6) GemRB.SetText(GenderWindow,BackButton,15416) *************** *** 33,109 **** GemRB.SetEvent(GenderWindow,MaleButton,IE_GUI_BUTTON_ON_PRESS,"ClickedMale") GemRB.SetEvent(GenderWindow,FemaleButton,IE_GUI_BUTTON_ON_PRESS,"ClickedFemale") ! GemRB.SetEvent(GenderWindow,DoneButton,IE_GUI_BUTTON_ON_PRESS,"DonePress") GemRB.SetEvent(GenderWindow,BackButton,IE_GUI_BUTTON_ON_PRESS,"BackPress") GemRB.SetButtonState(GenderWindow,DoneButton,IE_GUI_BUTTON_DISABLED) ! GemRB.SetVisible(CharGenWindow,0) GemRB.SetVisible(GenderWindow,1) return - def DonePress(): - - GemRB.SetVisible(GenderWindow,0) - GemRB.SetVisible(CharGenWindow,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) - - TextAreaControl = GemRB.GetControl(GenderWindow, 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") - return - def ClickedMale(): GemRB.SetText(GenderWindow,TextAreaControl,13083) --- 57,68 ---- GemRB.SetEvent(GenderWindow,MaleButton,IE_GUI_BUTTON_ON_PRESS,"ClickedMale") GemRB.SetEvent(GenderWindow,FemaleButton,IE_GUI_BUTTON_ON_PRESS,"ClickedFemale") ! GemRB.SetEvent(GenderWindow,DoneButton,IE_GUI_BUTTON_ON_PRESS,"NextPress") GemRB.SetEvent(GenderWindow,BackButton,IE_GUI_BUTTON_ON_PRESS,"BackPress") + GemRB.SetEvent(CharGenWindow,CancelButton,IE_GUI_BUTTON_ON_PRESS,"CancelPress") GemRB.SetButtonState(GenderWindow,DoneButton,IE_GUI_BUTTON_DISABLED) ! GemRB.SetVisible(CharGenWindow,1) GemRB.SetVisible(GenderWindow,1) return def ClickedMale(): GemRB.SetText(GenderWindow,TextAreaControl,13083) *************** *** 126,130 **** GemRB.UnloadWindow(CharGenWindow) GemRB.UnloadWindow(GenderWindow) ! GemRB.SetNextScript("GUICG2") #gender return --- 85,89 ---- GemRB.UnloadWindow(CharGenWindow) GemRB.UnloadWindow(GenderWindow) ! GemRB.SetNextScript("GUICG12") #appearance return *************** *** 132,135 **** GemRB.UnloadWindow(CharGenWindow) GemRB.UnloadWindow(GenderWindow) ! GemRB.SetNextScript("Start") return --- 91,94 ---- GemRB.UnloadWindow(CharGenWindow) GemRB.UnloadWindow(GenderWindow) ! GemRB.SetNextScript("CharGen") return |