Dogtags - Rename inventory items via CBA (#10130)

* Dogtags - Rename inventory items via CBA

* Update addons/dogtags/XEH_postInit.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

---------

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
This commit is contained in:
PabstMirror 2024-07-28 11:43:03 -05:00 committed by GitHub
parent 56eae4060c
commit a6ab050a07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,18 @@
if (hasInterface || isServer) then {
[QGVAR(broadcastDogtagInfo), {
GVAR(dogtagsData) set _this;
if (isNil "CBA_fnc_renameInventoryItem") exitWith {}; // requires https://github.com/CBATeam/CBA_A3/pull/1329
params ["_item", "_dogTagData"];
private _name = _dogtagData param [0, ""];
// If data doesn't exist or body has no name, set name as "unknown"
if (_name == "") then {
_name = LELSTRING(common,unknown);
};
_name = [LLSTRING(itemName), ": ", _name] joinString "";
[_item, _name] call CBA_fnc_renameInventoryItem;
}] call CBA_fnc_addEventHandler;
if (isServer) then {