|
3 | 3 | // Create a dictionary to store detector configs |
4 | 4 | GVAR(detectorConfigs) = createHashMap; |
5 | 5 |
|
6 | | -[QGVAR(enableDetector), LINKFUNC(enableDetector)] call CBA_fnc_addEventHandler; |
7 | | -[QGVAR(disableDetector), LINKFUNC(disableDetector)] call CBA_fnc_addEventHandler; |
8 | | - |
9 | 6 | // Shows detector and mine posistions in 3d when debug is on |
10 | 7 | #ifdef DEBUG_MODE_FULL |
11 | 8 | GVAR(debugDetector) = []; |
| 9 | + |
12 | 10 | addMissionEventHandler ["Draw3D", { |
13 | 11 | if (GVAR(debugDetector) isEqualTo []) exitWith {}; |
| 12 | + |
14 | 13 | GVAR(debugDetector) params ["_detectorPointAGL", "_mines"]; |
15 | | - drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [0,0,1,1], _detectorPointAGL, 1, 1, 0, "detector", 1, 0.02, "PuristaMedium"]; |
| 14 | + |
| 15 | + drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [0, 0, 1, 1], _detectorPointAGL, 1, 1, 0, "detector", 1, 0.02, "PuristaMedium"]; |
| 16 | + |
16 | 17 | { |
17 | 18 | private _name = format ["%1@%2", typeOf _x, (floor ((_x distance _detectorPointAGL) * 10)) / 10]; |
18 | | - if ((getNumber (configOf _x >> QGVAR(detectable))) == 1) then { |
19 | | - drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [1,0,0,1], (ASLToAGL (getPosASL _x)), 1, 1, 0, _name, 1, 0.02, "PuristaMedium"]; |
20 | | - } else { |
21 | | - drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [1,1,0,1], (ASLToAGL (getPosASL _x)), 1, 1, 0, _name, 1, 0.02, "PuristaMedium"]; |
22 | | - }; |
| 19 | + |
| 20 | + drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [[1, 1, 0, 1], [1, 0, 0, 1]] select (getNumber (configOf _x >> QGVAR(detectable)) == 1), ASLToAGL (getPosASL _x), 1, 1, 0, _name, 1, 0.02, "PuristaMedium"]; |
23 | 21 | } forEach _mines; |
24 | 22 | }]; |
25 | 23 | #endif |
0 commit comments