From a4aaa85f3c175994607e43f3026eb1117e511f77 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 3 Mar 2012 22:45:49 +0100 Subject: [PATCH] Fixed button flash rate sliders - now a global override for all flashing buttons as flash rate is a per button setting now (FIRE-5209) --- indra/llui/llbutton.cpp | 22 +++++++++++-- indra/newview/app_settings/settings.xml | 33 +++++++++++++++++++ .../default/xui/de/panel_preferences_UI.xml | 6 ++-- .../default/xui/en/panel_preferences_UI.xml | 16 ++++----- 4 files changed, 63 insertions(+), 14 deletions(-) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index bc9d5cfd65..da78e42c1a 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -636,10 +636,28 @@ void LLButton::draw() { if ( sEnableButtonFlashing) { + // Global flash rate override + //F32 elapsed = mFlashingTimer.getElapsedTimeF32(); + //S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f); + //// flash on or off? + //flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f); + + S32 buttonFlashCount = mButtonFlashCount; + F32 buttonFlashRate = mButtonFlashRate; + static LLCachedControl fsGlobalButtonFlashOverride(*LLUI::sSettingGroups["config"], "FSGlobalButtonFlashOverride", true); + static LLCachedControl fsButtonFlashCount(*LLUI::sSettingGroups["config"], "FSButtonFlashCount", true); + static LLCachedControl fsButtonFlashRate(*LLUI::sSettingGroups["config"], "FSButtonFlashRate", true); + if (fsGlobalButtonFlashOverride) + { + buttonFlashCount = (S32)fsButtonFlashCount; + buttonFlashRate = (F32)fsButtonFlashRate; + } + F32 elapsed = mFlashingTimer.getElapsedTimeF32(); - S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f); + S32 flash_count = S32(elapsed * buttonFlashRate * 2.f); // flash on or off? - flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f); + flash = (flash_count % 2 == 0) || flash_count > S32((F32)buttonFlashCount * 2.f); + // Global flash rate override } else { // otherwise just highlight button in flash color diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 404aa5ef94..60288db0b9 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -17012,6 +17012,39 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSButtonFlashCount + + Comment + Number of flashes after which flashing buttons stay lit up + Persist + 1 + Type + S32 + Value + 8 + + FSButtonFlashRate + + Comment + Frequency at which buttons flash (hz) + Persist + 1 + Type + F32 + Value + 1.25 + + FSGlobalButtonFlashOverride + + Comment + If enabled, button flash rate and count will be overridden globally. + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/skins/default/xui/de/panel_preferences_UI.xml b/indra/newview/skins/default/xui/de/panel_preferences_UI.xml index 19996dbf7a..8ac5f4b05a 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_UI.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_UI.xml @@ -45,10 +45,8 @@ - - Blinkende Buttons: - - + + Hz diff --git a/indra/newview/skins/default/xui/en/panel_preferences_UI.xml b/indra/newview/skins/default/xui/en/panel_preferences_UI.xml index 5b918ece02..5fedaed201 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_UI.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_UI.xml @@ -249,7 +249,8 @@ width="270" tool_tip="Show lag meter in the Status Overlay"/> - - Flashing Buttons: - + width="128" + label="Global Flashing Buttons Override:"/>