Throw the playerVisionModeChanged ACE event

This commit is contained in:
Nicolás Badano 2015-01-16 15:39:19 -03:00
parent 8b3c70a16d
commit 223600e689

View File

@ -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;