Fixed button flash rate sliders - now a global override for all flashing buttons as flash rate is a per button setting now (FIRE-5209)

Ansariel 2012-03-03 22:45:49 +01:00
parent 91975b793b
commit a4aaa85f3c
4 changed files with 63 additions and 14 deletions

View File

@ -636,10 +636,28 @@ void LLButton::draw()
{
if ( sEnableButtonFlashing)
{
// <FS:Ansariel> 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<bool> fsGlobalButtonFlashOverride(*LLUI::sSettingGroups["config"], "FSGlobalButtonFlashOverride", true);
static LLCachedControl<S32> fsButtonFlashCount(*LLUI::sSettingGroups["config"], "FSButtonFlashCount", true);
static LLCachedControl<F32> 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);
// </FS:Ansariel> Global flash rate override
}
else
{ // otherwise just highlight button in flash color

View File

@ -17012,6 +17012,39 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>0</integer>
</map>
<key>FSButtonFlashCount</key>
<map>
<key>Comment</key>
<string>Number of flashes after which flashing buttons stay lit up</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>8</integer>
</map>
<key>FSButtonFlashRate</key>
<map>
<key>Comment</key>
<string>Frequency at which buttons flash (hz)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>1.25</real>
</map>
<key>FSGlobalButtonFlashOverride</key>
<map>
<key>Comment</key>
<string>If enabled, button flash rate and count will be overridden globally.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
</llsd>

View File

@ -45,10 +45,8 @@
<check_box label="Pie-Menü aktivieren" name="UsePieMenu" tool_tip="Aktiviert das klassische V1.x-Kontextmenü in Kuchenform anstelle des standardmäßigen Kontextmenüs."/>
<check_box name="ShowNetStats" label="Laganzeige aktivieren" tool_tip="Aktiviert die Laganzeige in der Statuszeile"/>
<text name="ButtonFlashing">
Blinkende Buttons:
</text>
<slider label="Wiederholungen blinkende IM-Button:" tool_tip="Anzahl wie oft ein Button für IM-Benachrichtungen blinkt" name="ButtonsFlashCount"/>
<checkbox name="ButtonFlashing" label="Blinkrate für Buttons global übersteuern:"/>
<slider label="Wiederholungen blinkende Button:" tool_tip="Anzahl wie oft ein Button für Benachrichtungen blinkt" name="ButtonsFlashCount"/>
<slider label="Blinkrate:" tool_tip="Blinkrate in Hz, mit der Buttons blinken" name="ButtonFlashRate"/>
<text name="ButtonFlashRateText">
Hz

View File

@ -249,7 +249,8 @@
width="270"
tool_tip="Show lag meter in the Status Overlay"/>
<text
<check_box
control_name="FSGlobalButtonFlashOverride"
type="string"
left="5"
top_pad="10"
@ -258,17 +259,16 @@
height="12"
layout="topleft"
name="ButtonFlashing"
width="128">
Flashing Buttons:
</text>
width="128"
label="Global Flashing Buttons Override:"/>
<slider
control_name="ButtonFlashCount"
control_name="FSButtonFlashCount"
decimal_digits="0"
follows="left|top"
height="16"
increment="1"
label="Number of times IM buttons flash:"
tool_tip="Number of times buttons flash (used for IM notifications)"
label="Number of times buttons flash:"
tool_tip="Number of times buttons flash"
label_width="300"
layout="topleft"
left="15"
@ -278,7 +278,7 @@
top_pad="5"
width="471" />
<slider
control_name="ButtonFlashRate"
control_name="FSButtonFlashRate"
decimal_digits="0"
follows="left|top"
height="16"