From: Jaka K. <lyn...@us...> - 2012-09-27 21:23:32
|
gemrb: Infinity Engine emulator The branch master has been updated via 053718f8bb42a4070fb0d75eae46ce75df4a1f0e (commit) via 66215c32502fc430fd3dac3e0daeaf5269027dfa (commit) via 00a6b4204a97fe4d904c637e0406a5da72754ba3 (commit) Summary of changes: gemrb/GUIScripts/pst/GUIOPT.py | 248 ++++++++++------------------------------ 1 files changed, 58 insertions(+), 190 deletions(-) from 403c7f92bdefe262defabbe93bc87bfb70806a1b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=053718f8bb42a4070fb0d75eae46ce75df4a1f0e commit 053718f8bb42a4070fb0d75eae46ce75df4a1f0e Author: Jaka Kranjc <lyn...@us...> Date: Thu Sep 27 23:17:20 2012 +0200 pst: use lambdas for guiopt checkboxes too diff --git a/gemrb/GUIScripts/pst/GUIOPT.py b/gemrb/GUIScripts/pst/GUIOPT.py index a365c4a..f1732fc 100644 --- a/gemrb/GUIScripts/pst/GUIOPT.py +++ b/gemrb/GUIScripts/pst/GUIOPT.py @@ -147,9 +147,9 @@ def OpenVideoOptionsWindow (): PSTOptSlider (31052, 31431, VideoHelpText, Window, 1, 10, 31234, "Brightness Correction", GammaFeedback, 1) PSTOptSlider (31052, 31459, VideoHelpText, Window, 2, 11, 31429, "Gamma Correction", GammaFeedback, 1) - PSTOptCheckbox ('VideoOptions', 'SoftwareBlitting', Window, 6, 15, 30898, None) #TODO: SoftBlt - PSTOptCheckbox ('VideoOptions', 'SoftwareMirroring', Window, 4, 13, 30896, None) #TODO: SoftMirrorBlt - PSTOptCheckbox ('VideoOptions', 'SoftwareTransparency', Window, 5, 14, 30897, None) #TODO: SoftSrcKeyBlt + PSTOptCheckbox (31052, 31221, VideoHelpText, Window, 6, 15, 30898, "SoftBlt") + PSTOptCheckbox (31052, 31216, VideoHelpText, Window, 4, 13, 30896, "SoftMirrorBlt") + PSTOptCheckbox (31052, 31220, VideoHelpText, Window, 5, 14, 30897, "SoftSrcKeyBlt") GemRB.UnhideGUI () Window.ShowModal (MODAL_SHADOW_GRAY) @@ -159,20 +159,6 @@ def GammaFeedback (): GemRB.SetGamma (GemRB.GetVar("Brightness Correction")/5,GemRB.GetVar("Gamma Correction")/20) return -def DisplayHelpVideoOptions (): - VideoHelpText.SetText (31052) - -def DisplayHelpSoftwareBlitting (): - VideoHelpText.SetText (31221) - -def DisplayHelpSoftwareMirroring (): - VideoHelpText.SetText (31216) - -def DisplayHelpSoftwareTransparency (): - VideoHelpText.SetText (31220) - - - ################################################### saved_audio_options = {} @@ -215,9 +201,9 @@ def OpenAudioOptionsWindow (): PSTOptSlider (31210, 31225, AudioHelpText, Window, 4, 13, 31468, "Volume Music", UpdateVolume) PSTOptSlider (31210, 31229, AudioHelpText, Window, 5, 14, 31469, "Volume Movie", UpdateVolume) - PSTOptCheckbox ('AudioOptions', 'CreativeEAX', Window, 6, 15, 30900, "Environmental Audio") - PSTOptCheckbox ('AudioOptions', 'SoundProcessing', Window, 16, 17, 63242, "Sound Processing") - PSTOptCheckbox ('AudioOptions', 'MusicProcessing', Window, 18, 19, 63243, "Music Processing") + PSTOptCheckbox (31210, 31224, AudioHelpText, Window, 6, 15, 30900, "Environmental Audio") + PSTOptCheckbox (31210, 63244, AudioHelpText, Window, 16, 17, 63242, "Sound Processing") + PSTOptCheckbox (31210, 63247, AudioHelpText, Window, 18, 19, 63243, "Music Processing") GemRB.UnhideGUI () Window.ShowModal (MODAL_SHADOW_GRAY) @@ -225,20 +211,6 @@ def OpenAudioOptionsWindow (): def UpdateVolume (): GemRB.UpdateAmbientsVolume () GemRB.UpdateMusicVolume () - -def DisplayHelpAudioOptions (): - AudioHelpText.SetText (31210) - -def DisplayHelpCreativeEAX (): - AudioHelpText.SetText (31224) - -def DisplayHelpSoundProcessing (): - AudioHelpText.SetText (63244) - -def DisplayHelpMusicProcessing (): - AudioHelpText.SetText (63247) - - ################################################### @@ -267,9 +239,9 @@ def OpenGameplayOptionsWindow (): PSTOptSlider (31212, 31231, GameplayHelpText, Window, 3, 15, 31480, "Keyboard Scroll Speed", UpdateKeyboardSpeed) PSTOptSlider (31212, 31233, GameplayHelpText, Window, 4, 16, 31479, "Difficulty Level") - PSTOptCheckbox ('GameplayOptions', 'DitherAlways', Window, 5, 17, 31217, "Always Dither") - PSTOptCheckbox ('GameplayOptions', 'Gore', Window, 6, 18, 31218, "Gore???") - PSTOptCheckbox ('GameplayOptions', 'AlwaysRun', Window, 22, 23, 62418, "Always Run") + PSTOptCheckbox (31212, 31222, GameplayHelpText, Window, 5, 17, 31217, "Always Dither") + PSTOptCheckbox (31212, 31223, GameplayHelpText, Window, 6, 18, 31218, "Gore") + PSTOptCheckbox (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) @@ -278,9 +250,6 @@ def OpenGameplayOptionsWindow (): Window.ShowModal (MODAL_SHADOW_GRAY) return -def DisplayHelpGameplayOptions (): - GameplayHelpText.SetText (31212) - def UpdateTooltips (): GemRB.SetTooltipDelay (GemRB.GetVar ("Tooltips") ) @@ -291,15 +260,6 @@ def UpdateKeyboardSpeed (): #GemRB.SetKeyboardScrollSpeed (GemRB.GetVar ("Keyboard Scroll Speed") ) return -def DisplayHelpDitherAlways (): - GameplayHelpText.SetText (31222) - -def DisplayHelpGore (): - GameplayHelpText.SetText (31223) - -def DisplayHelpAlwaysRun (): - GameplayHelpText.SetText (62419) - ################################################### def OpenFeedbackOptionsWindow (): @@ -328,12 +288,12 @@ def OpenFeedbackOptionsWindow (): PSTOptSlider (31213, 54878, FeedbackHelpText, Window, 20, 21, 54879, "Selection Sounds Frequency") PSTOptSlider (31213, 54880, FeedbackHelpText, Window, 22, 23, 55012, "Command Sounds Frequency") - PSTOptCheckbox ('FeedbackOptions', 'CharacterStates', Window, 6, 15, 37594, "") - PSTOptCheckbox ('FeedbackOptions', 'MiscellaneousMessages', Window, 17, 19, 37596, "") - PSTOptCheckbox ('FeedbackOptions', 'ToHitRolls', Window, 3, 12, 37588, "") - PSTOptCheckbox ('FeedbackOptions', 'CombatInfo', Window, 4, 13, 37590, "") - PSTOptCheckbox ('FeedbackOptions', 'SpellCasting', Window, 5, 14, 37592, "") - + # TODO: once the pst overhead messaging system is in place, add the relevant game vars below + PSTOptCheckbox (31213, 37460, FeedbackHelpText, Window, 6, 15, 37594, "") + PSTOptCheckbox (31213, 37462, FeedbackHelpText, Window, 17, 19, 37596, "") + PSTOptCheckbox (31213, 37453, FeedbackHelpText, Window, 3, 12, 37588, "") + PSTOptCheckbox (31213, 37457, FeedbackHelpText, Window, 4, 13, 37590, "") + PSTOptCheckbox (31213, 37458, FeedbackHelpText, Window, 5, 14, 37592, "") GemRB.UnhideGUI () Window.ShowModal (MODAL_SHADOW_GRAY) @@ -341,25 +301,6 @@ def OpenFeedbackOptionsWindow (): def UpdateMarkerFeedback (): GemRB.SetVar ("GUI Feedback Level", GemRB.GetVar ("Circle Feedback") + 1) -def DisplayHelpFeedbackOptions (): - GameplayHelpText.SetText (31213) - -def DisplayHelpCharacterStates (): - FeedbackHelpText.SetText (37460) - -def DisplayHelpMiscellaneousMessages (): - FeedbackHelpText.SetText (37462) - -def DisplayHelpToHitRolls (): - FeedbackHelpText.SetText (37453) - -def DisplayHelpCombatInfo (): - FeedbackHelpText.SetText (37457) - -def DisplayHelpSpellCasting (): - FeedbackHelpText.SetText (37458) - - ################################################### def OpenAutopauseOptionsWindow (): @@ -395,19 +336,17 @@ def OpenAutopauseOptionsWindow (): GemRB.SetVar("AutoPauseState_EndRound", (state & 0x40) != 0 ) - PSTOptCheckbox ('AutopauseOptions', 'CharacterHit', Window, 2, 9, 37598, "AutoPauseState_Hit", OnAutoPauseClicked) - PSTOptCheckbox ('AutopauseOptions', 'CharacterInjured', Window, 3, 10, 37681, "AutoPauseState_Wounded", OnAutoPauseClicked) - PSTOptCheckbox ('AutopauseOptions', 'CharacterDead', Window, 4, 11, 37682, "AutoPauseState_Dead", OnAutoPauseClicked) - PSTOptCheckbox ('AutopauseOptions', 'CharacterAttacked', Window, 5, 12, 37683, "AutoPauseState_Attacked", OnAutoPauseClicked) - PSTOptCheckbox ('AutopauseOptions', 'WeaponUnusable', Window, 6, 13, 37684, "AutoPauseState_Unusable", OnAutoPauseClicked) - PSTOptCheckbox ('AutopauseOptions', 'TargetGone', Window, 7, 14, 37685, "AutoPauseState_NoTarget", OnAutoPauseClicked) - PSTOptCheckbox ('AutopauseOptions', 'EndOfRound', Window, 8, 15, 37686, "AutoPauseState_EndRound", OnAutoPauseClicked) + PSTOptCheckbox (31214, 37688, AutopauseHelpText, Window, 2, 9, 37598, "AutoPauseState_Hit", OnAutoPauseClicked) + PSTOptCheckbox (31214, 37689, AutopauseHelpText, Window, 3, 10, 37681, "AutoPauseState_Wounded", OnAutoPauseClicked) + PSTOptCheckbox (31214, 37690, AutopauseHelpText, Window, 4, 11, 37682, "AutoPauseState_Dead", OnAutoPauseClicked) + PSTOptCheckbox (31214, 37691, AutopauseHelpText, Window, 5, 12, 37683, "AutoPauseState_Attacked", OnAutoPauseClicked) + PSTOptCheckbox (31214, 37692, AutopauseHelpText, Window, 6, 13, 37684, "AutoPauseState_Unusable", OnAutoPauseClicked) + PSTOptCheckbox (31214, 37693, AutopauseHelpText, Window, 7, 14, 37685, "AutoPauseState_NoTarget", OnAutoPauseClicked) + PSTOptCheckbox (31214, 37694, AutopauseHelpText, Window, 8, 15, 37686, "AutoPauseState_EndRound", OnAutoPauseClicked) GemRB.UnhideGUI () Window.ShowModal (MODAL_SHADOW_GRAY) - - def OnAutoPauseClicked (): state = (0x01 * GemRB.GetVar("AutoPauseState_Unusable") + 0x02 * GemRB.GetVar("AutoPauseState_Attacked") + @@ -418,28 +357,6 @@ def OnAutoPauseClicked (): 0x40 * GemRB.GetVar("AutoPauseState_EndRound")) GemRB.SetVar("Auto Pause State", state) - -def DisplayHelpCharacterHit (): - AutopauseHelpText.SetText (37688) - -def DisplayHelpCharacterInjured (): - AutopauseHelpText.SetText (37689) - -def DisplayHelpCharacterDead (): - AutopauseHelpText.SetText (37690) - -def DisplayHelpCharacterAttacked (): - AutopauseHelpText.SetText (37691) - -def DisplayHelpWeaponUnusable (): - AutopauseHelpText.SetText (37692) - -def DisplayHelpTargetGone (): - AutopauseHelpText.SetText (37693) - -def DisplayHelpEndOfRound (): - AutopauseHelpText.SetText (37694) - ################################################### ################################################### @@ -774,12 +691,12 @@ def PSTOptSlider (winname, ctlname, help_ta, window, slider_id, label_id, label_ return slider -def PSTOptCheckbox (winname, ctlname, window, button_id, label_id, label_strref, assoc_var = None, handler = None): +def PSTOptCheckbox (winname, ctlname, help_ta, window, button_id, label_id, label_strref, assoc_var = None, handler = None): """Standard checkbox for option windows""" - action = eval("DisplayHelp" + ctlname) - button = GUIOPTControls.OptCheckbox(action, window, button_id, label_id, assoc_var, 1) - button.SetEvent (IE_GUI_MOUSE_LEAVE_BUTTON, eval("DisplayHelp" + winname)) + button = GUIOPTControls.OptCheckboxNoCallback (ctlname, help_ta, window, button_id, label_id, assoc_var) + # this is commented out since it causes glitches with toggling the button + #button.SetEvent (IE_GUI_MOUSE_LEAVE_BUTTON, lambda: help_ta.SetText (winname)) if assoc_var: if GemRB.GetVar (assoc_var): button.SetState (IE_GUI_BUTTON_PRESSED) @@ -788,13 +705,14 @@ def PSTOptCheckbox (winname, ctlname, window, button_id, label_id, label_strref, else: button.SetState (IE_GUI_BUTTON_UNPRESSED) + # FIXME: this overrides the strref setter from GUIOPTControls if handler: button.SetEvent (IE_GUI_BUTTON_ON_PRESS, handler) label = window.GetControl (label_id) label.SetText (label_strref) - label.SetEvent (IE_GUI_MOUSE_ENTER_BUTTON, action) - label.SetEvent (IE_GUI_MOUSE_LEAVE_BUTTON, eval("DisplayHelp" + winname)) + label.SetEvent (IE_GUI_MOUSE_ENTER_BUTTON, lambda: help_ta.SetText (ctlname)) + label.SetEvent (IE_GUI_MOUSE_LEAVE_BUTTON, lambda: help_ta.SetText (winname)) return button http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=66215c32502fc430fd3dac3e0daeaf5269027dfa commit 66215c32502fc430fd3dac3e0daeaf5269027dfa Author: Jaka Kranjc <lyn...@us...> Date: Thu Sep 27 22:29:25 2012 +0200 pst: use lambdas for guiopt buttons too diff --git a/gemrb/GUIScripts/pst/GUIOPT.py b/gemrb/GUIScripts/pst/GUIOPT.py index a6c90c0..a365c4a 100644 --- a/gemrb/GUIScripts/pst/GUIOPT.py +++ b/gemrb/GUIScripts/pst/GUIOPT.py @@ -271,8 +271,8 @@ def OpenGameplayOptionsWindow (): PSTOptCheckbox ('GameplayOptions', 'Gore', Window, 6, 18, 31218, "Gore???") PSTOptCheckbox ('GameplayOptions', 'AlwaysRun', Window, 22, 23, 62418, "Always Run") - PSTOptButton ('GameplayOptions', 'FeedbackOptions', Window, 8, 20, 31478) - PSTOptButton ('GameplayOptions', 'AutopauseOptions', Window, 9, 21, 31470) + 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) @@ -300,12 +300,6 @@ def DisplayHelpGore (): def DisplayHelpAlwaysRun (): GameplayHelpText.SetText (62419) -def DisplayHelpFeedbackOptions (): - GameplayHelpText.SetText (31213) - -def DisplayHelpAutopauseOptions (): - GameplayHelpText.SetText (31214) - ################################################### def OpenFeedbackOptionsWindow (): @@ -804,19 +798,19 @@ def PSTOptCheckbox (winname, ctlname, window, button_id, label_id, label_strref, return button -def PSTOptButton (winname, ctlname, window, button_id, label_id, label_strref): +def PSTOptButton (winname, ctlname, help_ta, window, button_id, label_id, label_strref, action): """Standard subwindow button for option windows""" button = window.GetControl (button_id) - button.SetEvent (IE_GUI_BUTTON_ON_PRESS, eval("Open%sWindow" %ctlname)) - button.SetEvent (IE_GUI_MOUSE_ENTER_BUTTON, eval("DisplayHelp" + ctlname)) - button.SetEvent (IE_GUI_MOUSE_LEAVE_BUTTON, eval("DisplayHelp" + winname)) + button.SetEvent (IE_GUI_BUTTON_ON_PRESS, action) + button.SetEvent (IE_GUI_MOUSE_ENTER_BUTTON, lambda: help_ta.SetText (ctlname)) + button.SetEvent (IE_GUI_MOUSE_LEAVE_BUTTON, lambda: help_ta.SetText (winname)) label = window.GetControl (label_id) label.SetText (label_strref) label.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_SET) label.SetState (IE_GUI_BUTTON_LOCKED) - label.SetEvent (IE_GUI_MOUSE_ENTER_BUTTON, eval("DisplayHelp" + ctlname)) - label.SetEvent (IE_GUI_MOUSE_LEAVE_BUTTON, eval("DisplayHelp" + winname)) + label.SetEvent (IE_GUI_MOUSE_ENTER_BUTTON, lambda: help_ta.SetText (ctlname)) + label.SetEvent (IE_GUI_MOUSE_LEAVE_BUTTON, lambda: help_ta.SetText (winname)) ################################################### # End of file GUIOPT.py http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=00a6b4204a97fe4d904c637e0406a5da72754ba3 commit 00a6b4204a97fe4d904c637e0406a5da72754ba3 Author: Jaka Kranjc <lyn...@us...> Date: Thu Sep 27 22:07:33 2012 +0200 pst: use lambdas for the slider callbacks diff --git a/gemrb/GUIScripts/pst/GUIOPT.py b/gemrb/GUIScripts/pst/GUIOPT.py index 809e307..a6c90c0 100644 --- a/gemrb/GUIScripts/pst/GUIOPT.py +++ b/gemrb/GUIScripts/pst/GUIOPT.py @@ -144,8 +144,8 @@ def OpenVideoOptionsWindow (): GUIOPTControls.OptDone (OpenVideoOptionsWindow, Window, 7) GUIOPTControls.OptCancel (OpenVideoOptionsWindow, Window, 8) - PSTOptSlider ('VideoOptions', 'Brightness', Window, 1, 10, 31234, "Brightness Correction", GammaFeedback, 1) - PSTOptSlider ('VideoOptions', 'Contrast', Window, 2, 11, 31429, "Gamma Correction", GammaFeedback, 1) + PSTOptSlider (31052, 31431, VideoHelpText, Window, 1, 10, 31234, "Brightness Correction", GammaFeedback, 1) + PSTOptSlider (31052, 31459, VideoHelpText, Window, 2, 11, 31429, "Gamma Correction", GammaFeedback, 1) PSTOptCheckbox ('VideoOptions', 'SoftwareBlitting', Window, 6, 15, 30898, None) #TODO: SoftBlt PSTOptCheckbox ('VideoOptions', 'SoftwareMirroring', Window, 4, 13, 30896, None) #TODO: SoftMirrorBlt @@ -162,12 +162,6 @@ def GammaFeedback (): def DisplayHelpVideoOptions (): VideoHelpText.SetText (31052) -def DisplayHelpBrightness (): - VideoHelpText.SetText (31431) - -def DisplayHelpContrast (): - VideoHelpText.SetText (31459) - def DisplayHelpSoftwareBlitting (): VideoHelpText.SetText (31221) @@ -215,11 +209,11 @@ def OpenAudioOptionsWindow (): GUIOPTControls.OptDone (OpenAudioOptionsWindow, Window, 7) GUIOPTControls.OptCancel (OpenAudioOptionsWindow, Window, 8) - PSTOptSlider ('AudioOptions', 'AmbientVolume', Window, 1, 10, 31460, "Volume Ambients", UpdateVolume) - PSTOptSlider ('AudioOptions', 'SoundFXVolume', Window, 2, 11, 31466, "Volume SFX", UpdateVolume) - PSTOptSlider ('AudioOptions', 'VoiceVolume', Window, 3, 12, 31467, "Volume Voices", UpdateVolume) - PSTOptSlider ('AudioOptions', 'MusicVolume', Window, 4, 13, 31468, "Volume Music", UpdateVolume) - PSTOptSlider ('AudioOptions', 'MovieVolume', Window, 5, 14, 31469, "Volume Movie", UpdateVolume) + PSTOptSlider (31210, 31227, AudioHelpText, Window, 1, 10, 31460, "Volume Ambients", UpdateVolume) + PSTOptSlider (31210, 31228, AudioHelpText, Window, 2, 11, 31466, "Volume SFX", UpdateVolume) + PSTOptSlider (31210, 31226, AudioHelpText, Window, 3, 12, 31467, "Volume Voices", UpdateVolume) + PSTOptSlider (31210, 31225, AudioHelpText, Window, 4, 13, 31468, "Volume Music", UpdateVolume) + PSTOptSlider (31210, 31229, AudioHelpText, Window, 5, 14, 31469, "Volume Movie", UpdateVolume) PSTOptCheckbox ('AudioOptions', 'CreativeEAX', Window, 6, 15, 30900, "Environmental Audio") PSTOptCheckbox ('AudioOptions', 'SoundProcessing', Window, 16, 17, 63242, "Sound Processing") @@ -235,21 +229,6 @@ def UpdateVolume (): def DisplayHelpAudioOptions (): AudioHelpText.SetText (31210) -def DisplayHelpAmbientVolume (): - AudioHelpText.SetText (31227) - -def DisplayHelpSoundFXVolume (): - AudioHelpText.SetText (31228) - -def DisplayHelpVoiceVolume (): - AudioHelpText.SetText (31226) - -def DisplayHelpMusicVolume (): - AudioHelpText.SetText (31225) - -def DisplayHelpMovieVolume (): - AudioHelpText.SetText (31229) - def DisplayHelpCreativeEAX (): AudioHelpText.SetText (31224) @@ -283,10 +262,10 @@ def OpenGameplayOptionsWindow (): GUIOPTControls.OptDone (OpenGameplayOptionsWindow, Window, 10) GUIOPTControls.OptCancel (OpenGameplayOptionsWindow, Window, 11) - PSTOptSlider ('GameplayOptions', 'TooltipDelay', Window, 1, 13, 31481, "Tooltips", UpdateTooltips, TOOLTIP_DELAY_FACTOR) - PSTOptSlider ('GameplayOptions', 'MouseScrollingSpeed', Window, 2, 14, 31482, "Mouse Scroll Speed", UpdateMouseSpeed) - PSTOptSlider ('GameplayOptions', 'KeyboardScrollingSpeed', Window, 3, 15, 31480, "Keyboard Scroll Speed", UpdateKeyboardSpeed) - PSTOptSlider ('GameplayOptions', 'Difficulty', Window, 4, 16, 31479, "Difficulty Level") + PSTOptSlider (31212, 31232, GameplayHelpText, Window, 1, 13, 31481, "Tooltips", UpdateTooltips, TOOLTIP_DELAY_FACTOR) + PSTOptSlider (31212, 31230, GameplayHelpText, Window, 2, 14, 31482, "Mouse Scroll Speed", UpdateMouseSpeed) + PSTOptSlider (31212, 31231, GameplayHelpText, Window, 3, 15, 31480, "Keyboard Scroll Speed", UpdateKeyboardSpeed) + PSTOptSlider (31212, 31233, GameplayHelpText, Window, 4, 16, 31479, "Difficulty Level") PSTOptCheckbox ('GameplayOptions', 'DitherAlways', Window, 5, 17, 31217, "Always Dither") PSTOptCheckbox ('GameplayOptions', 'Gore', Window, 6, 18, 31218, "Gore???") @@ -305,25 +284,13 @@ def DisplayHelpGameplayOptions (): def UpdateTooltips (): GemRB.SetTooltipDelay (GemRB.GetVar ("Tooltips") ) -def DisplayHelpTooltipDelay (): - GameplayHelpText.SetText (31232) - def UpdateMouseSpeed (): GemRB.SetMouseScrollSpeed (GemRB.GetVar ("Mouse Scroll Speed") ) -def DisplayHelpMouseScrollingSpeed (): - GameplayHelpText.SetText (31230) - def UpdateKeyboardSpeed (): #GemRB.SetKeyboardScrollSpeed (GemRB.GetVar ("Keyboard Scroll Speed") ) return -def DisplayHelpKeyboardScrollingSpeed (): - GameplayHelpText.SetText (31231) - -def DisplayHelpDifficulty (): - GameplayHelpText.SetText (31233) - def DisplayHelpDitherAlways (): GameplayHelpText.SetText (31222) @@ -339,8 +306,6 @@ def DisplayHelpFeedbackOptions (): def DisplayHelpAutopauseOptions (): GameplayHelpText.SetText (31214) - - ################################################### def OpenFeedbackOptionsWindow (): @@ -364,10 +329,10 @@ def OpenFeedbackOptionsWindow (): GUIOPTControls.OptDone (OpenFeedbackOptionsWindow, Window, 7) GUIOPTControls.OptCancel (OpenFeedbackOptionsWindow, Window, 8) - PSTOptSlider ('FeedbackOptions', 'MarkerFeedback', Window, 1, 10, 37463, "Circle Feedback", UpdateMarkerFeedback) - PSTOptSlider ('FeedbackOptions', 'LocatorFeedback', Window, 2, 11, 37586, "Locator Feedback Level") - PSTOptSlider ('FeedbackOptions', 'SelectionFeedbackLevel', Window, 20, 21, 54879, "Selection Sounds Frequency") - PSTOptSlider ('FeedbackOptions', 'CommandFeedbackLevel', Window, 22, 23, 55012, "Command Sounds Frequency") + PSTOptSlider (31213, 37411, FeedbackHelpText, Window, 1, 10, 37463, "Circle Feedback", UpdateMarkerFeedback) + PSTOptSlider (31213, 37447, FeedbackHelpText, Window, 2, 11, 37586, "Locator Feedback Level") + PSTOptSlider (31213, 54878, FeedbackHelpText, Window, 20, 21, 54879, "Selection Sounds Frequency") + PSTOptSlider (31213, 54880, FeedbackHelpText, Window, 22, 23, 55012, "Command Sounds Frequency") PSTOptCheckbox ('FeedbackOptions', 'CharacterStates', Window, 6, 15, 37594, "") PSTOptCheckbox ('FeedbackOptions', 'MiscellaneousMessages', Window, 17, 19, 37596, "") @@ -382,17 +347,8 @@ def OpenFeedbackOptionsWindow (): def UpdateMarkerFeedback (): GemRB.SetVar ("GUI Feedback Level", GemRB.GetVar ("Circle Feedback") + 1) -def DisplayHelpMarkerFeedback (): - FeedbackHelpText.SetText (37411) - -def DisplayHelpLocatorFeedback (): - FeedbackHelpText.SetText (37447) - -def DisplayHelpSelectionFeedbackLevel (): - FeedbackHelpText.SetText (54878) - -def DisplayHelpCommandFeedbackLevel (): - FeedbackHelpText.SetText (54880) +def DisplayHelpFeedbackOptions (): + GameplayHelpText.SetText (31213) def DisplayHelpCharacterStates (): FeedbackHelpText.SetText (37460) @@ -808,19 +764,19 @@ def CloseSubSubOptionsWindow (): # These controls are usually made from an active # control (button, slider ...) and a label -def PSTOptSlider (winname, ctlname, window, slider_id, label_id, label_strref, variable, action = None, value = 1): +def PSTOptSlider (winname, ctlname, help_ta, window, slider_id, label_id, label_strref, variable, action = None, value = 1): """Standard slider for option windows""" slider = GUIOPTControls.OptSlider (action, window, slider_id, variable, value) - #slider.SetEvent (IE_GUI_MOUSE_ENTER_BUTTON, eval("DisplayHelp" + ctlname)) - #slider.SetEvent (IE_GUI_MOUSE_LEAVE_BUTTON, eval("DisplayHelp" + winname)) + #slider.SetEvent (IE_GUI_MOUSE_ENTER_BUTTON, lambda: help_ta.SetText (ctlname)) + #slider.SetEvent (IE_GUI_MOUSE_LEAVE_BUTTON, lambda: help_ta.SetText (winname)) label = window.GetControl (label_id) label.SetText (label_strref) label.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_SET) label.SetState (IE_GUI_BUTTON_LOCKED) - #label.SetEvent (IE_GUI_MOUSE_OVER_BUTTON, eval("DisplayHelp" + ctlname)) - label.SetEvent (IE_GUI_MOUSE_ENTER_BUTTON, eval("DisplayHelp" + ctlname)) - label.SetEvent (IE_GUI_MOUSE_LEAVE_BUTTON, eval("DisplayHelp" + winname)) + #label.SetEvent (IE_GUI_MOUSE_OVER_BUTTON, lambda: help_ta.SetText (ctlname)) + label.SetEvent (IE_GUI_MOUSE_ENTER_BUTTON, lambda: help_ta.SetText (ctlname)) + label.SetEvent (IE_GUI_MOUSE_LEAVE_BUTTON, lambda: help_ta.SetText (winname)) return slider ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |