From: <ave...@us...> - 2003-11-15 23:15:49
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2 In directory sc8-pr-cvs1:/tmp/cvs-serv27222/bg2 Modified Files: GUILOAD.py Log Message: Confirmation screen before deleting a saved game Index: GUILOAD.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2/GUILOAD.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GUILOAD.py 15 Nov 2003 21:52:59 -0000 1.6 --- GUILOAD.py 15 Nov 2003 23:15:15 -0000 1.7 *************** *** 93,102 **** return ! def DeleteGamePress(): TopIndex = GemRB.GetVar("TopIndex") Pos = TopIndex +GemRB.GetVar("LoadIdx") GemRB.DeleteSaveGame(Pos) ! GemRB.SetVar("TopIndex",TopIndex-1) ScrollBarPress() return --- 93,123 ---- 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 |