mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Advanced Fatigue - Solid stamina bar option (#6911)
* Translation Entries (EN+DE) * Add setting * Obey setting in handler * Add setting to movedToSQF list * Replace elegant else-if with clunky SQF * Revert adding solidStaminaBar to movedToSqf list * Remove unnecessary fade applications * Invert solid/fade setting for better translation * Change translations to "fade" * Invert fade/solid logic * Dont unfade when disabled overall * Dont unfade with AF disabled; fix old bug
This commit is contained in:
@ -25,10 +25,12 @@ _posAndSize set [2, _stamina * GVAR(staminaBarWidth)];
|
|||||||
_staminaBarContainer ctrlSetPosition _posAndSize;
|
_staminaBarContainer ctrlSetPosition _posAndSize;
|
||||||
|
|
||||||
// - Opacity ------------------------------------------------------------------
|
// - Opacity ------------------------------------------------------------------
|
||||||
if (_stamina >= 0.8) then {
|
if (GVAR(fadeStaminaBar)) then {
|
||||||
_staminaBarContainer ctrlSetFade (0.9 + 0.1 * (_stamina - 0.8) / 0.2);
|
if (_stamina >= 0.8) then {
|
||||||
} else {
|
_staminaBarContainer ctrlSetFade (0.9 + 0.1 * (_stamina - 0.8) / 0.2);
|
||||||
_staminaBarContainer ctrlSetFade (0.9 * _stamina / 0.8);
|
} else {
|
||||||
|
_staminaBarContainer ctrlSetFade (0.9 * _stamina / 0.8);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// - Color --------------------------------------------------------------------
|
// - Color --------------------------------------------------------------------
|
||||||
|
@ -4,8 +4,14 @@
|
|||||||
[LSTRING(Enabled), LSTRING(Enabled_Description)],
|
[LSTRING(Enabled), LSTRING(Enabled_Description)],
|
||||||
LSTRING(DisplayName),
|
LSTRING(DisplayName),
|
||||||
true,
|
true,
|
||||||
true,
|
true, {
|
||||||
{[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)},
|
if (!_this) then {
|
||||||
|
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
||||||
|
_staminaBarContainer ctrlSetFade 1;
|
||||||
|
_staminaBarContainer ctrlCommit 0;
|
||||||
|
};
|
||||||
|
[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)
|
||||||
|
},
|
||||||
true // Needs mission restart
|
true // Needs mission restart
|
||||||
] call CBA_Settings_fnc_init;
|
] call CBA_Settings_fnc_init;
|
||||||
|
|
||||||
@ -24,6 +30,21 @@
|
|||||||
}
|
}
|
||||||
] call CBA_Settings_fnc_init;
|
] call CBA_Settings_fnc_init;
|
||||||
|
|
||||||
|
[
|
||||||
|
QGVAR(fadeStaminaBar),
|
||||||
|
"CHECKBOX",
|
||||||
|
[LSTRING(FadeStaminaBar), LSTRING(FadeStaminaBar_Description)],
|
||||||
|
LSTRING(DisplayName),
|
||||||
|
true,
|
||||||
|
false, {
|
||||||
|
if (!_this && GVAR(enabled) && GVAR(enableStaminaBar)) then {
|
||||||
|
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
||||||
|
_staminaBarContainer ctrlSetFade 0;
|
||||||
|
_staminaBarContainer ctrlCommit 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
] call CBA_Settings_fnc_init;
|
||||||
|
|
||||||
[
|
[
|
||||||
QGVAR(performanceFactor),
|
QGVAR(performanceFactor),
|
||||||
"SLIDER",
|
"SLIDER",
|
||||||
|
@ -223,5 +223,13 @@
|
|||||||
<Portuguese>Exibe a barra de estamina.</Portuguese>
|
<Portuguese>Exibe a barra de estamina.</Portuguese>
|
||||||
<Czech>Zobrazuje lištu výdrže</Czech>
|
<Czech>Zobrazuje lištu výdrže</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Advanced_Fatigue_FadeStaminaBar">
|
||||||
|
<English>Fade Stamina bar automatically</English>
|
||||||
|
<German>Blende Ausdauerleiste automatisch aus</German>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Advanced_Fatigue_FadeStaminaBar_Description">
|
||||||
|
<English>Adjusts transparency of the bar based on stamina status.</English>
|
||||||
|
<German>Passt die Transparenz der Ausdauerleiste abhängig vom Ausdauerstatus an.</German>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
Reference in New Issue
Block a user