mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
convert map-gestures to cba hashes (#4187)
This commit is contained in:
parent
1f6b10c4cb
commit
46adfe1150
@ -46,8 +46,8 @@ params ["_mapHandle"];
|
|||||||
_grpName = groupID _group;
|
_grpName = groupID _group;
|
||||||
|
|
||||||
// If color settings for the group exist, then use those, otherwise fall back to the default colors
|
// If color settings for the group exist, then use those, otherwise fall back to the default colors
|
||||||
_color = if (HASH_HASKEY(GVAR(GroupColorConfigurationMapping),_grpName)) then {
|
_color = if ([GVAR(GroupColorConfigurationMapping), _grpName] call CBA_fnc_hashHasKey) then {
|
||||||
(GVAR(GroupColorConfigurations) select (HASH_GET(GVAR(GroupColorConfigurationMapping),_grpName))) select (_x != leader _group)
|
(GVAR(GroupColorConfigurations) select ([GVAR(GroupColorConfigurationMapping), _grpName] call CBA_fnc_hashGet)) select (_x != leader _group)
|
||||||
} else {
|
} else {
|
||||||
if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)};
|
if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)};
|
||||||
};
|
};
|
||||||
|
@ -31,15 +31,15 @@ if (!([_color] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a va
|
|||||||
|
|
||||||
// If we already have color configurations from another source, use those, otherwise use default.
|
// If we already have color configurations from another source, use those, otherwise use default.
|
||||||
_configurations = if (isNil QGVAR(GroupColorConfigurations)) then { [] } else { +GVAR(GroupColorConfigurations) };
|
_configurations = if (isNil QGVAR(GroupColorConfigurations)) then { [] } else { +GVAR(GroupColorConfigurations) };
|
||||||
_configurationGroupMappings = if(isNil QGVAR(GroupColorConfigurationMapping)) then { HASH_CREATE } else { +GVAR(GroupColorConfigurationMapping) };
|
_configurationGroupMappings = if(isNil QGVAR(GroupColorConfigurationMapping)) then { [] call CBA_fnc_hashCreate } else { +GVAR(GroupColorConfigurationMapping) };
|
||||||
|
|
||||||
// Save custom color configuration and keep the index of the entry.
|
// Save custom color configuration and keep the index of the entry.
|
||||||
_configurationIndex = _configurations pushBack [_leadColor, _color];
|
_configurationIndex = _configurations pushBack [_leadColor, _color];
|
||||||
|
|
||||||
// Add all synchronized groups and reference custom configuration for them
|
// Add all synchronized groups and reference custom configuration for them
|
||||||
{
|
{
|
||||||
HASH_SET(_configurationGroupMappings,groupID (group _x),_configurationIndex);
|
[_configurationGroupMappings, groupID group _x, _configurationIndex] call CBA_fnc_hashSet;
|
||||||
} count _units;
|
} forEach _units;
|
||||||
|
|
||||||
[QGVAR(GroupColorConfigurations), _configurations, false, true] call EFUNC(common,setSetting);
|
[QGVAR(GroupColorConfigurations), _configurations, false, true] call EFUNC(common,setSetting);
|
||||||
[QGVAR(GroupColorConfigurationMapping), _configurationGroupMappings, false, true] call EFUNC(common,setSetting);
|
[QGVAR(GroupColorConfigurationMapping), _configurationGroupMappings, false, true] call EFUNC(common,setSetting);
|
||||||
|
Loading…
Reference in New Issue
Block a user