Skip to content

Commit 4d0641a

Browse files
authored
Dogtags - Improve displaying dogtags from bodies with no name (#10096)
Improve displaying dogtags from bodies with no name
1 parent dae2c5b commit 4d0641a

3 files changed

Lines changed: 23 additions & 7 deletions

File tree

addons/dogtags/XEH_postInit.sqf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,14 @@ if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then {
6666
_item = _rightPanel lnbData [_i, 0];
6767

6868
if (_item isKindOf ["ACE_dogtag", _cfgWeapons]) then {
69-
_dogtagData = _allDogtagsData param [_allDogtags find _item, []];
69+
private _name = (_allDogtagsData param [_allDogtags find _item, []]) param [0, ""];
7070

71-
// If data doesn't exist, put name as "unknown"
72-
_rightPanel lnbSetText [[_i, 1], [LLSTRING(itemName), ": ", _dogtagData param [0, LELSTRING(common,unknown)]] joinString ""];
71+
// If data doesn't exist or body has no name, set name as "unknown"
72+
if (_name == "") then {
73+
_name = LELSTRING(common,unknown);
74+
};
75+
76+
_rightPanel lnbSetText [[_i, 1], [LLSTRING(itemName), ": ", _name] joinString ""];
7377
};
7478
};
7579
};

addons/dogtags/functions/fnc_addDogtagItem.sqf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ if (_item == "") exitWith {};
2323
// Verify that the unit has inventory space, otherwise drop the dogtag on the ground
2424
[ace_player, _item, true] call CBA_fnc_addItem;
2525

26-
_dogtagData params ["_nickName"];
27-
private _displayText = format [localize LSTRING(takeDogtagSuccess), _nickName];
26+
_dogtagData params ["_name"];
27+
28+
// If data doesn't exist or body has no name, set name as "unknown"
29+
if (_name == "") then {
30+
_name = LELSTRING(common,unknown);
31+
};
32+
33+
private _displayText = format [localize LSTRING(takeDogtagSuccess), _name];
2834

2935
// display message
3036
[{

addons/dogtags/functions/fnc_showDogtag.sqf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,11 @@ private _display = uiNamespace getvariable [QGVAR(tag), displayNull];
3131
if(isNull _display) exitWith {};
3232

3333
private _control = _display displayCtrl 1001;
34-
_dogtagData params ["_nickName", "_code", "_bloodType"];
35-
_control ctrlSetStructuredText parseText format ["%1<br/>%2<br/>%3", toUpper _nickName, _code, _bloodType];
34+
_dogtagData params ["_name", "_code", "_bloodType"];
35+
36+
// If data doesn't exist or body has no name, set name as "unknown"
37+
if (_name == "") then {
38+
_name = LELSTRING(common,unknown);
39+
};
40+
41+
_control ctrlSetStructuredText parseText format ["%1<br/>%2<br/>%3", toUpper _name, _code, _bloodType];

0 commit comments

Comments
 (0)