Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Fatigue - Solid stamina bar option #6911

Merged
merged 13 commits into from
Dec 7, 2019
3 changes: 3 additions & 0 deletions addons/advanced_fatigue/ACE_Settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ class ACE_Settings {
class GVAR(enableStaminaBar) {
movedToSQF = 1;
};
class GVAR(solidStaminaBar) {
movedToSQF = 1;
};
class GVAR(performanceFactor) {
movedToSQF = 1;
};
Expand Down
12 changes: 8 additions & 4 deletions addons/advanced_fatigue/functions/fnc_handleStaminaBar.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ _posAndSize set [2, _stamina * GVAR(staminaBarWidth)];
_staminaBarContainer ctrlSetPosition _posAndSize;

// - Opacity ------------------------------------------------------------------
if (_stamina >= 0.8) then {
_staminaBarContainer ctrlSetFade (0.9 + 0.1 * (_stamina - 0.8) / 0.2);
} else {
_staminaBarContainer ctrlSetFade (0.9 * _stamina / 0.8);
if (GVAR(solidStaminaBar)) then {
_staminaBarContainer ctrlSetFade 0;
} else {
if (_stamina >= 0.8) then {
_staminaBarContainer ctrlSetFade (0.9 + 0.1 * (_stamina - 0.8) / 0.2);
} else {
_staminaBarContainer ctrlSetFade (0.9 * _stamina / 0.8);
};
};

// - Color --------------------------------------------------------------------
Expand Down
15 changes: 15 additions & 0 deletions addons/advanced_fatigue/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@
}
] call CBA_Settings_fnc_init;

[
QGVAR(solidStaminaBar),
"CHECKBOX",
[LSTRING(SolidStaminaBar), LSTRING(SolidStaminaBar_Description)],
LSTRING(DisplayName),
false,
false, {
if (!_this) then {
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
_staminaBarContainer ctrlSetFade 1;
_staminaBarContainer ctrlCommit 0;
};
}
] call CBA_Settings_fnc_init;

[
QGVAR(performanceFactor),
"SLIDER",
Expand Down
8 changes: 8 additions & 0 deletions addons/advanced_fatigue/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,13 @@
<Chinese>顯示體力條</Chinese>
<Chinesesimp>显示体力条</Chinesesimp>
</Key>
<Key ID="STR_ACE_Advanced_Fatigue_SolidStaminaBar">
<English>Solid stamina bar</English>
<German>Zeige Ausdauerleiste als deckendes Element</German>
</Key>
<Key ID="STR_ACE_Advanced_Fatigue_SolidStaminaBar_Description">
<English>Shows the stamina bar as solid, regardless of stamina status.</English>
<German>Zeigt die Ausdauerleiste als nichttransparentes Element an, unabhängig vom Ausdauerstatus.</German>
</Key>
</Package>
</Project>