Handle changes to CBA_fnc_addPlayerEventHandler (#4878)

* Handle changes to CBA_fnc_addPlayerEventHandler

* Fix var spelling
This commit is contained in:
PabstMirror 2017-02-10 13:03:12 -06:00 committed by GitHub
parent 78a55d4436
commit 159e762576
4 changed files with 12 additions and 7 deletions

View File

@ -14,12 +14,15 @@ if (!hasInterface) exitWith {};
// - GVAR updating and initialization -----------------------------------------
["unit", FUNC(handlePlayerChanged), true] call CBA_fnc_addPlayerEventHandler;
private _fnc_showStaminaBar = {
["visibleMap", {
params ["", "_visibleMap"]; // command visibleMap is updated one frame later
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
_staminaBarContainer ctrlShow ((!_visibleMap) && {(vehicle ACE_player) == ACE_player});
}, true] call CBA_fnc_addPlayerEventHandler;
["vehicle", {
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
_staminaBarContainer ctrlShow ((!visibleMap) && {(vehicle ACE_player) == ACE_player});
};
["visibleMap", _fnc_showStaminaBar, true] call CBA_fnc_addPlayerEventHandler;
["vehicle", _fnc_showStaminaBar, true] call CBA_fnc_addPlayerEventHandler;
}, true] call CBA_fnc_addPlayerEventHandler;
// - Duty factors -------------------------------------------------------------
if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {

View File

@ -67,7 +67,8 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace;
}] call CBA_fnc_addPlayerEventhandler;
["visibleMap", {
if (visibleMap && {ACE_player getVariable [QGVAR(inHand), false]}) then {
params ["", "_visibleMap"]; // command visibleMap is updated one frame later
if (_visibleMap && {ACE_player getVariable [QGVAR(inHand), false]}) then {
[ACE_player, "Opened Map"] call FUNC(exitThrowMode);
};
}] call CBA_fnc_addPlayerEventhandler;

View File

@ -282,11 +282,11 @@ enableCamShake true;
params ["_newPlayer","_oldPlayer"];
if (alive _newPlayer) then {
[_newPlayer] call FUNC(setName);
[FUNC(setName), [_newPlayer]] call CBA_fnc_execNextFrame;
};
if (alive _oldPlayer) then {
[_oldPlayer] call FUNC(setName);
[FUNC(setName), [_oldPlayer]] call CBA_fnc_execNextFrame;
};
}] call CBA_fnc_addPlayerEventHandler;

View File

@ -13,6 +13,7 @@
#include "script_component.hpp"
params ["_unit"];
TRACE_3("setName",_unit,alive _unit,name _unit);
if (isNull _unit || {!alive _unit}) exitWith {};