Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dogtags - Improve displaying dog tags from bodies with no name #10096

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions addons/dogtags/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,14 @@ if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then {
_item = _rightPanel lnbData [_i, 0];

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

// If data doesn't exist, put name as "unknown"
_rightPanel lnbSetText [[_i, 1], [LLSTRING(itemName), ": ", _dogtagData param [0, LELSTRING(common,unknown)]] joinString ""];
// If data doesn't exist or body has no name, set name as "unknown"
if (_name == "") then {
_name = LELSTRING(common,unknown);
};

_rightPanel lnbSetText [[_i, 1], [LLSTRING(itemName), ": ", _name] joinString ""];
};
};
};
Expand Down
10 changes: 8 additions & 2 deletions addons/dogtags/functions/fnc_addDogtagItem.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ if (_item == "") exitWith {};

[ace_player, _item] call CBA_fnc_addItem;

_dogtagData params ["_nickName"];
private _displayText = format [localize LSTRING(takeDogtagSuccess), _nickName];
_dogtagData params ["_name"];

// If data doesn't exist or body has no name, set name as "unknown"
if (_name == "") then {
_name = LELSTRING(common,unknown);
};

private _displayText = format [localize LSTRING(takeDogtagSuccess), _name];

// display message
[{
Expand Down
10 changes: 8 additions & 2 deletions addons/dogtags/functions/fnc_showDogtag.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,11 @@ private _display = uiNamespace getvariable [QGVAR(tag), displayNull];
if(isNull _display) exitWith {};

private _control = _display displayCtrl 1001;
_dogtagData params ["_nickName", "_code", "_bloodType"];
_control ctrlSetStructuredText parseText format ["%1<br/>%2<br/>%3", toUpper _nickName, _code, _bloodType];
_dogtagData params ["_name", "_code", "_bloodType"];

// If data doesn't exist or body has no name, set name as "unknown"
if (_name == "") then {
_name = LELSTRING(common,unknown);
};

_control ctrlSetStructuredText parseText format ["%1<br/>%2<br/>%3", toUpper _name, _code, _bloodType];
Loading