mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Throw the playerVisionModeChanged ACE event
This commit is contained in:
parent
8b3c70a16d
commit
223600e689
@ -75,14 +75,25 @@ enableCamShake true;
|
||||
}] call FUNC(addEventhandler);
|
||||
|
||||
GVAR(OldPlayerInventory) = ACE_player call FUNC(getAllGear);
|
||||
GVAR(OldPlayerVisionMode) = currentVisionMode ACE_player;
|
||||
|
||||
// PFH to raise "playerInventoryChanged" event
|
||||
// PFH to raise varios events
|
||||
[{
|
||||
// "playerInventoryChanged" event
|
||||
_newPlayerInventory = ACE_player call FUNC(getAllGear);
|
||||
|
||||
if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) exitWith {
|
||||
// Raise ACE event
|
||||
// Raise ACE event locally
|
||||
GVAR(OldPlayerInventory) = _newPlayerInventory;
|
||||
["playerInventoryChanged", [ACE_player, _newPlayerInventory]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
// "playerVisionModeChanged" event
|
||||
_newVisionMode = currentVisionMode ACE_player;
|
||||
if !(_newPlayerVisionMode isEqualTo GVAR(OldPlayerVisionMode)) exitWith {
|
||||
// Raise ACE event locally
|
||||
GVAR(OldPlayerVisionMode) = _newPlayerVisionMode;
|
||||
["playerVisionModeChanged", [ACE_player, _newPlayerVisionMode]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
|
||||
}, 0, []] call cba_fnc_addPerFrameHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user