mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Handle changes to CBA_fnc_addPlayerEventHandler (#4878)
* Handle changes to CBA_fnc_addPlayerEventHandler * Fix var spelling
This commit is contained in:
parent
78a55d4436
commit
159e762576
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
TRACE_3("setName",_unit,alive _unit,name _unit);
|
||||
|
||||
if (isNull _unit || {!alive _unit}) exitWith {};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user