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

Hide advFatigue bar on map / spectator #4655

Merged
merged 4 commits into from
Nov 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions addons/advanced_fatigue/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The handlePlayerChanged function needs to run at least once. If the unit EH triggered already, this will completly break AF. Would recommend to just revert this to how it was.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Third arg for addPlayerEventHandler was recently added to do the same thing:

_applyRetroactively - Call function immediately if player is defined already (optional, default: false) <BOOL>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. That works then.


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 {
Expand Down
3 changes: 3 additions & 0 deletions addons/advanced_fatigue/functions/fnc_mainLoop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down