ACE3/addons/vector/functions/fnc_onKeyUp.sqf

84 lines
2.3 KiB
Plaintext
Raw Normal View History

2015-01-15 06:18:57 +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
#include "script_component.hpp"
private _fnc_setPFH = {
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;
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-17 18:25:12 +00:00
};
2015-01-15 06:18:57 +00:00
};
case ("distance"): {
GVAR(isKeyDownDistance) = false;
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-17 18:25:12 +00:00
};
2015-01-15 06:18:57 +00:00
};
};