2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-15 06:18:57 +00:00
|
|
|
/*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Author: commy2
|
|
|
|
* Handles releasing the special vector keys.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: String <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* ["5"] call ace_vector_fnc_onKeyUp
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-15 06:18:57 +00:00
|
|
|
|
2016-09-04 14:44:22 +00:00
|
|
|
private _fnc_setPFH = {
|
2015-01-16 00:48:43 +00:00
|
|
|
if (GVAR(holdKeyHandler) > -1) then {
|
|
|
|
[GVAR(holdKeyHandler)] call CBA_fnc_removePerFrameHandler;
|
|
|
|
GVAR(holdKeyHandler) = -1;
|
|
|
|
};
|
|
|
|
|
|
|
|
GVAR(currentMode) = _this;//
|
|
|
|
GVAR(holdKeyHandler) = [FUNC(onKeyHold), 0, _this] call CBA_fnc_addPerFrameHandler;
|
|
|
|
};
|
|
|
|
|
2015-01-15 06:18:57 +00:00
|
|
|
switch (_this select 0) do {
|
|
|
|
case ("azimuth"): {
|
|
|
|
|
|
|
|
GVAR(isKeyDownAzimuth) = false;
|
|
|
|
|
2015-01-16 00:48:43 +00:00
|
|
|
if (GVAR(isKeyDownDistance)) then {
|
2015-01-17 18:25:12 +00:00
|
|
|
|
|
|
|
switch (GVAR(currentMode)) do {
|
|
|
|
case ("distance"): {
|
|
|
|
["azimuth"] call FUNC(clearDisplay);
|
|
|
|
[true] call FUNC(showP1);
|
|
|
|
GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)];
|
|
|
|
"relative_distance" call _fnc_setPFH;
|
|
|
|
};
|
|
|
|
|
|
|
|
case ("height+distance"): {
|
|
|
|
["azimuth"] call FUNC(clearDisplay);
|
|
|
|
[true] call FUNC(showP1);
|
|
|
|
GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)];
|
|
|
|
"relative_height+length" call _fnc_setPFH;
|
|
|
|
};
|
2015-01-16 00:48:43 +00:00
|
|
|
};
|
2015-01-17 18:25:12 +00:00
|
|
|
|
2015-01-16 00:48:43 +00:00
|
|
|
};
|
|
|
|
|
2015-01-15 06:18:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
case ("distance"): {
|
|
|
|
|
|
|
|
GVAR(isKeyDownDistance) = false;
|
|
|
|
|
2015-01-16 00:48:43 +00:00
|
|
|
if (GVAR(isKeyDownAzimuth)) then {
|
2015-01-17 18:25:12 +00:00
|
|
|
|
|
|
|
switch (GVAR(currentMode)) do {
|
|
|
|
case ("azimuth"): {
|
2015-01-17 21:49:06 +00:00
|
|
|
["azimuth"] call FUNC(clearDisplay);
|
2015-01-17 18:25:12 +00:00
|
|
|
["distance"] call FUNC(clearDisplay);
|
|
|
|
[true] call FUNC(showP1);
|
|
|
|
GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)];
|
|
|
|
"relative_azimuth+distance" call _fnc_setPFH;
|
|
|
|
};
|
|
|
|
|
|
|
|
case ("azimuth+inclination"): {
|
2015-01-17 21:49:06 +00:00
|
|
|
["azimuth"] call FUNC(clearDisplay);
|
2015-01-17 18:25:12 +00:00
|
|
|
["distance"] call FUNC(clearDisplay);
|
|
|
|
[true] call FUNC(showP1);
|
|
|
|
GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)];
|
2015-04-05 20:18:28 +00:00
|
|
|
"fall_of_shot" call _fnc_setPFH;
|
2015-01-17 18:25:12 +00:00
|
|
|
};
|
2015-01-16 00:48:43 +00:00
|
|
|
};
|
2015-01-17 18:25:12 +00:00
|
|
|
|
2015-01-16 00:48:43 +00:00
|
|
|
};
|
|
|
|
|
2015-01-15 06:18:57 +00:00
|
|
|
};
|
|
|
|
};
|