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

Name Tags - Add ability to set custom rank icon #8174

Merged
merged 3 commits into from
Apr 20, 2021
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
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Dharma Bellamkonda <dharma.bellamkonda@gmail.com>
Dimaslg <dimaslg@telecable.es>
diwako
dixon13 <dixonbegay@gmail.com>
Drift_91
Drill <drill87@gmail.com>
Dudakov aka [OMCB]Kaban <dudakov.s@gmail.com>
Drofseh <drofseh@gmail.com>
Expand Down
17 changes: 10 additions & 7 deletions addons/nametags/functions/fnc_drawNameTagIcon.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "script_component.hpp"
/*
* Author: commy2, esteldunedain
* Author: commy2, esteldunedain, Drift_91
* Draw the nametag and rank icon.
*
* Arguments:
Expand Down Expand Up @@ -33,12 +33,15 @@ _fnc_parameters = {
if (_drawSoundwave) then {
_icon = format [QPATHTOF(UI\soundwave%1.paa), floor random 10];
} else {
if (_drawRank && {rank _target != ""}) then {
_icon = GVAR(factionRanks) getVariable (_target getVariable [QGVAR(faction), faction _target]);
if (!isNil "_icon") then {
_icon = _icon param [ALL_RANKS find rank _target, ""];
} else {
_icon = format ["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _target];
if (_drawRank) then {
_icon = _target getVariable "ace_nametags_rankIcon";
if (isNil "_icon" && {rank _target != ""}) then {
_icon = GVAR(factionRanks) getVariable (_target getVariable [QGVAR(faction), faction _target]);
if (!isNil "_icon") then {
_icon = _icon param [ALL_RANKS find rank _target, ""];
} else {
_icon = format ["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _target];
};
};
};
};
Expand Down