From: Laszlo T. <ave...@us...> - 2006-12-03 17:17:17
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1 In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv24058/GUIScripts/bg1 Modified Files: GUICommonWindows.py GUIMA.py GUIOPT.py MessageWindow.py Log Message: implemented clairvoyance effect removed typecast from Control->Owner cleaned up guiscripts for partyAI fixed bg1 loading of games ingame Index: MessageWindow.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1/MessageWindow.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MessageWindow.py 11 Aug 2006 23:17:18 -0000 1.20 --- MessageWindow.py 3 Dec 2006 17:16:56 -0000 1.21 *************** *** 74,78 **** def OnIncreaseSize(): ! GSFlags = GemRB.GetVar("MessageWindowSize") Expand = GSFlags&GS_DIALOGMASK GSFlags = GSFlags-Expand --- 74,78 ---- def OnIncreaseSize(): ! GSFlags = GemRB.GetMessageWindowSize() Expand = GSFlags&GS_DIALOGMASK GSFlags = GSFlags-Expand *************** *** 83,87 **** def OnDecreaseSize(): ! GSFlags = GemRB.GetVar("MessageWindowSize") Expand = GSFlags&GS_DIALOGMASK GSFlags = GSFlags-Expand --- 83,87 ---- def OnDecreaseSize(): ! GSFlags = GemRB.GetMessageWindowSize() Expand = GSFlags&GS_DIALOGMASK GSFlags = GSFlags-Expand *************** *** 91,97 **** GemRB.GameSetScreenFlags(Expand + GSFlags, OP_SET) - def TogglePartyAI(): - GemRB.GameSetScreenFlags(GS_PARTYAI, OP_XOR) - def ScrollUp (): TMessageWindow = GemRB.GetVar("MessageWindow") --- 91,94 ---- *************** *** 109,113 **** TMessageWindow = 0 TMessageTA = 0 ! GSFlags = GemRB.GetVar("MessageWindowSize") Expand = GSFlags&GS_DIALOGMASK Override = GSFlags&GS_DIALOG --- 106,110 ---- TMessageWindow = 0 TMessageTA = 0 ! GSFlags = GemRB.GetMessageWindowSize() Expand = GSFlags&GS_DIALOGMASK Override = GSFlags&GS_DIALOG Index: GUICommonWindows.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1/GUICommonWindows.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** GUICommonWindows.py 11 Aug 2006 23:17:18 -0000 1.17 --- GUICommonWindows.py 3 Dec 2006 17:16:56 -0000 1.18 *************** *** 10,19 **** # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Header$ --- 10,19 ---- # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Header$ *************** *** 103,106 **** --- 103,118 ---- return + def AIPress (): + Button = GemRB.GetControl (PortraitWindow, 6) + AI = GemRB.GetMessageWindowSize() & GS_PARTYAI + + if AI: + GemRB.GameSetScreenFlags(GS_PARTYAI, OP_NAND) + GemRB.SetTooltip (PortraitWindow, Button, 15917) + else: + GemRB.GameSetScreenFlags(GS_PARTYAI, OP_OR) + GemRB.SetTooltip (PortraitWindow, Button, 15918) + return + def RestPress (): GemRB.RestParty(0,0,0) *************** *** 443,455 **** # AI Button = GemRB.GetControl (Window, 6) ! GSFlags = GemRB.GetVar ("MessageWindowSize") GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX,OP_OR) #this control is crippled GemRB.SetButtonSprites (Window, Button, "GUIBTACT", 0, 46, 47, 48, 49) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "TogglePartyAI") ! if GSFlags&GS_PARTYAI: ! GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_SELECTED) else: ! GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_ENABLED) #Select All --- 455,468 ---- # AI Button = GemRB.GetControl (Window, 6) ! GSFlags = GemRB.GetMessageWindowSize()&GS_PARTYAI GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX,OP_OR) #this control is crippled GemRB.SetButtonSprites (Window, Button, "GUIBTACT", 0, 46, 47, 48, 49) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "AIPress") ! GemRB.SetVarAssoc (Window, Button, "", GSFlags) ! if GSFlags: ! GemRB.SetTooltip (PortraitWindow, Button, 15917) else: ! GemRB.SetTooltip (PortraitWindow, Button, 15918) #Select All Index: GUIMA.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1/GUIMA.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GUIMA.py 3 Jan 2006 17:16:04 -0000 1.3 --- GUIMA.py 3 Dec 2006 17:16:56 -0000 1.4 *************** *** 34,37 **** --- 34,121 ---- WorldMapControl = None + def RevealMap (): + global MapWindow + global OldPortraitWindow, OldOptionsWindow + + if CloseOtherWindow (ShowMap): + GemRB.UnloadWindow (MapWindow) + GemRB.UnloadWindow (OptionsWindow) + GemRB.UnloadWindow (PortraitWindow) + + MapWindow = None + #this window type should block the game + GemRB.SetVar ("OtherWindow", -1) + GemRB.SetVisible (0,1) + GemRB.UnhideGUI () + GUICommonWindows.PortraitWindow = OldPortraitWindow + OldPortraitWindow = None + GUICommonWindows.OptionsWindow = OldOptionsWindow + OldOptionsWindow = None + + PosX = GemRB.GetVar ("MapControlX") + PosY = GemRB.GetVar ("MapControlY") + + GemRB.RevealArea (PosX, PosY, 30, 1) + GemRB.GamePause (1,0) + return + ################################################### + # for clairvoyance effect + ################################################### + def ShowMap (): + global MapWindow, OptionsWindow, PortraitWindow + global OldPortraitWindow, OldOptionsWindow + + if CloseOtherWindow (ShowMap): + GemRB.UnloadWindow (MapWindow) + GemRB.UnloadWindow (OptionsWindow) + GemRB.UnloadWindow (PortraitWindow) + + MapWindow = None + #this window type should block the game + GemRB.SetVar ("OtherWindow", -1) + GemRB.SetVisible (0,1) + GemRB.UnhideGUI () + GUICommonWindows.PortraitWindow = OldPortraitWindow + OldPortraitWindow = None + GUICommonWindows.OptionsWindow = OldOptionsWindow + OldOptionsWindow = None + return + + GemRB.HideGUI () + GemRB.SetVisible (0,0) + + GemRB.LoadWindowPack ("GUIMAP", 640, 480) + MapWindow = Window = GemRB.LoadWindow (2) + #this window type blocks the game normally, but map window doesn't + GemRB.SetVar ("OtherWindow", MapWindow) + #saving the original portrait window + OldOptionsWindow = GUICommonWindows.OptionsWindow + OptionsWindow = GemRB.LoadWindow (0) + SetupMenuWindowControls (OptionsWindow, 0, "ShowMap") + OldPortraitWindow = GUICommonWindows.PortraitWindow + PortraitWindow = OpenPortraitWindow (0) + GemRB.SetWindowFrame (OptionsWindow) + + # World Map + Button = GemRB.GetControl (Window, 1) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + + # Hide or Show mapnotes + Button = GemRB.GetControl (Window, 3) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + + Label = GemRB.GetControl (Window, 0x10000003) + GemRB.SetText (Window, Label, "") + # Map Control + GemRB.CreateMapControl (Window, 2, 0, 0, 0, 0, 0x10000003, "FLAG1") + Map = GemRB.GetControl (Window, 2) + GemRB.SetVar("ShowMapNotes",3) + GemRB.SetVarAssoc (Window, Map, "ShowMapNotes", IE_GUI_MAP_VIEW_NOTES) + GemRB.SetEvent (Window, Map, IE_GUI_MAP_ON_PRESS, "RevealMap") + GemRB.SetVisible (OptionsWindow, 2) + GemRB.SetVisible (Window, 1) + GemRB.SetVisible (PortraitWindow, 2) + return + ################################################### def OpenMapWindow (): Index: GUIOPT.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1/GUIOPT.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GUIOPT.py 11 Aug 2006 23:17:18 -0000 1.4 --- GUIOPT.py 3 Dec 2006 17:16:56 -0000 1.5 *************** *** 10,19 **** # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Header$ --- 10,19 ---- # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Header$ *************** *** 519,544 **** global LoadMsgWindow - GemRB.HideGUI() - if LoadMsgWindow: - GemRB.UnloadWindow (LoadMsgWindow) - LoadMsgWindow = None - GemRB.SetVar ("FloatWindow", -1) - - GemRB.UnhideGUI () return LoadMsgWindow = Window = GemRB.LoadWindow (4) - GemRB.SetVar ("FloatWindow", LoadMsgWindow) # Load Button = GemRB.GetControl (Window, 0) GemRB.SetText (Window, Button, 15590) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "LoadGame") # Cancel Button = GemRB.GetControl (Window, 1) GemRB.SetText (Window, Button, 13727) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenLoadMsgWindow") # Current game will be destroyed ... --- 519,536 ---- global LoadMsgWindow if LoadMsgWindow: return LoadMsgWindow = Window = GemRB.LoadWindow (4) # Load Button = GemRB.GetControl (Window, 0) GemRB.SetText (Window, Button, 15590) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "LoadGamePress") # Cancel Button = GemRB.GetControl (Window, 1) GemRB.SetText (Window, Button, 13727) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseLoadMsgWindow") # Current game will be destroyed ... *************** *** 546,559 **** GemRB.SetText (Window, Text, 19531) - GemRB.UnhideGUI () GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) ! def LoadGame (): ! OpenOptionsWindow () GemRB.QuitGame () ! GemRB.SetNextScript ('GUILOAD') ################################################### --- 538,580 ---- GemRB.SetText (Window, Text, 19531) GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + def CloseLoadMsgWindow (): + global LoadMsgWindow ! GemRB.UnloadWindow (LoadMsgWindow) ! LoadMsgWindow = None ! GemRB.SetVisible (OptionsWindow, 1) ! return ! ! def LoadGamePress (): ! global LoadMsgWindow ! ! GemRB.UnloadWindow (LoadMsgWindow) ! LoadMsgWindow = None GemRB.QuitGame () ! OpenOptionsWindow() ! GemRB.SetNextScript ("GUILOAD") + def SaveGamePress(): + global QuitMsgWindow + GemRB.UnloadWindow (QuitMsgWindow) + QuitMsgWindow = None + #we need to set a state: quit after save + GemRB.SetVar("QuitAfterSave",1) + OpenOptionsWindow() + OpenSaveWindow () + return + + def QuitGamePress(): + global QuitMsgWindow + + GemRB.UnloadWindow (QuitMsgWindow) + QuitMsgWindow = None + GemRB.QuitGame () + OpenOptionsWindow() + GemRB.SetNextScript ("Start") + return ################################################### *************** *** 562,836 **** global QuitMsgWindow - GemRB.HideGUI() - if QuitMsgWindow: - GemRB.UnloadWindow (QuitMsgWindow) - QuitMsgWindow = None - GemRB.SetVar ("FloatWindow", -1) - GemRB.SetVisible (GemRB.GetVar ("OtherWindow"), 1) - - GemRB.UnhideGUI () return QuitMsgWindow = Window = GemRB.LoadWindow (5) - GemRB.SetVar ("FloatWindow", QuitMsgWindow) - GemRB.SetVisible (GemRB.GetVar ("OtherWindow"), 0) # Save Button = GemRB.GetControl (Window, 0) GemRB.SetText (Window, Button, 15589) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SaveGame") # Quit Game Button = GemRB.GetControl (Window, 1) GemRB.SetText (Window, Button, 15417) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "QuitGame") # Cancel Button = GemRB.GetControl (Window, 2) GemRB.SetText (Window, Button, 13727) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenQuitMsgWindow") # Do you wish to save the game .... Text = GemRB.GetControl (Window, 3) ! GemRB.SetText (Window, Text, 16456) # or ??? - cannot be saved atm GemRB.UnhideGUI () GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) ! def QuitGame (): ! OpenOptionsWindow () ! GemRB.QuitGame () ! GemRB.SetNextScript ('Start') ! ! def SaveGame (): ! OpenOptionsWindow () ! GemRB.QuitGame () ! GemRB.SetNextScript ('GUISAVE') ! ! ! ################################################### ! ! ## key_list = [ ! ## ('GemRB', None), ! ## ('Grab pointer', '^G'), ! ## ('Toggle fullscreen', '^F'), ! ## ('Enable cheats', '^T'), ! ## ('', None), ! ! ## ('IE', None), ! ## ('Open Inventory', 'I'), ! ## ('Open Priest Spells', 'P'), ! ## ('Open Mage Spells', 'S'), ! ## ('Pause Game', 'SPC'), ! ## ('Select Weapon', ''), ! ## ('', None), ! ## ] ! ! ! ## KEYS_PAGE_SIZE = 60 ! ## KEYS_PAGE_COUNT = ((len (key_list) - 1) / KEYS_PAGE_SIZE)+ 1 ! ! ## def OpenKeyboardMappingsWindow (): ! ## global KeysWindow ! ## global last_key_action ! ! ## last_key_action = None ! ! ## GemRB.HideGUI() ! ! ## if KeysWindow: ! ## GemRB.UnloadWindow (KeysWindow) ! ## KeysWindow = None ! ## GemRB.SetVar ("OtherWindow", OptionsWindow) ! ! ## GemRB.LoadWindowPack ("GUIOPT") ! ## GemRB.UnhideGUI () ! ## return ! ! ## GemRB.LoadWindowPack ("GUIKEYS") ! ## KeysWindow = Window = GemRB.LoadWindow (0) ! ## GemRB.SetVar ("OtherWindow", KeysWindow) ! ! ! ## # Default ! ## Button = GemRB.GetControl (Window, 3) ! ## GemRB.SetText (Window, Button, 49051) ! ## #GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") ! ! ## # Done ! ## Button = GemRB.GetControl (Window, 4) ! ## GemRB.SetText (Window, Button, 1403) ! ## GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenKeyboardMappingsWindow") ! ! ## # Cancel ! ## Button = GemRB.GetControl (Window, 5) ! ## GemRB.SetText (Window, Button, 4196) ! ## GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenKeyboardMappingsWindow") ! ! ## keys_setup_page (0) ! ! ! ## #GemRB.SetVisible (KeysWindow, 1) ! ## GemRB.UnhideGUI () ! ! ! ## def keys_setup_page (pageno): ! ## Window = KeysWindow ! ! ! ## # Page n of n ! ## Label = GemRB.GetControl (Window, 0x10000001) ! ## #txt = GemRB.ReplaceVarsInText (49053, {'PAGE': str (pageno + 1), 'NUMPAGES': str (KEYS_PAGE_COUNT)}) ! ## GemRB.SetToken ('PAGE', str (pageno + 1)) ! ## GemRB.SetToken ('NUMPAGES', str (KEYS_PAGE_COUNT)) ! ## GemRB.SetText (Window, Label, 49053) ! ! ! ## for i in range (KEYS_PAGE_SIZE): ! ## try: ! ## label, key = key_list[pageno * KEYS_PAGE_SIZE + i] ! ## except: ! ## label = '' ! ## key = None ! ! ! ## if key == None: ! ## # Section header ! ## Label = GemRB.GetControl (Window, 0x10000005 + i) ! ## GemRB.SetText (Window, Label, '') ! ! ## Label = GemRB.GetControl (Window, 0x10000041 + i) ! ## GemRB.SetText (Window, Label, label) ! ## GemRB.SetLabelTextColor (Window, Label, 0, 255, 255) ! ! ## else: ! ## Label = GemRB.GetControl (Window, 0x10000005 + i) ! ## GemRB.SetText (Window, Label, key) ! ## GemRB.SetEvent (Window, Label, IE_GUI_LABEL_ON_PRESS, "OnActionLabelPress") ! ## GemRB.SetVarAssoc (Window, Label, "KeyAction", i) ! ! ## Label = GemRB.GetControl (Window, 0x10000041 + i) ! ## GemRB.SetText (Window, Label, label) ! ## GemRB.SetEvent (Window, Label, IE_GUI_LABEL_ON_PRESS, "OnActionLabelPress") ! ## GemRB.SetVarAssoc (Window, Label, "KeyAction", i) ! ! ! ! ## last_key_action = None ! ## def OnActionLabelPress (): ! ## global last_key_action ! ! ## Window = KeysWindow ! ## i = GemRB.GetVar ("KeyAction") ! ! ## if last_key_action != None: ! ## Label = GemRB.GetControl (Window, 0x10000005 + last_key_action) ! ## GemRB.SetLabelTextColor (Window, Label, 255, 255, 255) ! ## Label = GemRB.GetControl (Window, 0x10000041 + last_key_action) ! ## GemRB.SetLabelTextColor (Window, Label, 255, 255, 255) ! ! ## Label = GemRB.GetControl (Window, 0x10000005 + i) ! ## GemRB.SetLabelTextColor (Window, Label, 255, 255, 0) ! ## Label = GemRB.GetControl (Window, 0x10000041 + i) ! ## GemRB.SetLabelTextColor (Window, Label, 255, 255, 0) ! ! ## last_key_action = i ! ! ## # 49155 ! ! ## ################################################### ! ! ## def OpenMoviesWindow (): ! ## global MoviesWindow ! ! ## GemRB.HideGUI() ! ! ## if MoviesWindow: ! ## GemRB.UnloadWindow (MoviesWindow) ! ## MoviesWindow = None ! ## GemRB.SetVar ("FloatWindow", -1) ! ! ## GemRB.LoadWindowPack ("GUIOPT") ! ## GemRB.UnhideGUI () ! ## return ! ! ## GemRB.LoadWindowPack ("GUIMOVIE") ! ## # FIXME: clean the window to black ! ## MoviesWindow = Window = GemRB.LoadWindow (0) ! ## GemRB.SetVar ("FloatWindow", MoviesWindow) ! ! ! ## # Play Movie ! ## Button = GemRB.GetControl (Window, 2) ! ## GemRB.SetText (Window, Button, 33034) ! ## GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnPlayMoviePress") ! ! ## # Credits ! ## Button = GemRB.GetControl (Window, 3) ! ## GemRB.SetText (Window, Button, 33078) ! ## GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnCreditsPress") ! ! ## # Done ! ## Button = GemRB.GetControl (Window, 4) ! ## GemRB.SetText (Window, Button, 1403) ! ## GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMoviesWindow") ! ! ## # movie list ! ## List = GemRB.GetControl (Window, 0) ! ## GemRB.SetTextAreaFlags (Window, List, IE_GUI_TEXTAREA_SELECTABLE) ! ## GemRB.SetVarAssoc (Window, List, 'SelectedMovie', -1) ! ! ## #GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMoviesWindow") ! ! ! ## MovieTable = GemRB.LoadTable ("MOVIDESC") ! ! ## for i in range (GemRB.GetTableRowCount (MovieTable)): ! ## #key = GemRB.GetTableRowName (MovieTable, i) ! ## desc = GemRB.GetTableValue (MovieTable, i, 0) ! ## GemRB.TextAreaAppend (Window, List, desc, i) ! ! ## GemRB.UnloadTable (MovieTable) ! ! ! ## GemRB.UnhideGUI () ! ## GemRB.ShowModal (Window, MODAL_SHADOW_BLACK) ! ! ! ## ################################################### ! ## def OnPlayMoviePress (): ! ## selected = GemRB.GetVar ('SelectedMovie') ! ! ## # FIXME: This should not happen, when the PlayMovie button gets ! ## # properly disabled/enabled, but it does not now ! ## if selected == -1: ! ## return ! ! ## MovieTable = GemRB.LoadTable ("MOVIDESC") ! ## key = GemRB.GetTableRowName (MovieTable, selected) ! ## GemRB.UnloadTable (MovieTable) ! ! ## GemRB.SetVisible (MoviesWindow, 0) ! ## GemRB.PlayMovie (key) ! ## GemRB.SetVisible (MoviesWindow, 1) - ## ################################################### - ## def OnCreditsPress (): - ## GemRB.SetVisible (MoviesWindow, 0) - ## GemRB.PlayMovie ("CREDITS") - ## GemRB.SetVisible (MoviesWindow, 1) ################################################### - ################################################### - - # These functions help to setup controls found - # in Video, Audio, Gameplay, Feedback and Autopause - # options windows - - # These controls are usually made from an active - # control (button, slider ...) and a label - def OptSlider (name, window, slider_id, variable, value): --- 583,623 ---- global QuitMsgWindow if QuitMsgWindow: return QuitMsgWindow = Window = GemRB.LoadWindow (5) # Save Button = GemRB.GetControl (Window, 0) GemRB.SetText (Window, Button, 15589) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SaveGamePress") # Quit Game Button = GemRB.GetControl (Window, 1) GemRB.SetText (Window, Button, 15417) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "QuitGamePress") # Cancel Button = GemRB.GetControl (Window, 2) GemRB.SetText (Window, Button, 13727) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseQuitMsgWindow") # Do you wish to save the game .... Text = GemRB.GetControl (Window, 3) ! GemRB.SetText (Window, Text, 16456) # or ??? - cannot be saved atm GemRB.UnhideGUI () GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + def CloseQuitMsgWindow (): + global QuitMsgWindow ! GemRB.UnloadWindow (QuitMsgWindow) ! QuitMsgWindow = None ! GemRB.SetVisible (OptionsWindow, 1) ! return ################################################### def OptSlider (name, window, slider_id, variable, value): |