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

This commit is contained in:
Kyle J. McKeown 2021-04-20 06:00:36 -04:00 committed by GitHub
parent dd454bdfbe
commit 5aa6e564e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View File

@ -71,6 +71,7 @@ Dharma Bellamkonda <dharma.bellamkonda@gmail.com>
Dimaslg <dimaslg@telecable.es> Dimaslg <dimaslg@telecable.es>
diwako diwako
dixon13 <dixonbegay@gmail.com> dixon13 <dixonbegay@gmail.com>
Drift_91
Drill <drill87@gmail.com> Drill <drill87@gmail.com>
Dudakov aka [OMCB]Kaban <dudakov.s@gmail.com> Dudakov aka [OMCB]Kaban <dudakov.s@gmail.com>
Drofseh <drofseh@gmail.com> Drofseh <drofseh@gmail.com>

View File

@ -1,6 +1,6 @@
#include "script_component.hpp" #include "script_component.hpp"
/* /*
* Author: commy2, esteldunedain * Author: commy2, esteldunedain, Drift_91
* Draw the nametag and rank icon. * Draw the nametag and rank icon.
* *
* Arguments: * Arguments:
@ -33,12 +33,15 @@ _fnc_parameters = {
if (_drawSoundwave) then { if (_drawSoundwave) then {
_icon = format [QPATHTOF(UI\soundwave%1.paa), floor random 10]; _icon = format [QPATHTOF(UI\soundwave%1.paa), floor random 10];
} else { } else {
if (_drawRank && {rank _target != ""}) then { if (_drawRank) then {
_icon = GVAR(factionRanks) getVariable (_target getVariable [QGVAR(faction), faction _target]); _icon = _target getVariable "ace_nametags_rankIcon";
if (!isNil "_icon") then { if (isNil "_icon" && {rank _target != ""}) then {
_icon = _icon param [ALL_RANKS find rank _target, ""]; _icon = GVAR(factionRanks) getVariable (_target getVariable [QGVAR(faction), faction _target]);
} else { if (!isNil "_icon") then {
_icon = format ["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _target]; _icon = _icon param [ALL_RANKS find rank _target, ""];
} else {
_icon = format ["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _target];
};
}; };
}; };
}; };