vector: fix potential error in FOS, prep settings, config

This commit is contained in:
commy2 2015-01-20 18:26:31 +01:00
parent 65e12745d6
commit 9d687b9b3e
3 changed files with 39 additions and 3 deletions

View File

@ -15,8 +15,8 @@ _number = round (_number select _coordinate);
_isNegative = _number < 0;
_number = abs _number;
if (_number >= 10000) exitWith {
[QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa))] // return
if (_number > 9999) exitWith {
[QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa))] // return
};
private ["_digit0", "_digit1", "_digit2", "_digit3", "_digit4"];
@ -236,4 +236,9 @@ switch (_coordinate) do {
};
};
// trap errors
if ({typeName _x == "STRING"} count [_digit0, _digit1, _digit2, _digit3, _digit4] < 5) exitWith {
[QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa))] // return
};
[_digit0, _digit1, _digit2, _digit3, _digit4]

View File

@ -29,6 +29,19 @@ switch (_this select 0) do {
GVAR(isKeyDownAzimuth) = true;
[false] call FUNC(showP1);
// handle 5 times clicking
if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) then {
GVAR(keyDownTabCountAzimuth) = (GETGVAR(keyDownTabCountAzimuth,0)) + 1;
GVAR(keyDownTimeAzimuth) = diag_tickTime;
} else {
GVAR(keyDownTabCountAzimuth) = 1;
};
// open config menu
if (GVAR(keyDownTabCountAzimuth) == 5) exitWith {
systemChat "0";
};
if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) exitWith {
"azimuth+inclination" call _fnc_setPFH;
};
@ -66,6 +79,19 @@ switch (_this select 0) do {
GVAR(isKeyDownDistance) = true;
[false] call FUNC(showP1);
// handle 5 times clicking
if (diag_tickTime < GVAR(keyDownTimeDistance) + 0.5) then {
GVAR(keyDownTabCountDistance) = (GETGVAR(keyDownTabCountDistance,0)) + 1;
GVAR(keyDownTimeDistance) = diag_tickTime;
} else {
GVAR(keyDownTabCountDistance) = 1;
};
// open config menu
if (GVAR(keyDownTabCountDistance) == 5) exitWith {
systemChat "1";
};
if (diag_tickTime < GVAR(keyDownTimeDistance) + 0.5) exitWith {
"height+distance" call _fnc_setPFH;
};

View File

@ -77,9 +77,14 @@ switch (_this select 0) do {
case ("azimuth+inclination"): {
private "_isReady";
_isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.2;
[false] call FUNC(showCenter);
if (_isReady) then {
call FUNC(showAzimuthInclination);
};
if (!GVAR(isKeyDownAzimuth)) then {
[_this select 1] call CBA_fnc_removePerFrameHandler;