def InitOptionsWindow(Window): """Open main options window""" Container.CloseContainerWindow() # Return to Game Button = Window.GetControl(11) Button.SetText(10308) Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, lambda: Window.Close()) Button.MakeEscape() # Quit Game Button = Window.GetControl(10) Button.SetText(13731) Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, OpenQuitMsgWindow) # Load Game Button = Window.GetControl(5) Button.SetText(13729) Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, LoadGamePress) # Save Game Button = Window.GetControl(6) Button.SetText(13730) Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, OpenSaveMsgWindow) # Video Options Button = Window.GetControl(7) Button.SetText(17162) Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, OpenVideoOptionsWindow) # Audio Options Button = Window.GetControl(8) Button.SetText(17164) Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, OpenAudioOptionsWindow) # Gameplay Options Button = Window.GetControl(9) Button.SetText(17165) Button.SetEvent(IE_GUI_BUTTON_ON_PRESS, OpenGameplayOptionsWindow) # game version, e.g. v1.1.0000 VersionLabel = Window.GetControl(0x1000000b) VersionLabel.SetText(GemRB.Version) if GameCheck.IsIWD2(): # Keyboard shortcuts KeyboardButton = Window.GetControl(13) KeyboardButton.SetText(33468) KeyboardButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, OpenHotkeyOptionsWindow) # Movies MoviesButton = Window.GetControl(14) MoviesButton.SetText(15415) MoviesButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, OpenMovieWindow) return
def InitOptionsWindow(Window): """Open main options window (peacock tail)""" GemRB.GamePause(1, 1) TrySavingConfiguration() Container.CloseContainerWindow() def ConfigOptButton(button, strref, action): button.SetText(strref) button.SetEvent(IE_GUI_BUTTON_ON_PRESS, action) # Return to Game ConfigOptButton(Window.GetControl(0), 28638, lambda: Window.Close()) # Quit Game ConfigOptButton(Window.GetControl(1), 2595, OpenQuitMsgWindow) # Load Game # german pst has two spaces that need to be squished LoadButton = Window.GetControl(2) LoadGameString = GemRB.GetString(2592) NewString = " ".join(LoadGameString.split()) LoadButton.SetText(NewString) LoadButton.SetEvent(IE_GUI_BUTTON_ON_PRESS, OpenLoadMsgWindow) # Save Game ConfigOptButton(Window.GetControl(3), 20639, GUISAVE.OpenSaveWindow) # Video Options ConfigOptButton(Window.GetControl(4), 28781, OpenVideoOptionsWindow) # Audio Options ConfigOptButton(Window.GetControl(5), 29720, OpenAudioOptionsWindow) # Gameplay Options ConfigOptButton(Window.GetControl(6), 29722, OpenGameplayOptionsWindow) # Keyboard Mappings ConfigOptButton(Window.GetControl(7), 29723, OpenKeyboardMappingsWindow) # Movies ConfigOptButton(Window.GetControl(9), 38156, OpenMoviesWindow) # game version, e.g. v1.1.0000 Label = Window.GetControl(0x10000007) Label.SetText(GemRB.Version) return
def DialogStarted(): global ContinueWindow Container.CloseContainerWindow() # opening control size to maximum, enabling dialog window CommonWindow.SetGameGUIHidden(False) GemRB.GameSetScreenFlags(GS_DIALOG, OP_OR) # disable the 1-6 hotkeys, so they'll work for choosing answers GUICommonWindows.UpdatePortraitWindow() MessageWindow.UpdateControlStatus() ContinueWindow = OpenDialogButton(9)
def DialogStarted (): global ContinueWindow # try to force-close anything which is open GUICommonWindows.CloseTopWindow() Container.CloseContainerWindow() # opening control size to maximum, enabling dialog window CommonWindow.SetGameGUIHidden(False) GemRB.GameSetScreenFlags(GS_DIALOG, OP_OR) # disable the 1-6 hotkeys, so they'll work for choosing answers if GemRB.GetView ("PORTWIN"): GUICommonWindows.UpdatePortraitWindow () ContinueWindow = OpenDialogButton(9)
def DialogStarted (): global ContinueWindow GUICommonWindows.CloseTopWindow() Container.CloseContainerWindow() # opening control size to maximum, enabling dialog window CommonWindow.SetGameGUIHidden(False) GemRB.GameSetScreenFlags(GS_DIALOG, OP_OR) # disable the 1-6 hotkeys, so they'll work for choosing answers GUICommonWindows.UpdatePortraitWindow () MWin = GemRB.GetView("MSGWIN") CloseButton= MWin.GetControl (0) CloseButton.SetText ("") CloseButton.SetDisabled(True) CloseButton.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR)