Skip to content

Commit

Permalink
Dogtags - Rename inventory items via CBA (#10130)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
PabstMirror and johnb432 authored Jul 28, 2024
1 parent 56eae40 commit a6ab050
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions addons/dogtags/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a6ab050

Please sign in to comment.