Nametags - Add Nation Ranks (#7094)

* Adds icon and postInit

Adds German, British, Spanish, French ranks. Also adds postInit code
that loops through all factions and checks if ranks have been set there
in there for easy, permanent customistability.

* Removed white space

* commy2's postInit rewrite

Changes faction config entry to array with macros and changes the
postInit code to commy2's improved version.

* Update addons/nametags/CfgFactionClasses.hpp

Co-Authored-By: Dedmen Miller <dedmen@users.noreply.github.com>

* Adjusted arrays to be multi line

Also removed white space.

* Update addons/nametags/XEH_postInit.sqf

Co-Authored-By: commy2 <commy-2@gmx.de>

* Update addons/nametags/CfgFactionClasses.hpp

Co-Authored-By: commy2 <commy-2@gmx.de>

* Add getVar setting, don't overwrite if already set
This commit is contained in:
TWC-Rik 2019-10-09 06:20:26 +02:00 committed by PabstMirror
parent 2f3d8db134
commit 6ca4b2075d
32 changed files with 93 additions and 0 deletions

View File

@ -0,0 +1,79 @@
class CfgFactionClasses {
class OPF_F {
GVAR(rankIcons)[] = {
QPATHTOF(UI\icons_russia\private_gs.paa),
QPATHTOF(UI\icons_russia\corporal_gs.paa),
QPATHTOF(UI\icons_russia\sergeant_gs.paa),
QPATHTOF(UI\icons_russia\lieutenant_gs.paa),
QPATHTOF(UI\icons_russia\captain_gs.paa),
QPATHTOF(UI\icons_russia\major_gs.paa),
QPATHTOF(UI\icons_russia\colonel_gs.paa)
};
};
class OPF_G_F {
GVAR(rankIcons)[] = {
QPATHTOF(UI\icons_spain\private_gs.paa),
QPATHTOF(UI\icons_spain\corporal_gs.paa),
QPATHTOF(UI\icons_spain\sergeant_gs.paa),
QPATHTOF(UI\icons_spain\lieutenant_gs.paa),
QPATHTOF(UI\icons_spain\captain_gs.paa),
QPATHTOF(UI\icons_spain\major_gs.paa),
QPATHTOF(UI\icons_spain\colonel_gs.paa)
};
};
class OPF_T_F {
GVAR(rankIcons)[] = {
QPATHTOF(UI\icons_russia\private_gs.paa),
QPATHTOF(UI\icons_russia\corporal_gs.paa),
QPATHTOF(UI\icons_russia\sergeant_gs.paa),
QPATHTOF(UI\icons_russia\lieutenant_gs.paa),
QPATHTOF(UI\icons_russia\captain_gs.paa),
QPATHTOF(UI\icons_russia\major_gs.paa),
QPATHTOF(UI\icons_russia\colonel_gs.paa)
};
};
class OPF_V_F {
GVAR(rankIcons)[] = {
QPATHTOF(UI\icons_russia\private_gs.paa),
QPATHTOF(UI\icons_russia\corporal_gs.paa),
QPATHTOF(UI\icons_russia\sergeant_gs.paa),
QPATHTOF(UI\icons_russia\lieutenant_gs.paa),
QPATHTOF(UI\icons_russia\captain_gs.paa),
QPATHTOF(UI\icons_russia\major_gs.paa),
QPATHTOF(UI\icons_russia\colonel_gs.paa)
};
};
class IND_C_F {
GVAR(rankIcons)[] = {
QPATHTOF(UI\icons_russia\private_gs.paa),
QPATHTOF(UI\icons_russia\corporal_gs.paa),
QPATHTOF(UI\icons_russia\sergeant_gs.paa),
QPATHTOF(UI\icons_russia\lieutenant_gs.paa),
QPATHTOF(UI\icons_russia\captain_gs.paa),
QPATHTOF(UI\icons_russia\major_gs.paa),
QPATHTOF(UI\icons_russia\colonel_gs.paa)
};
};
class IND_F {
GVAR(rankIcons)[] = {
QPATHTOF(UI\icons_germany\private_gs.paa),
QPATHTOF(UI\icons_germany\corporal_gs.paa),
QPATHTOF(UI\icons_germany\sergeant_gs.paa),
QPATHTOF(UI\icons_germany\lieutenant_gs.paa),
QPATHTOF(UI\icons_germany\captain_gs.paa),
QPATHTOF(UI\icons_germany\major_gs.paa),
QPATHTOF(UI\icons_germany\colonel_gs.paa)
};
};
class IND_G_F {
GVAR(rankIcons)[] = {
QPATHTOF(UI\icons_spain\private_gs.paa),
QPATHTOF(UI\icons_spain\corporal_gs.paa),
QPATHTOF(UI\icons_spain\sergeant_gs.paa),
QPATHTOF(UI\icons_spain\lieutenant_gs.paa),
QPATHTOF(UI\icons_spain\captain_gs.paa),
QPATHTOF(UI\icons_spain\major_gs.paa),
QPATHTOF(UI\icons_spain\colonel_gs.paa)
};
};
};

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -45,3 +45,15 @@ GVAR(showNamesTime) = -10;
// civilians don't use military ranks
["CIV_F", ["","","","","","",""]] call FUNC(setFactionRankIcons);
// Change ranks based on faction for all factions that have an entry in CfgFactionClasses
if (missionNamespace getVariable [QGVAR(useFactionIcons), true]) then {
{
if (isArray (_x >> QGVAR(rankIcons))) then {
private _faction = configName _x;
if (!isNil {GVAR(factionRanks) getVariable _faction}) exitWith {}; // don't overwrite if already set
private _icons = getArray (_x >> QGVAR(rankIcons));
[_faction, _icons] call FUNC(setFactionRankIcons);
};
} forEach ("true" configClasses (configFile >> "CfgFactionClasses"));
};

View File

@ -16,6 +16,7 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"
#include "ACE_Settings.hpp"
#include "CfgFactionClasses.hpp"
#include "CfgVehicles.hpp"
#include <RscTitles.hpp>

View File

@ -29,6 +29,7 @@ if (isNil QGVAR(factionRanks)) then {
};
params [["_faction", "", [""]], ["_icons", [], [[]], [7]]];
TRACE_2("setFactionRankIcons",_faction,_icons);
if !(_faction != "" && {_icons isEqualTypeAll ""}) exitWith {false};