|
1 | 1 | params ["_units"]; |
2 | 2 | AIO_selectedunits = _units; |
3 | 3 | if !(visibleMap) then {openMap true}; |
4 | | -AIO_MAP_EMPTY_VEHICLES_MODE = true; |
5 | | -[] spawn { |
6 | | -while {true} do { |
7 | | - if !(visibleMap) exitWith {}; |
8 | | - // This array links colors, side indexes, with actual side values |
9 | | - private _sideArray = [east, west, resistance, civilian]; |
10 | | - // We pick the group side, because you can mix members in a group |
11 | | - private _playerSide = _sideArray find (side group player); |
12 | | - private _alpha = 0.6; |
13 | | - // We only need to select the color once per loop, since we only care for one side |
14 | | - private _color = [ [1,0,0,_alpha], [0,0,1,_alpha], [0,1,0,_alpha], [1,1,0,_alpha] ] select _playerSide; |
15 | | - private _farUnits = [player]; |
16 | | - private _myVeh = []; |
17 | | - { |
18 | | - if ((_x distance player) > 100) then { |
19 | 4 |
|
20 | | - _farUnits = _farUnits + [_x]; |
21 | | - }; |
22 | | - } forEach units group player; |
23 | | - private _cfgVehicles = configFile >> "CfgVehicles"; |
24 | | - { |
25 | | - private _myVeh1 = _x nearObjects ["all", 200]; |
26 | | - for "_i" from 0 to ((count _myVeh1) - 1) do { |
27 | | - if !((_myVeh1 select _i) in _myVeh) then {_myVeh = [_myVeh1 select _i] + _myVeh;}; |
28 | | - }; |
29 | | - } forEach _farUnits; |
30 | | - private _newVehicles = _myVeh select {(!(_x isKindOf "Man") and !(_x isKindOf "Animal") and |
31 | | - (count (fullCrew [_x, "", true]))!=(count (fullCrew [_x, "", false])) and |
32 | | - (getNumber (_cfgVehicles >> typeOf _x >> "side") == _playerSide)) OR (_x isKindOf "Tree") OR (_x isKindOf "Rock") OR (_x isKindOf "Buidling")}; |
33 | | - |
34 | | - // From the vehicle gather the data |
35 | | - AIO_MAP_Vehicles = _newVehicles apply { |
36 | | - private _cfg = _cfgVehicles >> typeOf _x; |
37 | | - private _icon = getText (_cfg >> "icon"); |
38 | | - private _side = getNumber (_cfg >> "side"); |
39 | | - [ |
40 | | - _x, |
41 | | - getPosASLVisual _x, |
42 | | - getDirVisual _x, |
43 | | - _icon, |
44 | | - _color |
45 | | - ] |
46 | | - }; |
47 | | - if !(visibleMap) exitWith {}; |
48 | | - sleep 2; |
49 | | -}; |
50 | | -}; |
51 | 5 | AIO_retreatMapCMD = |
52 | 6 | { |
53 | 7 | _pos = _this select 1; |
@@ -100,5 +54,4 @@ AIO_retreatMapCMD = |
100 | 54 | ["AIO_MAP_MOUNT_singleClick", "onMapSingleClick", {_this spawn AIO_retreatMapCMD}, _this] call BIS_fnc_addStackedEventHandler; |
101 | 55 |
|
102 | 56 | waitUntil {!(visibleMap)}; |
103 | | -AIO_MAP_EMPTY_VEHICLES_MODE = false; |
104 | 57 | ["AIO_MAP_MOUNT_singleClick", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler; |
0 commit comments