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
This commit is contained in:
johnb432 2024-07-04 09:39:08 +02:00 committed by GitHub
parent 3745305323
commit edc7e9af3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 1 deletions

View File

@ -97,5 +97,23 @@ if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then {
}] call CBA_fnc_addEventHandler; }] 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 // Disable dogtags for civilians
"CIV_F" call FUNC(disableFactionDogtags); "CIV_F" call FUNC(disableFactionDogtags);

View File

@ -28,7 +28,6 @@ if (GVAR(idCounter) > 999) exitWith {ERROR("Ran out of IDs");};
private _dogTagData = [_target] call FUNC(getDogTagData); private _dogTagData = [_target] call FUNC(getDogTagData);
private _item = format ["ACE_dogtag_%1", GVAR(idCounter)]; private _item = format ["ACE_dogtag_%1", GVAR(idCounter)];
[QGVAR(addDogtagItem), [_item, _dogTagData], [_player]] call CBA_fnc_targetEvent; [QGVAR(addDogtagItem), [_item, _dogTagData], [_player]] call CBA_fnc_targetEvent;
// Broadcast data globally, so that clients can use it where needed // Broadcast data globally, so that clients can use it where needed