linted extract group color function and parsed colors gvar

This commit is contained in:
Valmo Trindade
2025-06-17 03:57:13 -03:00
parent c8c2b639ea
commit 35742847a7

View File

@@ -1,9 +1,11 @@
#include "..\..\script_component.hpp"
params["_group"]; params["_group"];
_group_name = _group getVariable "_atak_group_name"; _group_name = _group getVariable QGVAR(group_name);
if (isNil "_group_name") then { if (isNil "_group_name") then {
_group_colors = missionNamespace getVariable "armatak_group_colors"; _group_colors = missionNamespace getVariable QGVAR(group_colors);
_group_name = selectRandom _group_colors; _group_name = selectRandom _group_colors;
if (count _group_colors > 0) then { if (count _group_colors > 0) then {
@@ -14,11 +16,11 @@ if (isNil "_group_name") then {
_group_colors deleteAt _randomIndex; _group_colors deleteAt _randomIndex;
_group_name = _selectedColor; _group_name = _selectedColor;
_group setVariable ["_atak_group_name", _group_name]; _group setVariable [QGVAR(group_name), _group_name];
missionNamespace setVariable ["armatak_group_colors", _group_colors] missionNamespace setVariable [QGVAR(group_colors), _group_colors]
} else { } else {
_group_name = "Red"; _group_name = "Red";
_group setVariable ["_atak_group_name", _group_name]; _group setVariable [QGVAR(group_name), _group_name];
}; };
}; };