From edc7e9af3e5bbb6a3feaee0f3bec2dc625e4becc Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 4 Jul 2024 09:39:08 +0200 Subject: [PATCH] Dogtags - Add context menu action to check dog tag (#10101) * Broadcast dogtag info globally so that arsenal can use it * Broadcast changes incrementally * Add context menu option for dogtags --- addons/dogtags/XEH_postInit.sqf | 18 ++++++++++++++++++ addons/dogtags/functions/fnc_getDogtagItem.sqf | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index 9f9fad0f818..6e676671ae0 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -97,5 +97,23 @@ if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then { }] call CBA_fnc_addEventHandler; }; +// Add context menu option +[ + "ACE_dogtag", + ["GROUND", "CARGO", "CONTAINER"], + LLSTRING(checkItem), + nil, + QPATHTOF(data\dogtag_icon_ca.paa), + [ + {true}, + {true} + ], + { + [GVAR(dogtagsData) getOrDefault [_this select 2, []]] call FUNC(showDogtag); + + false + } +] call CBA_fnc_addItemContextMenuOption; + // Disable dogtags for civilians "CIV_F" call FUNC(disableFactionDogtags); diff --git a/addons/dogtags/functions/fnc_getDogtagItem.sqf b/addons/dogtags/functions/fnc_getDogtagItem.sqf index 41cfc4deb78..e5f05eb19b2 100644 --- a/addons/dogtags/functions/fnc_getDogtagItem.sqf +++ b/addons/dogtags/functions/fnc_getDogtagItem.sqf @@ -28,7 +28,6 @@ if (GVAR(idCounter) > 999) exitWith {ERROR("Ran out of IDs");}; private _dogTagData = [_target] call FUNC(getDogTagData); private _item = format ["ACE_dogtag_%1", GVAR(idCounter)]; - [QGVAR(addDogtagItem), [_item, _dogTagData], [_player]] call CBA_fnc_targetEvent; // Broadcast data globally, so that clients can use it where needed