diff --git a/addons/vector/XEH_preInit.sqf b/addons/vector/XEH_preInit.sqf index a324ac7279..5be4f38e3f 100644 --- a/addons/vector/XEH_preInit.sqf +++ b/addons/vector/XEH_preInit.sqf @@ -22,6 +22,7 @@ PREP(onKeyDown); PREP(onKeyHold); PREP(onKeyUp); PREP(showAzimuth); +PREP(showAzimuthInclination); PREP(showCenter); PREP(showDistance); diff --git a/addons/vector/functions/fnc_onKeyDown.sqf b/addons/vector/functions/fnc_onKeyDown.sqf index 12be8a8673..6630576069 100644 --- a/addons/vector/functions/fnc_onKeyDown.sqf +++ b/addons/vector/functions/fnc_onKeyDown.sqf @@ -20,10 +20,16 @@ _fnc_setPFH = { switch (_this select 0) do { case ("azimuth"): { + ["azimuth"] call FUNC(clearDisplay); + GVAR(isKeyDownAzimuth) = true; + + if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) exitWith { + "azimuth+inclination" call _fnc_setPFH; + }; + GVAR(keyDownTimeAzimuth) = diag_tickTime; - ["azimuth"] call FUNC(clearDisplay); if (diag_tickTime > GVAR(keyDownTimeDistance) + 0.5) then { ["distance"] call FUNC(clearDisplay); "azimuth" call _fnc_setPFH; @@ -35,10 +41,16 @@ switch (_this select 0) do { case ("distance"): { + ["distance"] call FUNC(clearDisplay); + GVAR(isKeyDownDistance) = true; + + if (diag_tickTime < GVAR(keyDownTimeDistance) + 0.5) exitWith { + //"azimuth+inclination" call _fnc_setPFH; + }; + GVAR(keyDownTimeDistance) = diag_tickTime; - ["distance"] call FUNC(clearDisplay); if (diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5) then { ["azimuth"] call FUNC(clearDisplay); "distance" call _fnc_setPFH; diff --git a/addons/vector/functions/fnc_onKeyHold.sqf b/addons/vector/functions/fnc_onKeyHold.sqf index b20e2fee72..d5043fc40b 100644 --- a/addons/vector/functions/fnc_onKeyHold.sqf +++ b/addons/vector/functions/fnc_onKeyHold.sqf @@ -67,6 +67,22 @@ switch (_this select 0) do { }; }; + + case ("azimuth+inclination"): { + + [false] call FUNC(showCenter); + + call FUNC(showAzimuthInclination); + + if (!GVAR(isKeyDownAzimuth)) then { + [_this select 1] call CBA_fnc_removePerFrameHandler; + + if (GVAR(holdKeyHandler) > -1) then { + GVAR(holdKeyHandler) = -1; + }; + }; + + }; }; systemChat str (_this select 0);// diff --git a/addons/vector/functions/fnc_showAzimuthInclination.sqf b/addons/vector/functions/fnc_showAzimuthInclination.sqf new file mode 100644 index 0000000000..207927f8ac --- /dev/null +++ b/addons/vector/functions/fnc_showAzimuthInclination.sqf @@ -0,0 +1,36 @@ +// by commy2 +#include "script_component.hpp" + +private ["_dlgVector", "_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4", "_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8"]; + +disableSerialization; +_dlgVector = GETUVAR(ACE_dlgVector,displayNull); + +_ctrlDigit1 = _dlgVector displayCtrl 1311; +_ctrlDigit2 = _dlgVector displayCtrl 1312; +_ctrlDigit3 = _dlgVector displayCtrl 1313; +_ctrlDigit4 = _dlgVector displayCtrl 1314; +_ctrlDigit5 = _dlgVector displayCtrl 1315; +_ctrlDigit6 = _dlgVector displayCtrl 1316; +_ctrlDigit7 = _dlgVector displayCtrl 1317; +_ctrlDigit8 = _dlgVector displayCtrl 1318; + +private ["_direction", "_digits"]; + +_direction = call FUNC(getDirection); + +// azimuth +_digits = [_direction select 0] call FUNC(convertToTexturesDegree); + +_ctrlDigit5 ctrlSetText (_digits select 0); +_ctrlDigit6 ctrlSetText (_digits select 1); +_ctrlDigit7 ctrlSetText (_digits select 2); +_ctrlDigit8 ctrlSetText (_digits select 3); + +// inclination +_digits = [_direction select 1] call FUNC(convertToTexturesDegree); + +_ctrlDigit1 ctrlSetText (_digits select 0); +_ctrlDigit2 ctrlSetText (_digits select 1); +_ctrlDigit3 ctrlSetText (_digits select 2); +_ctrlDigit4 ctrlSetText (_digits select 3);