def OpenAudioOptionsWindow(): """Open audio options window""" global HelpTextArea #GemRB.GetView("SUB_WIN", 0).Close() Window = GemRB.LoadWindow(7, "GUIOPT") Window.AddAlias("SUB_WIN", 0) Window.SetFlags(WF_BORDERLESS, OP_OR) HelpTextArea = GUIOPTControls.OptHelpText('AudioOptions', Window, 14, 18040) GUIOPTControls.OptDone(CloseAudioOptionsWindow, Window, 24) GUIOPTControls.OptCancel(CloseAudioOptionsWindow, Window, 25) GUIOPTControls.OptButton(OpenCharacterSoundsWindow, Window, 13, 17778) GUIOPTControls.OptSlider(18040, 18008, HelpTextArea, Window, 1, 16, 16514, 'Volume Ambients', DisplayHelpAmbientVolume, 10) GUIOPTControls.OptSlider(18040, 18009, HelpTextArea, Window, 2, 17, 16515, 'Volume SFX', None, 10) GUIOPTControls.OptSlider(18040, 18010, HelpTextArea, Window, 3, 18, 16512, 'Volume Voices', None, 10) GUIOPTControls.OptSlider(18040, 18011, HelpTextArea, Window, 4, 19, 16511, 'Volume Music', DisplayHelpMusicVolume, 10) GUIOPTControls.OptSlider(18040, 18012, HelpTextArea, Window, 22, 20, 16546, 'Volume Movie', None, 10) GUIOPTControls.OptCheckbox(18040, 18022, HelpTextArea, Window, 26, 28, 20689, 'Environmental Audio') Window.ShowModal(MODAL_SHADOW_GRAY) return
def OpenAutopauseOptionsWindow (): """Open autopause options window""" global SubSubOptionsWindow, AutopauseHelpText GemRB.HideGUI () if SubSubOptionsWindow: CloseSubSubOptionsWindow () GemRB.UnhideGUI () return SubSubOptionsWindow = Window = GemRB.LoadWindow (9) GemRB.SetVar ("FloatWindow", SubSubOptionsWindow.ID) AutopauseHelpText = GUIOPTControls.OptHelpText ('AutopauseOptions', Window, 1, 31214) GUIOPTControls.OptDone (OpenAutopauseOptionsWindow, Window, 16) GUIOPTControls.OptCancel (OpenAutopauseOptionsWindow, Window, 17) # checkboxes OR the values if they associate to the same variable GUIOPTControls.OptCheckbox (31214, 37688, AutopauseHelpText, Window, 2, 9, 37598, "Auto Pause State", None, 4) GUIOPTControls.OptCheckbox (31214, 37689, AutopauseHelpText, Window, 3, 10, 37681, "Auto Pause State", None, 8) GUIOPTControls.OptCheckbox (31214, 37690, AutopauseHelpText, Window, 4, 11, 37682, "Auto Pause State", None, 16) GUIOPTControls.OptCheckbox (31214, 37691, AutopauseHelpText, Window, 5, 12, 37683, "Auto Pause State", None, 2) GUIOPTControls.OptCheckbox (31214, 37692, AutopauseHelpText, Window, 6, 13, 37684, "Auto Pause State", None, 1) GUIOPTControls.OptCheckbox (31214, 37693, AutopauseHelpText, Window, 7, 14, 37685, "Auto Pause State", None, 32) GUIOPTControls.OptCheckbox (31214, 37694, AutopauseHelpText, Window, 8, 15, 37686, "Auto Pause State", None, 64) GemRB.UnhideGUI () Window.ShowModal (MODAL_SHADOW_GRAY)
def OpenFeedbackOptionsWindow (): """Open feedback options window""" global SubSubOptionsWindow, HelpTextArea2 Window = SubSubOptionsWindow CloseSubSubOptionsWindow () Window = GemRB.LoadWindow (9) # same as HelpTextArea if not BG1 HelpTextArea2 = GUIOPTControls.OptHelpText ('FeedbackOptions', Window, 28, 18043) GemRB.SetVar ("Circle Feedback", GemRB.GetVar ("GUI Feedback Level") - 1) GUIOPTControls.OptDone (CloseFeedbackOptionsWindow, Window, 26) GUIOPTControls.OptCancel (CloseFeedbackOptionsWindow, Window, 27) GUIOPTControls.OptSlider (18043, 18024, HelpTextArea2, Window, 8, 30, 13688, 'Circle Feedback', DisplayHelpMarkerFeedback) GUIOPTControls.OptSlider (18043, 18025, HelpTextArea2, Window, 9, 31, 17769, 'Locator Feedback Level') GUIOPTControls.OptCheckbox (18043, 18026, HelpTextArea2, Window, 10, 32, 17149, 'Extra Feedback') GUIOPTControls.OptCheckbox (18043, 18027, HelpTextArea2, Window, 11, 33, 17150, 'Combat Info') GUIOPTControls.OptCheckbox (18043, 18028, HelpTextArea2, Window, 12, 34, 17151, 'Actions') GUIOPTControls.OptCheckbox (18043, 18029, HelpTextArea2, Window, 13, 35, 17152, 'State Changes') GUIOPTControls.OptCheckbox (18043, 18030, HelpTextArea2, Window, 14, 36, 17181, 'Selection Text') GUIOPTControls.OptCheckbox (18043, 18031, HelpTextArea2, Window, 15, 37, 17153, 'Miscellaneous Text') Window.ShowModal (MODAL_SHADOW_GRAY) SubSubOptionsWindow = Window return
def OpenAudioOptionsWindow(): """Open audio options window""" global SubOptionsWindow, HelpTextArea Window = SubOptionsWindow CloseSubOptionsWindow() Window = GemRB.LoadWindow(7) HelpTextArea = GUIOPTControls.OptHelpText('AudioOptions', Window, 14, 18040) GUIOPTControls.OptDone(CloseAudioOptionsWindow, Window, 24) GUIOPTControls.OptCancel(CloseAudioOptionsWindow, Window, 25) GUIOPTControls.OptButton(OpenCharacterSoundsWindow, Window, 13, 17778) GUIOPTControls.OptSlider(18040, 18008, HelpTextArea, Window, 1, 16, 16514, 'Volume Ambients', DisplayHelpAmbientVolume, 10) GUIOPTControls.OptSlider(18040, 18009, HelpTextArea, Window, 2, 17, 16515, 'Volume SFX', None, 10) GUIOPTControls.OptSlider(18040, 18010, HelpTextArea, Window, 3, 18, 16512, 'Volume Voices', None, 10) GUIOPTControls.OptSlider(18040, 18011, HelpTextArea, Window, 4, 19, 16511, 'Volume Music', DisplayHelpMusicVolume, 10) GUIOPTControls.OptSlider(18040, 18012, HelpTextArea, Window, 22, 20, 16546, 'Volume Movie', None, 10) GUIOPTControls.OptCheckbox(18040, 18022, HelpTextArea, Window, 26, 28, 20689, 'Environmental Audio') SubOptionsWindow = Window Window.ShowModal(MODAL_SHADOW_GRAY) return
def OpenAutopauseOptionsWindow(): """Open autopause options window""" global AutopauseHelpText Window = GemRB.LoadWindow(9, "GUIOPT") AutopauseHelpText = GUIOPTControls.OptHelpText('AutopauseOptions', Window, 1, 31214) GUIOPTControls.OptDone(lambda: Window.Close(), Window, 16) GUIOPTControls.OptCancel(lambda: Window.Close(), Window, 17) # checkboxes OR the values if they associate to the same variable GUIOPTControls.OptCheckbox(31214, 37688, AutopauseHelpText, Window, 2, 9, 37598, "Auto Pause State", None, 4) GUIOPTControls.OptCheckbox(31214, 37689, AutopauseHelpText, Window, 3, 10, 37681, "Auto Pause State", None, 8) GUIOPTControls.OptCheckbox(31214, 37690, AutopauseHelpText, Window, 4, 11, 37682, "Auto Pause State", None, 16) GUIOPTControls.OptCheckbox(31214, 37691, AutopauseHelpText, Window, 5, 12, 37683, "Auto Pause State", None, 2) GUIOPTControls.OptCheckbox(31214, 37692, AutopauseHelpText, Window, 6, 13, 37684, "Auto Pause State", None, 1) GUIOPTControls.OptCheckbox(31214, 37693, AutopauseHelpText, Window, 7, 14, 37685, "Auto Pause State", None, 32) GUIOPTControls.OptCheckbox(31214, 37694, AutopauseHelpText, Window, 8, 15, 37686, "Auto Pause State", None, 64) Window.ShowModal(MODAL_SHADOW_GRAY)
def OpenVideoOptionsWindow (): """Open video options window""" global SubOptionsWindow, VideoHelpText GemRB.HideGUI () if SubOptionsWindow: CloseSubOptionsWindow () TrySavingConfiguration() GemRB.UnhideGUI () return SubOptionsWindow = Window = GemRB.LoadWindow (1) GemRB.SetVar ("FloatWindow", SubOptionsWindow.ID) VideoHelpText = GUIOPTControls.OptHelpText ('VideoOptions', Window, 9, 31052) GUIOPTControls.OptDone (OpenVideoOptionsWindow, Window, 7) GUIOPTControls.OptCancel (OpenVideoOptionsWindow, Window, 8) GUIOPTControls.OptSlider (31052, 31431, VideoHelpText, Window, 1, 10, 31234, "Brightness Correction", lambda: GammaFeedback(31431)) GUIOPTControls.OptSlider (31052, 31459, VideoHelpText, Window, 2, 11, 31429, "Gamma Correction", lambda: GammaFeedback(31459)) GUIOPTControls.OptCheckbox (31052, 31221, VideoHelpText, Window, 6, 15, 30898, "SoftBlt") GUIOPTControls.OptCheckbox (31052, 31216, VideoHelpText, Window, 4, 13, 30896, "SoftMirrorBlt") GUIOPTControls.OptCheckbox (31052, 31220, VideoHelpText, Window, 5, 14, 30897, "SoftSrcKeyBlt") GemRB.UnhideGUI () Window.ShowModal (MODAL_SHADOW_GRAY) return
def OpenFeedbackOptionsWindow (): """Open feedback options window""" global HelpTextArea2 Window = GemRB.LoadWindow (9, "GUIOPT") Window.AddAlias("SUB_WIN", 1) Window.SetFlags (WF_BORDERLESS, OP_OR) # same as HelpTextArea if not BG1 HelpTextArea2 = GUIOPTControls.OptHelpText ('FeedbackOptions', Window, 28, 18043) GemRB.SetVar ("Circle Feedback", GemRB.GetVar ("GUI Feedback Level") - 1) GUIOPTControls.OptDone (Window.Close, Window, 26) GUIOPTControls.OptCancel (Window.Close, Window, 27) GUIOPTControls.OptSlider (18043, 18024, HelpTextArea2, Window, 8, 30, 13688, 'Circle Feedback', DisplayHelpMarkerFeedback) GUIOPTControls.OptSlider (18043, 18025, HelpTextArea2, Window, 9, 31, 17769, 'Locator Feedback Level') # to hit rolls (extra feedback), combat info, actions, state changes, selection text, miscellaneus GUIOPTControls.OptCheckbox (18043, 18026, HelpTextArea2, Window, 10, 32, 17149, 'Effect Text Level', None, 1) GUIOPTControls.OptCheckbox (18043, 18027, HelpTextArea2, Window, 11, 33, 17150, 'Effect Text Level', None, 2) GUIOPTControls.OptCheckbox (18043, 18028, HelpTextArea2, Window, 12, 34, 17151, 'Effect Text Level', None, 4) GUIOPTControls.OptCheckbox (18043, 18029, HelpTextArea2, Window, 13, 35, 17152, 'Effect Text Level', None, 8) GUIOPTControls.OptCheckbox (18043, 18030, HelpTextArea2, Window, 14, 36, 17181, 'Effect Text Level', None, 16) GUIOPTControls.OptCheckbox (18043, 18031, HelpTextArea2, Window, 15, 37, 17153, 'Effect Text Level', None, 32) # pst adds bit 64, but it still has its own GUIOPT; let's just ensure it is set GemRB.SetVar ('Effect Text Level', GemRB.GetVar ('Effect Text Level') | 64) Window.ShowModal (MODAL_SHADOW_GRAY) return
def OpenVideoOptionsWindow(): """Open video options window""" global VideoHelpText def OnClose(Window): TrySavingConfiguration() Window = GemRB.LoadWindow(1, "GUIOPT") Window.SetAction(OnClose, ACTION_WINDOW_CLOSED) VideoHelpText = GUIOPTControls.OptHelpText('VideoOptions', Window, 9, 31052) GUIOPTControls.OptDone(lambda: Window.Close(), Window, 7) GUIOPTControls.OptCancel(lambda: Window.Close(), Window, 8) GUIOPTControls.OptSlider(31052, 31431, VideoHelpText, Window, 1, 10, 31234, "Brightness Correction", lambda: GammaFeedback(31431)) GUIOPTControls.OptSlider(31052, 31459, VideoHelpText, Window, 2, 11, 31429, "Gamma Correction", lambda: GammaFeedback(31459)) GUIOPTControls.OptCheckbox(31052, 31221, VideoHelpText, Window, 6, 15, 30898, "SoftBlt") GUIOPTControls.OptCheckbox(31052, 31216, VideoHelpText, Window, 4, 13, 30896, "SoftMirrorBlt") GUIOPTControls.OptCheckbox(31052, 31220, VideoHelpText, Window, 5, 14, 30897, "SoftSrcKeyBlt") Window.ShowModal(MODAL_SHADOW_GRAY) return
def OpenFeedbackOptionsWindow (): """Open feedback options window""" global SubSubOptionsWindow, FeedbackHelpText GemRB.HideGUI () if SubSubOptionsWindow: CloseSubSubOptionsWindow () GemRB.UnhideGUI () return SubSubOptionsWindow = Window = GemRB.LoadWindow (8) GemRB.SetVar ("FloatWindow", SubSubOptionsWindow.ID) GemRB.SetVar ("Circle Feedback", GemRB.GetVar ("GUI Feedback Level") - 1) FeedbackHelpText = GUIOPTControls.OptHelpText ('FeedbackOptions', Window, 9, 37410) GUIOPTControls.OptDone (OpenFeedbackOptionsWindow, Window, 7) GUIOPTControls.OptCancel (OpenFeedbackOptionsWindow, Window, 8) GUIOPTControls.OptSlider (31213, 37411, FeedbackHelpText, Window, 1, 10, 37463, "Circle Feedback", UpdateMarkerFeedback) GUIOPTControls.OptSlider (31213, 37447, FeedbackHelpText, Window, 2, 11, 37586, "Locator Feedback Level") GUIOPTControls.OptSlider (31213, 54878, FeedbackHelpText, Window, 20, 21, 54879, "Selection Sounds Frequency") GUIOPTControls.OptSlider (31213, 54880, FeedbackHelpText, Window, 22, 23, 55012, "Command Sounds Frequency") # TODO: once the pst overhead messaging system is in place, add the relevant game vars below GUIOPTControls.OptCheckbox (31213, 37460, FeedbackHelpText, Window, 6, 15, 37594, "") GUIOPTControls.OptCheckbox (31213, 37462, FeedbackHelpText, Window, 17, 19, 37596, "") GUIOPTControls.OptCheckbox (31213, 37453, FeedbackHelpText, Window, 3, 12, 37588, "") GUIOPTControls.OptCheckbox (31213, 37457, FeedbackHelpText, Window, 4, 13, 37590, "") GUIOPTControls.OptCheckbox (31213, 37458, FeedbackHelpText, Window, 5, 14, 37592, "") GemRB.UnhideGUI () Window.ShowModal (MODAL_SHADOW_GRAY)
def OpenVideoOptionsWindow (): """Open video options window""" global HelpTextArea Window = GemRB.LoadWindow (6, "GUIOPT") Window.AddAlias("SUB_WIN", 0) Window.SetFlags (WF_BORDERLESS, OP_OR) HelpTextArea = GUIOPTControls.OptHelpText ('VideoOptions', Window, 33, 18038) GUIOPTControls.OptDone (CloseVideoOptionsWindow, Window, 21) GUIOPTControls.OptCancel (CloseVideoOptionsWindow, Window, 32) GUIOPTControls.OptSlider (18038, 17203, HelpTextArea, Window, 3, 35, 17129, 'Brightness Correction', DisplayHelpBrightness, 4) GUIOPTControls.OptSlider (18038, 17204, HelpTextArea, Window, 22, 36, 17128, 'Gamma Correction', DisplayHelpContrast) GUIOPTControls.OptRadio (DisplayHelpBPP, Window, 5, 37, 'BitsPerPixel', 16) GUIOPTControls.OptRadio (DisplayHelpBPP, Window, 6, 37, 'BitsPerPixel', 24) GUIOPTControls.OptRadio (DisplayHelpBPP, Window, 7, 37, 'BitsPerPixel', 32) GUIOPTControls.OptCheckbox (18038, 18000, HelpTextArea, Window, 9, 38, 17131, 'Full Screen', DisplayHelpFullScreen) GUIOPTControls.OptCheckbox (18038, 20620, HelpTextArea, Window, 51, 50, 20617, 'Translucent Shadows') GUIOPTControls.OptCheckbox (18038, 18004, HelpTextArea, Window, 40, 44, 17134, 'SoftMirrorBlt') GUIOPTControls.OptCheckbox (18038, 18006, HelpTextArea, Window, 41, 46, 17136, 'SoftSrcKeyBlt') # software standard blit GUIOPTControls.OptCheckbox (18038, 18007, HelpTextArea, Window, 42, 48, 17135, 'SoftBltFast') # software transparent blit Window.ShowModal (MODAL_SHADOW_GRAY) return
def OpenCharacterSoundsWindow (): """Open character sounds window""" global SubSubOptionsWindow, HelpTextArea2 Window = SubSubOptionsWindow CloseSubSubOptionsWindow () Window = GemRB.LoadWindow (12) HelpTextArea2 = GUIOPTControls.OptHelpText ('CharacterSounds', Window, 16, 18041) GUIOPTControls.OptDone (CloseCharacterSoundsWindow, Window, 24) GUIOPTControls.OptCancel (CloseCharacterSoundsWindow, Window, 25) GUIOPTControls.OptCheckbox (18041, 18015, HelpTextArea2, Window, 5, 20, 17138, 'Subtitles') GUIOPTControls.OptCheckbox (18041, 18013, HelpTextArea2, Window, 6, 18, 17139, 'Attack Sound') GUIOPTControls.OptCheckbox (18041, 18014, HelpTextArea2, Window, 7, 19, 17140, 'Footsteps') GUIOPTControls.OptRadio (DisplayHelpCommandSounds, Window, 8, 21, 'Command Sounds Frequency', 2) GUIOPTControls.OptRadio (DisplayHelpCommandSounds, Window, 9, 21, 'Command Sounds Frequency', 1) GUIOPTControls.OptRadio (DisplayHelpCommandSounds, Window, 10, 21, 'Command Sounds Frequency', 0) GUIOPTControls.OptRadio (DisplayHelpSelectionSounds, Window, 58, 57, 'Selection Sounds Frequency', 2) GUIOPTControls.OptRadio (DisplayHelpSelectionSounds, Window, 59, 57, 'Selection Sounds Frequency', 1) GUIOPTControls.OptRadio (DisplayHelpSelectionSounds, Window, 60, 57, 'Selection Sounds Frequency', 0) Window.ShowModal (MODAL_SHADOW_GRAY) SubSubOptionsWindow = Window
def OpenFeedbackOptionsWindow (): """Open feedback options window""" global FeedbackHelpText Window = GemRB.LoadWindow (8, "GUIOPT") GemRB.SetVar ("Circle Feedback", GemRB.GetVar ("GUI Feedback Level") - 1) FeedbackHelpText = GUIOPTControls.OptHelpText ('FeedbackOptions', Window, 9, 37410) GUIOPTControls.OptDone (Window.Close, Window, 7) GUIOPTControls.OptCancel (Window.Close, Window, 8) GUIOPTControls.OptSlider (31213, 37411, FeedbackHelpText, Window, 1, 10, 37463, "Circle Feedback", UpdateMarkerFeedback) GUIOPTControls.OptSlider (31213, 37447, FeedbackHelpText, Window, 2, 11, 37586, "Locator Feedback Level") GUIOPTControls.OptSlider (31213, 54878, FeedbackHelpText, Window, 20, 21, 54879, "Selection Sounds Frequency") GUIOPTControls.OptSlider (31213, 54880, FeedbackHelpText, Window, 22, 23, 55012, "Command Sounds Frequency") # others have: to hit rolls, combat info, [actions], state changes, [selection text], misc # pst: states, misc, to hit rolls, combat info, [spell casting]; and separate sliders for selection and command # we harmonize it across games by likely breaking compatibility with the original # there's no need to disable values 4 and 16 (set by our defaults.ini), since their use takes the separate sliders into account GUIOPTControls.OptCheckbox (31213, 37460, FeedbackHelpText, Window, 6, 15, 37594, 'Effect Text Level', None, 8) GUIOPTControls.OptCheckbox (31213, 37462, FeedbackHelpText, Window, 17, 19, 37596, 'Effect Text Level', None, 32) GUIOPTControls.OptCheckbox (31213, 37453, FeedbackHelpText, Window, 3, 12, 37588, 'Effect Text Level', None, 1) GUIOPTControls.OptCheckbox (31213, 37457, FeedbackHelpText, Window, 4, 13, 37590, 'Effect Text Level', None, 2) GUIOPTControls.OptCheckbox (31213, 37458, FeedbackHelpText, Window, 5, 14, 37592, 'Effect Text Level', None, 64) Window.ShowModal (MODAL_SHADOW_GRAY)
def OpenGameplayOptionsWindow (): """Open gameplay options window""" global GameplayHelpText Window = GemRB.LoadWindow (6, "GUIOPT") def OnClose(Window): TrySavingConfiguration() Window.SetAction(OnClose, ACTION_WINDOW_CLOSED) GameplayHelpText = GUIOPTControls.OptHelpText ('GameplayOptions', Window, 12, 31212) GUIOPTControls.OptDone (Window.Close, Window, 10) GUIOPTControls.OptCancel (Window.Close, Window, 11) GUIOPTControls.OptSlider (31212, 31232, GameplayHelpText, Window, 1, 13, 31481, "Tooltips", UpdateTooltips, TOOLTIP_DELAY_FACTOR) GUIOPTControls.OptSlider (31212, 31230, GameplayHelpText, Window, 2, 14, 31482, "Mouse Scroll Speed", UpdateMouseSpeed) GUIOPTControls.OptSlider (31212, 31231, GameplayHelpText, Window, 3, 15, 31480, "Keyboard Scroll Speed") GUIOPTControls.OptSlider (31212, 31233, GameplayHelpText, Window, 4, 16, 31479, "Difficulty Level") GUIOPTControls.OptCheckbox (31212, 31222, GameplayHelpText, Window, 5, 17, 31217, "Always Dither") GUIOPTControls.OptCheckbox (31212, 31223, GameplayHelpText, Window, 6, 18, 31218, "Gore") GUIOPTControls.OptCheckbox (31212, 62419, GameplayHelpText, Window, 22, 23, 62418, "Always Run", GUICommonWindows.ToggleAlwaysRun) PSTOptButton (31212, 31213, GameplayHelpText, Window, 8, 20, 31478, OpenFeedbackOptionsWindow) PSTOptButton (31212, 31214, GameplayHelpText, Window, 9, 21, 31470, OpenAutopauseOptionsWindow) Window.ShowModal (MODAL_SHADOW_GRAY) return
def OpenGameplayOptionsWindow(): """Open gameplay options window""" global HelpTextArea #GemRB.GetView("SUB_WIN", 0).Close() #gameplayoptions Window = GemRB.LoadWindow(8, "GUIOPT") Window.AddAlias("SUB_WIN", 0) Window.SetFlags(WF_BORDERLESS, OP_OR) HelpTextArea = GUIOPTControls.OptHelpText('GameplayOptions', Window, 40, 18042) GUIOPTControls.OptDone(CloseGameplayOptionsWindow, Window, 7) GUIOPTControls.OptCancel(CloseGameplayOptionsWindow, Window, 20) GUIOPTControls.OptSlider(18042, 18017, HelpTextArea, Window, 1, 21, 17143, 'Tooltips', DisplayHelpTooltipDelay, 10) GUIOPTControls.OptSlider(18042, 18018, HelpTextArea, Window, 2, 22, 17144, 'Mouse Scroll Speed', DisplayHelpMouseScrollingSpeed, 5) GUIOPTControls.OptSlider(18042, 18019, HelpTextArea, Window, 3, 23, 17145, 'Keyboard Scroll Speed', None, 5) GUIOPTControls.OptSlider(18042, 18020, HelpTextArea, Window, 12, 24, 13911, 'Difficulty Level', None, 0) if GemRB.GetVar("Nightmare Mode") == 1: # lock the slider Slider = Window.GetControl(12) Slider.SetDisabled(True) GUIOPTControls.OptCheckbox(18042, 18021, HelpTextArea, Window, 14, 25, 13697, 'Always Dither') GUIOPTControls.OptCheckbox(18042, 18023, HelpTextArea, Window, 19, 27, 17182, 'Gore') GUIOPTControls.OptCheckbox(18042, 11797, HelpTextArea, Window, 42, 44, 11795, 'Infravision') GUIOPTControls.OptCheckbox(18042, 20619, HelpTextArea, Window, 47, 46, 20618, 'Weather') if GameCheck.IsBG2(): GUIOPTControls.OptCheckbox(18042, 2242, HelpTextArea, Window, 50, 48, 2241, 'Heal Party on Rest') elif GameCheck.IsIWD2() or GameCheck.IsIWD1(): GUIOPTControls.OptCheckbox(18042, 15136, HelpTextArea, Window, 50, 49, 17378, 'Maximum HP') GUIOPTControls.OptButton(OpenFeedbackOptionsWindow, Window, 5, 17163) GUIOPTControls.OptButton(OpenAutopauseOptionsWindow, Window, 6, 17166) if GameCheck.IsBG2(): GUIOPTControls.OptButton(OpenHotkeyOptionsWindow, Window, 51, 816) Window.ShowModal(MODAL_SHADOW_GRAY) return
def OpenAudioOptionsWindow(): """Open audio options window""" global SubOptionsWindow, AudioHelpText GemRB.HideGUI() if SubOptionsWindow: CloseSubOptionsWindow() # Restore values in case of cancel if GemRB.GetVar("Cancel") == 1: for k, v in saved_audio_options.items(): GemRB.SetVar(k, v) AudioHelpText = None UpdateVolume(31210) TrySavingConfiguration() GemRB.UnhideGUI() return SubOptionsWindow = Window = GemRB.LoadWindow(5) GemRB.SetVar("FloatWindow", SubOptionsWindow.ID) # save values, so we can restore them on cancel for v in "Volume Ambients", "Volume SFX", "Volume Voices", "Volume Music", "Volume Movie", "Sound Processing", "Music Processing": saved_audio_options[v] = GemRB.GetVar(v) AudioHelpText = GUIOPTControls.OptHelpText('AudioOptions', Window, 9, 31210) GUIOPTControls.OptDone(OpenAudioOptionsWindow, Window, 7) GUIOPTControls.OptCancel(OpenAudioOptionsWindow, Window, 8) GUIOPTControls.OptSlider(31210, 31227, AudioHelpText, Window, 1, 10, 31460, "Volume Ambients", lambda: UpdateVolume(31227)) GUIOPTControls.OptSlider(31210, 31228, AudioHelpText, Window, 2, 11, 31466, "Volume SFX", lambda: UpdateVolume(31228)) GUIOPTControls.OptSlider(31210, 31226, AudioHelpText, Window, 3, 12, 31467, "Volume Voices", lambda: UpdateVolume(31226)) GUIOPTControls.OptSlider(31210, 31225, AudioHelpText, Window, 4, 13, 31468, "Volume Music", lambda: UpdateVolume(31225)) GUIOPTControls.OptSlider(31210, 31229, AudioHelpText, Window, 5, 14, 31469, "Volume Movie", lambda: UpdateVolume(31229)) GUIOPTControls.OptCheckbox(31210, 31224, AudioHelpText, Window, 6, 15, 30900, "Environmental Audio") GUIOPTControls.OptCheckbox(31210, 63244, AudioHelpText, Window, 16, 17, 63242, "Sound Processing") GUIOPTControls.OptCheckbox(31210, 63247, AudioHelpText, Window, 18, 19, 63243, "Music Processing") GemRB.UnhideGUI() Window.ShowModal(MODAL_SHADOW_GRAY)
def OpenGameplayOptionsWindow(): """Open gameplay options window""" global SubOptionsWindow, HelpTextArea Window = SubOptionsWindow CloseSubOptionsWindow() #gameplayoptions Window = GemRB.LoadWindow(8) HelpTextArea = GUIOPTControls.OptHelpText('GameplayOptions', Window, 40, 18042) GUIOPTControls.OptDone(CloseGameplayOptionsWindow, Window, 7) GUIOPTControls.OptCancel(CloseGameplayOptionsWindow, Window, 20) GUIOPTControls.OptSlider(18042, 18017, HelpTextArea, Window, 1, 21, 17143, 'Tooltips', DisplayHelpTooltipDelay, TOOLTIP_DELAY_FACTOR) GUIOPTControls.OptSlider(18042, 18018, HelpTextArea, Window, 2, 22, 17144, 'Mouse Scroll Speed', DisplayHelpMouseScrollingSpeed, 5) GUIOPTControls.OptSlider(18042, 18019, HelpTextArea, Window, 3, 23, 17145, 'Keyboard Scroll Speed', None, 5) GUIOPTControls.OptSlider(18042, 18020, HelpTextArea, Window, 12, 24, 13911, 'Difficulty Level', None, 0) GUIOPTControls.OptCheckbox(18042, 18021, HelpTextArea, Window, 14, 25, 13697, 'Always Dither') GUIOPTControls.OptCheckbox(18042, 18023, HelpTextArea, Window, 19, 27, 17182, 'Gore') GUIOPTControls.OptCheckbox(18042, 11797, HelpTextArea, Window, 42, 44, 11795, 'Infravision') GUIOPTControls.OptCheckbox(18042, 20619, HelpTextArea, Window, 47, 46, 20618, 'Weather') if GameCheck.IsBG2(): GUIOPTControls.OptCheckbox(18042, 2242, HelpTextArea, Window, 50, 48, 2241, 'Heal Party on Rest') elif GameCheck.IsIWD2(): GUIOPTControls.OptCheckbox(18042, 15136, HelpTextArea, Window, 50, 49, 17378, 'Maximum HP') GUIOPTControls.OptButton(OpenFeedbackOptionsWindow, Window, 5, 17163) GUIOPTControls.OptButton(OpenAutopauseOptionsWindow, Window, 6, 17166) if GameCheck.IsBG2(): GUIOPTControls.OptButton(OpenHotkeyOptionsWindow, Window, 51, 816) SubOptionsWindow = Window Window.ShowModal(MODAL_SHADOW_GRAY) return
def OpenGameplayOptionsWindow(): """Open gameplay options window""" global SubOptionsWindow, GameplayHelpText GemRB.HideGUI() if SubOptionsWindow: CloseSubOptionsWindow() TrySavingConfiguration() GemRB.UnhideGUI() return SubOptionsWindow = Window = GemRB.LoadWindow(6) GemRB.SetVar("FloatWindow", SubOptionsWindow.ID) GameplayHelpText = GUIOPTControls.OptHelpText('GameplayOptions', Window, 12, 31212) GUIOPTControls.OptDone(OpenGameplayOptionsWindow, Window, 10) GUIOPTControls.OptCancel(OpenGameplayOptionsWindow, Window, 11) GUIOPTControls.OptSlider(31212, 31232, GameplayHelpText, Window, 1, 13, 31481, "Tooltips", UpdateTooltips, TOOLTIP_DELAY_FACTOR) GUIOPTControls.OptSlider(31212, 31230, GameplayHelpText, Window, 2, 14, 31482, "Mouse Scroll Speed", UpdateMouseSpeed) GUIOPTControls.OptSlider(31212, 31231, GameplayHelpText, Window, 3, 15, 31480, "Keyboard Scroll Speed") GUIOPTControls.OptSlider(31212, 31233, GameplayHelpText, Window, 4, 16, 31479, "Difficulty Level") GUIOPTControls.OptCheckbox(31212, 31222, GameplayHelpText, Window, 5, 17, 31217, "Always Dither") GUIOPTControls.OptCheckbox(31212, 31223, GameplayHelpText, Window, 6, 18, 31218, "Gore") GUIOPTControls.OptCheckbox(31212, 62419, GameplayHelpText, Window, 22, 23, 62418, "Always Run") PSTOptButton(31212, 31213, GameplayHelpText, Window, 8, 20, 31478, OpenFeedbackOptionsWindow) PSTOptButton(31212, 31214, GameplayHelpText, Window, 9, 21, 31470, OpenAutopauseOptionsWindow) GemRB.UnhideGUI() Window.ShowModal(MODAL_SHADOW_GRAY) return
def OpenAutopauseOptionsWindow (): """Open autopause options window""" global SubSubOptionsWindow, HelpTextArea2 Window = SubSubOptionsWindow CloseSubSubOptionsWindow () Window = GemRB.LoadWindow (10) HelpTextArea2 = GUIOPTControls.OptHelpText ('AutopauseOptions', Window, 15, 18044) GUIOPTControls.OptDone (CloseAutopauseOptionsWindow, Window, 11) GUIOPTControls.OptCancel (CloseAutopauseOptionsWindow, Window, 14) # checkboxes OR the values if they associate to the same variable GUIOPTControls.OptCheckbox (18044, 18032, HelpTextArea2, Window, 1, 17, 17155, 'Auto Pause State', None, 4) # hit GUIOPTControls.OptCheckbox (18044, 18033, HelpTextArea2, Window, 2, 18, 17156, 'Auto Pause State', None, 8) # wounded GUIOPTControls.OptCheckbox (18044, 18034, HelpTextArea2, Window, 3, 19, 17157, 'Auto Pause State', None, 16) # dead GUIOPTControls.OptCheckbox (18044, 18035, HelpTextArea2, Window, 4, 20, 17158, 'Auto Pause State', None, 2) # attacked GUIOPTControls.OptCheckbox (18044, 18036, HelpTextArea2, Window, 5, 21, 17159, 'Auto Pause State', None, 1) # weapon unusable GUIOPTControls.OptCheckbox (18044, 18037, HelpTextArea2, Window, 13, 22, 17160, 'Auto Pause State', None, 32) # target gone GUIOPTControls.OptCheckbox (18044, 10640, HelpTextArea2, Window, 25, 24, 10639, 'Auto Pause State', None, 64) # end of round if GameCheck.IsIWD2(): GUIOPTControls.OptCheckbox (18044, 23514, HelpTextArea2, Window, 30, 31, 23516, 'Auto Pause State', None, 128) # enemy sighted GUIOPTControls.OptCheckbox (18044, 18560, HelpTextArea2, Window, 26, 28, 16519, 'Auto Pause State', None, 256) # trap found GUIOPTControls.OptCheckbox (18044, 26311, HelpTextArea2, Window, 36, 37, 26310, 'Auto Pause State', None, 512) # spell cast GUIOPTControls.OptCheckbox (18044, 24888, HelpTextArea2, Window, 33, 34, 10574, 'Auto Pause Center', None, 1) elif not GameCheck.IsIWD1() and Window.HasControl (26, IE_GUI_BUTTON): GUIOPTControls.OptCheckbox (18044, 23514, HelpTextArea2, Window, 26, 27, 23516, 'Auto Pause State', None, 128) # enemy sighted if GameCheck.IsBG2(): GUIOPTControls.OptCheckbox (18044, 58171, HelpTextArea2, Window, 31, 30, 31875, 'Auto Pause State', None, 512) # spell cast GUIOPTControls.OptCheckbox (18044, 31872, HelpTextArea2, Window, 34, 33, 57354, 'Auto Pause State', None, 256) # trap found GUIOPTControls.OptCheckbox (18044, 10571, HelpTextArea2, Window, 37, 36, 10574, 'Auto Pause Center', None, 1) SubSubOptionsWindow = Window Window.ShowModal (MODAL_SHADOW_GRAY) return
def OpenCharacterSoundsWindow(): """Open character sounds window""" global HelpTextArea2 #GemRB.GetView("SUB_WIN", 1).Close() Window = GemRB.LoadWindow(12, "GUIOPT") Window.AddAlias("SUB_WIN", 1) Window.SetFlags(WF_BORDERLESS, OP_OR) HelpTextArea2 = GUIOPTControls.OptHelpText('CharacterSounds', Window, 16, 18041) CloseCharacterSoundsWindow = lambda: Window.Close() GUIOPTControls.OptDone(CloseCharacterSoundsWindow, Window, 24) GUIOPTControls.OptCancel(CloseCharacterSoundsWindow, Window, 25) GUIOPTControls.OptCheckbox(18041, 18015, HelpTextArea2, Window, 5, 20, 17138, 'Subtitles') GUIOPTControls.OptCheckbox(18041, 18013, HelpTextArea2, Window, 6, 18, 17139, 'Attack Sounds') GUIOPTControls.OptCheckbox(18041, 18014, HelpTextArea2, Window, 7, 19, 17140, 'Footsteps') GUIOPTControls.OptRadio(DisplayHelpCommandSounds, Window, 8, 21, 'Command Sounds Frequency', 3) GUIOPTControls.OptRadio(DisplayHelpCommandSounds, Window, 9, 21, 'Command Sounds Frequency', 2) GUIOPTControls.OptRadio(DisplayHelpCommandSounds, Window, 10, 21, 'Command Sounds Frequency', 1) GUIOPTControls.OptRadio(DisplayHelpSelectionSounds, Window, 58, 57, 'Selection Sounds Frequency', 3) GUIOPTControls.OptRadio(DisplayHelpSelectionSounds, Window, 59, 57, 'Selection Sounds Frequency', 2) GUIOPTControls.OptRadio(DisplayHelpSelectionSounds, Window, 60, 57, 'Selection Sounds Frequency', 1) Window.ShowModal(MODAL_SHADOW_GRAY)