mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add dogtag actions to body bags
This commit is contained in:
parent
7f39748ff0
commit
3972504d4a
@ -9,14 +9,14 @@ class CfgVehicles {
|
||||
statement = "";
|
||||
showDisabled = 0;
|
||||
priority = 3;
|
||||
icon = ""; //@todo
|
||||
icon = QPATHTOF(data\dogtag_icon_ca.paa);
|
||||
class ACE_CheckDogtag {
|
||||
displayName = CSTRING(checkDogtag);
|
||||
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canCheckDogtag));
|
||||
statement = QUOTE([ARR_2(_player,_target)] call FUNC(checkDogtag));
|
||||
showDisabled = 0;
|
||||
priority = 3;
|
||||
icon = ""; //@todo
|
||||
icon = QPATHTOF(data\dogtag_icon_ca.paa);
|
||||
};
|
||||
class ACE_TakeDogtag {
|
||||
displayName = CSTRING(takeDogtag);
|
||||
@ -24,7 +24,7 @@ class CfgVehicles {
|
||||
statement = QUOTE([ARR_2(_player,_target)] call FUNC(takeDogtag));
|
||||
showDisabled = 0;
|
||||
priority = 3;
|
||||
icon = ""; //@todo
|
||||
icon = QPATHTOF(data\dogtag_icon_ca.paa);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -4,3 +4,42 @@
|
||||
[QGVAR(sendDogtagData), DFUNC(sendDogtagData)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(getDogtagItem), DFUNC(getDogtagItem)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(addDogtagItem), DFUNC(addDogtagItem)] call CBA_fnc_addEventHandler;
|
||||
|
||||
|
||||
//Add actions and event handlers only if ace_medical is loaded
|
||||
// - Adding actions via config would create a dependency
|
||||
if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
|
||||
if (hasInterface) then {
|
||||
|
||||
private _checkTagAction = [
|
||||
"ACE_CheckDogtag",
|
||||
format ["%1: %2", localize LSTRING(itemName), localize LSTRING(checkDogtag)],
|
||||
QPATHTOF(data\dogtag_icon_ca.paa),
|
||||
{[_player,_target] call FUNC(checkDogtag)},
|
||||
{!isNil {_target getVariable QGVAR(dogtagData)}}
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
["ACE_bodyBagObject", 0, ["ACE_MainActions"], _checkTagAction] call EFUNC(interact_menu,addActionToClass);
|
||||
|
||||
private _takeTagAction = [
|
||||
"ACE_TakeDogtag",
|
||||
format ["%1: %2", localize LSTRING(itemName), localize LSTRING(takeDogtag)],
|
||||
QPATHTOF(data\dogtag_icon_ca.paa),
|
||||
{[_player,_target] call FUNC(takeDogtag)},
|
||||
{(!isNil {_target getVariable QGVAR(dogtagData)}) && {((_target getVariable [QGVAR(dogtagTaken), objNull]) != _target)}}
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
["ACE_bodyBagObject", 0, ["ACE_MainActions"], _takeTagAction] call EFUNC(interact_menu,addActionToClass);
|
||||
};
|
||||
if (isServer) then {
|
||||
["ace_placedInBodyBag", {
|
||||
params ["_target", "_bodyBag"];
|
||||
TRACE_2("ace_placedInBodyBag eh",_target,_bodyBag);
|
||||
|
||||
private _dogTagData = [_target] call FUNC(getDogtagData);
|
||||
_bodyBag setVariable [QGVAR(dogtagData), _dogTagData, true];
|
||||
|
||||
if ((_target getVariable [QGVAR(dogtagTaken), objNull]) == _target) then {
|
||||
_bodyBag setVariable [QGVAR(dogtagTaken), _bodyBag, true];
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
};
|
||||
};
|
||||
|
BIN
addons/dogtags/data/dogtag_icon_ca.paa
Normal file
BIN
addons/dogtags/data/dogtag_icon_ca.paa
Normal file
Binary file not shown.
@ -27,7 +27,7 @@ if (isNil QGVAR(bodiesToDelete)) then {GVAR(bodiesToDelete) = [];};
|
||||
GVAR(bodiesToDelete) pushBack _target;
|
||||
|
||||
// Start up a loop to wait for bodies to be free to delete
|
||||
if ((count GVAR(bodiesToDelete)) > 0) then {
|
||||
if ((count GVAR(bodiesToDelete)) == 1) then {
|
||||
[] call FUNC(bodyCleanupLoop);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user