Added cargo listenable and callable events

This commit is contained in:
jonpas 2015-08-18 18:48:21 +02:00
parent 16add9d376
commit e110874800
4 changed files with 16 additions and 0 deletions

View File

@ -4,6 +4,12 @@ class Extended_PreInit_EventHandlers {
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
class Extended_Killed_EventHandlers {
class All {
init = QUOTE(call FUNC(handleDestroyed));

View File

@ -0,0 +1,4 @@
#include "script_component.hpp"
["LoadItem", {_this call FUNC(loadItem)}] call EFUNC(common,addEventHandler);
["UnloadItem", {_this call FUNC(unloadItem)}] call EFUNC(common,addEventHandler);

View File

@ -34,4 +34,7 @@ detach _item;
_item attachTo [_vehicle,[0,0,100]];
["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent);
// Invoke listenable event
["cargo_itemLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
true

View File

@ -62,4 +62,7 @@ _item setPosASL (_emptyPos call EFUNC(common,PositiontoASL));
// TOOO maybe drag/carry the unloaded item?
// Invoke listenable event
["cargo_itemUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
true