mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fixed code style issues and added missing variable initialization in map_gestures
This commit is contained in:
parent
b1d3654a97
commit
5788705821
@ -20,24 +20,23 @@ if (!visibleMap) exitWith {};
|
||||
|
||||
params ["_mapHandle"];
|
||||
|
||||
_nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
|
||||
_proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
|
||||
{
|
||||
_nameSane = [name _x] call FUNC(sanitizeName);
|
||||
_drawPosVariableName = format [QGVAR(%1_DrawPos), _nameSane];
|
||||
if (!isNil _drawPosVariableName) then {
|
||||
if (isNil {call compile _drawPosVariableName}) then {call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];}
|
||||
_pos = call compile _drawPosVariableName;
|
||||
if (alive _x &&
|
||||
(_pos distance [0, 0, 0]) > 50 &&
|
||||
{_x getVariable QGVAR(Transmit)}) then {
|
||||
_group = group _x;
|
||||
_grpName = groupID _group;
|
||||
|
||||
_color = [1, 1, 1, 1];
|
||||
if (_grpName in GVAR(GroupColorConfigurationsGroups)) then {
|
||||
_color = if (_grpName in GVAR(GroupColorConfigurationsGroups)) then {
|
||||
_grpNameIndex = GVAR(GroupColorConfigurationsGroups) find _grpName;
|
||||
_color = (GVAR(GroupColorConfigurations) select (GVAR(GroupColorConfigurationsGroupIndex) select _grpNameIndex)) select (_x != leader _group);
|
||||
(GVAR(GroupColorConfigurations) select (GVAR(GroupColorConfigurationsGroupIndex) select _grpNameIndex)) select (_x != leader _group)
|
||||
} else {
|
||||
_color = if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)};
|
||||
if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)};
|
||||
};
|
||||
|
||||
_mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, 55, 55, 0, "", 1, 0.030, "PuristaBold", "left"];
|
||||
@ -45,4 +44,4 @@ _nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
|
||||
};
|
||||
};
|
||||
nil
|
||||
} count _nearDudes;
|
||||
} count _proximityPlayers;
|
||||
|
@ -27,12 +27,7 @@ if (isNil "_leadColor" || !((typeName _leadColor) isEqualTo "ARRAY") || {count _
|
||||
_color = call compile ("[" + (_logic getVariable ["color", ""]) + "]");
|
||||
if (isNil "_color" || !((typeName _color) isEqualTo "ARRAY") || {count _color != 4}) exitWith {};
|
||||
|
||||
_configurations = +GVAR(GroupColorConfigurations);
|
||||
if (isNil "_configurations") then {_configurations = []};
|
||||
_configurationIndex = _configurations pushBack [_leadColor, _color];
|
||||
|
||||
_configurationGroups = +GVAR(GroupColorConfigurationsGroups);
|
||||
_configurationGroupsIndex = +GVAR(GroupColorConfigurationsGroupIndex);
|
||||
_configurationGroups = if (isNil QGVAR(GroupColorConfigurationsGroups) then { [] } else { +GVAR(GroupColorConfigurationsGroups) };
|
||||
|
||||
if (isNil "_configurationGroups") then {_configurationGroups = [];};
|
||||
if (isNil "_configurationGroupsIndex") then {_configurationGroupsIndex = [];};
|
||||
|
@ -17,8 +17,8 @@
|
||||
|
||||
{
|
||||
if (isPlayer _x) then {
|
||||
_nameSane = [name _x] call FUNC(sanitizeName);
|
||||
call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];
|
||||
_nameSane = [name _x] call FUNC(sanitizeName);
|
||||
call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];
|
||||
};
|
||||
nil
|
||||
} count allUnits;
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_nearDudes", "_ownerID", "_nameSane"];
|
||||
private ["_proximityPlayers", "_ownerID", "_nameSane"];
|
||||
|
||||
params ["", "_pfhId"];
|
||||
|
||||
@ -25,8 +25,8 @@ if (!GVAR(EnableTransmit) || !visibleMap) exitWith {
|
||||
[_pfhId] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
_nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
|
||||
TRACE_1("Near",_nearDudes)
|
||||
_proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
|
||||
TRACE_1("Near",_proximityPlayers)
|
||||
|
||||
{
|
||||
_ownerID = _x getVariable QGVAR(owner_id);
|
||||
@ -39,4 +39,4 @@ TRACE_1("Near",_nearDudes)
|
||||
_nameSane = [name ACE_player] call FUNC(sanitizeName);
|
||||
_ownerID publicVariableClient format [QGVAR(%1_DrawPos), _nameSane];
|
||||
};
|
||||
} count _nearDudes;
|
||||
} count _proximityPlayers;
|
||||
|
Loading…
Reference in New Issue
Block a user