Merge pull request #4655 from acemod/fixStamBar

Hide advFatigue bar on map / spectator / in vehicles
This commit is contained in:
BaerMitUmlaut 2016-11-13 18:06:34 +01:00 committed by GitHub
commit d40c3fd2bf
2 changed files with 10 additions and 3 deletions

View File

@ -12,10 +12,14 @@ if (!hasInterface) exitWith {};
GVAR(ppeBlackout) ppEffectCommit 0.4;
// - GVAR updating and initialization -----------------------------------------
if !(isNull ACE_player) then {
[ACE_player, objNull] call FUNC(handlePlayerChanged);
["unit", FUNC(handlePlayerChanged), true] call CBA_fnc_addPlayerEventHandler;
private _fnc_showStaminaBar = {
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
_staminaBarContainer ctrlShow ((!visibleMap) && {(vehicle ACE_player) == ACE_player});
};
["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler;
["visibleMap", _fnc_showStaminaBar, true] call CBA_fnc_addPlayerEventHandler;
["vehicle", _fnc_showStaminaBar, true] call CBA_fnc_addPlayerEventHandler;
// - Duty factors -------------------------------------------------------------
if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {

View File

@ -11,6 +11,9 @@
#include "script_component.hpp"
if (!alive ACE_player) exitWith { // Dead people don't breath, Will also handle null (Map intros)
[FUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute;
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
_staminaBarContainer ctrlSetFade 1;
_staminaBarContainer ctrlCommit 1;
};
private _currentWork = REE;