From: <ave...@us...> - 2003-11-15 23:15:49
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd2 In directory sc8-pr-cvs1:/tmp/cvs-serv27222/iwd2 Modified Files: GUILOAD.py Log Message: Confirmation screen before deleting a saved game Index: GUILOAD.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd2/GUILOAD.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GUILOAD.py 15 Nov 2003 21:52:59 -0000 1.2 --- GUILOAD.py 15 Nov 2003 23:15:17 -0000 1.3 *************** *** 77,80 **** --- 77,87 ---- GemRB.SetText(LoadWindow, Label, Slotname) + if ActPos<GameCount: + Slotname = GemRB.GetSaveGameAttrib(3,ActPos) + else: + Slotname = "" + Label = GemRB.GetControl(LoadWindow, 0x1000000f+i) + GemRB.SetText(LoadWindow, Label, Slotname) + Button=GemRB.GetControl(LoadWindow, 1+i) if ActPos<GameCount: *************** *** 94,103 **** return ! def DeleteGamePress(): TopIndex = GemRB.GetVar("TopIndex") Pos = TopIndex +GemRB.GetVar("LoadIdx") GemRB.DeleteSaveGame(Pos) ! GemRB.SetVar("TopIndex",TopIndex-1) ScrollBarPress() return --- 101,131 ---- return ! def DeleteGameConfirm(): TopIndex = GemRB.GetVar("TopIndex") Pos = TopIndex +GemRB.GetVar("LoadIdx") GemRB.DeleteSaveGame(Pos) ! if TopIndex>0: ! GemRB.SetVar("TopIndex",TopIndex-1) ScrollBarPress() + GemRB.UnloadWindow(ConfirmWindow) + GemRB.SetVisible(LoadWindow,1) + return + + def DeleteGameCancel(): + GemRB.UnloadWindow(ConfirmWindow) + GemRB.SetVisible(LoadWindow,1) + return + + def DeleteGamePress(): + global ConfirmWindow + + ConfirmWindow=GemRB.LoadWindow(1) + DeleteButton=GemRB.GetControl(ConfirmWindow, 1) + GemRB.SetText(ConfirmWindow, DeleteButton, 13575) + GemRB.SetEvent(ConfirmWindow, DeleteButton, IE_GUI_BUTTON_ON_PRESS, "DeleteGameConfirm") + CancelButton=GemRB.GetControl(ConfirmWindow, 2) + GemRB.SetText(ConfirmWindow, CancelButton, 13727) + GemRB.SetEvent(ConfirmWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "DeleteGameCancel") + GemRB.SetVisible(ConfirmWindow,1) return |