Use vehicle eh to hide bar

This commit is contained in:
PabstMirror 2016-11-13 10:55:57 -06:00 committed by Glowbal
parent 948442fafb
commit 054831f370
2 changed files with 6 additions and 8 deletions

View File

@ -13,10 +13,13 @@ if (!hasInterface) exitWith {};
// - GVAR updating and initialization -----------------------------------------
["unit", FUNC(handlePlayerChanged), true] call CBA_fnc_addPlayerEventHandler;
["visibleMap", {
private _fnc_showStaminaBar = {
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
_staminaBarContainer ctrlShow (!visibleMap);
}, true] call CBA_fnc_addPlayerEventHandler;
_staminaBarContainer ctrlShow ((!visibleMap) && {(vehicle ACE_player) == ACE_player});
};
["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

@ -13,11 +13,6 @@ params ["_stamina"];
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
if ((vehicle ACE_player) != ACE_player) exitWith { // Hide when mounted
_staminaBarContainer ctrlSetFade 1;
_staminaBarContainer ctrlCommit 1;
};
// - Size ---------------------------------------------------------------------
// Shrink the container to cut off the image (other wise it would just get stretched)
private _posAndSize = ctrlPosition _staminaBarContainer;