From: Laszlo T. <ave...@us...> - 2004-09-25 10:02:05
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7729/bg2 Modified Files: GUICG4.py Log Message: added on_press to ability labels too, so they won't steal the event (Bg2 chargen) Index: GUICG4.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2/GUICG4.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** GUICG4.py 28 Aug 2004 20:36:38 -0000 1.11 --- GUICG4.py 25 Sep 2004 10:01:23 -0000 1.12 *************** *** 109,113 **** GemRB.LoadWindowPack("GUICG") ! AbilityTable = GemRB.LoadTable("ability") AbilityWindow = GemRB.LoadWindow(4) --- 109,113 ---- GemRB.LoadWindowPack("GUICG") ! AbilityTable = GemRB.LoadTable("ability") AbilityWindow = GemRB.LoadWindow(4) *************** *** 115,120 **** --- 115,123 ---- StorePress() for i in range(0,6): + Label = GemRB.GetControl(AbilityWindow, i+0x10000009) + GemRB.SetEvent(AbilityWindow, Label, IE_GUI_LABEL_ON_PRESS, "OverPress"+str(i) ) Button = GemRB.GetControl(AbilityWindow, i+30) GemRB.SetEvent(AbilityWindow, Button, IE_GUI_BUTTON_ON_PRESS, "JustPress") + GemRB.SetEvent(AbilityWindow, Button, IE_GUI_MOUSE_LEAVE_BUTTON, "EmptyPress") GemRB.SetVarAssoc(AbilityWindow, Button, "Ability", i) *************** *** 138,142 **** DoneButton = GemRB.GetControl(AbilityWindow,0) GemRB.SetText(AbilityWindow,DoneButton,11973) ! GemRB.SetButtonFlags(AbilityWindow, DoneButton, IE_GUI_BUTTON_DEFAULT,OP_OR) TextAreaControl = GemRB.GetControl(AbilityWindow, 29) --- 141,145 ---- DoneButton = GemRB.GetControl(AbilityWindow,0) GemRB.SetText(AbilityWindow,DoneButton,11973) ! GemRB.SetButtonFlags(AbilityWindow, DoneButton, IE_GUI_BUTTON_DEFAULT,OP_OR) TextAreaControl = GemRB.GetControl(AbilityWindow, 29) *************** *** 218,221 **** --- 221,229 ---- return + def EmptyPress(): + TextAreaControl = GemRB.GetControl(AbilityWindow, 29) + GemRB.SetText(AbilityWindow,TextAreaControl,17247) + return + def StorePress(): GemRB.SetVar("StoredStrExtra",GemRB.GetVar("StrExtra") ) *************** *** 247,251 **** def NextPress(): ! GemRB.UnloadWindow(AbilityWindow) GemRB.SetNextScript("CharGen6") # return --- 255,307 ---- def NextPress(): ! GemRB.UnloadWindow(AbilityWindow) GemRB.SetNextScript("CharGen6") # return + + def OverPress0(): + Ability = GemRB.GetVar("Ability 0") + CalcLimits(0) + GemRB.SetToken("MINIMUM",str(Minimum) ) + GemRB.SetToken("MAXIMUM",str(Maximum) ) + GemRB.SetText(AbilityWindow, TextAreaControl, GemRB.GetTableValue(AbilityTable, 0, 1) ) + return + + def OverPress1(): + Ability = GemRB.GetVar("Ability 1") + CalcLimits(1) + GemRB.SetToken("MINIMUM",str(Minimum) ) + GemRB.SetToken("MAXIMUM",str(Maximum) ) + GemRB.SetText(AbilityWindow, TextAreaControl, GemRB.GetTableValue(AbilityTable, 1, 1) ) + return + + def OverPress2(): + Ability = GemRB.GetVar("Ability 2") + CalcLimits(2) + GemRB.SetToken("MINIMUM",str(Minimum) ) + GemRB.SetToken("MAXIMUM",str(Maximum) ) + GemRB.SetText(AbilityWindow, TextAreaControl, GemRB.GetTableValue(AbilityTable, 2, 1) ) + return + + def OverPress3(): + Ability = GemRB.GetVar("Ability 3") + CalcLimits(3) + GemRB.SetToken("MINIMUM",str(Minimum) ) + GemRB.SetToken("MAXIMUM",str(Maximum) ) + GemRB.SetText(AbilityWindow, TextAreaControl, GemRB.GetTableValue(AbilityTable, 3, 1) ) + return + + def OverPress4(): + Ability = GemRB.GetVar("Ability 4") + CalcLimits(4) + GemRB.SetToken("MINIMUM",str(Minimum) ) + GemRB.SetToken("MAXIMUM",str(Maximum) ) + GemRB.SetText(AbilityWindow, TextAreaControl, GemRB.GetTableValue(AbilityTable, 4, 1) ) + return + + def OverPress5(): + Ability = GemRB.GetVar("Ability 5") + CalcLimits(5) + GemRB.SetToken("MINIMUM",str(Minimum) ) + GemRB.SetToken("MAXIMUM",str(Maximum) ) + GemRB.SetText(AbilityWindow, TextAreaControl, GemRB.GetTableValue(AbilityTable, 5, 1) ) + return |