vector azimuth+inclination mode

This commit is contained in:
commy2 2015-01-15 16:40:06 +01:00
parent 79426252a1
commit 3e9785e145
4 changed files with 67 additions and 2 deletions

View File

@ -22,6 +22,7 @@ PREP(onKeyDown);
PREP(onKeyHold); PREP(onKeyHold);
PREP(onKeyUp); PREP(onKeyUp);
PREP(showAzimuth); PREP(showAzimuth);
PREP(showAzimuthInclination);
PREP(showCenter); PREP(showCenter);
PREP(showDistance); PREP(showDistance);

View File

@ -20,10 +20,16 @@ _fnc_setPFH = {
switch (_this select 0) do { switch (_this select 0) do {
case ("azimuth"): { case ("azimuth"): {
["azimuth"] call FUNC(clearDisplay);
GVAR(isKeyDownAzimuth) = true; GVAR(isKeyDownAzimuth) = true;
if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) exitWith {
"azimuth+inclination" call _fnc_setPFH;
};
GVAR(keyDownTimeAzimuth) = diag_tickTime; GVAR(keyDownTimeAzimuth) = diag_tickTime;
["azimuth"] call FUNC(clearDisplay);
if (diag_tickTime > GVAR(keyDownTimeDistance) + 0.5) then { if (diag_tickTime > GVAR(keyDownTimeDistance) + 0.5) then {
["distance"] call FUNC(clearDisplay); ["distance"] call FUNC(clearDisplay);
"azimuth" call _fnc_setPFH; "azimuth" call _fnc_setPFH;
@ -35,10 +41,16 @@ switch (_this select 0) do {
case ("distance"): { case ("distance"): {
["distance"] call FUNC(clearDisplay);
GVAR(isKeyDownDistance) = true; GVAR(isKeyDownDistance) = true;
if (diag_tickTime < GVAR(keyDownTimeDistance) + 0.5) exitWith {
//"azimuth+inclination" call _fnc_setPFH;
};
GVAR(keyDownTimeDistance) = diag_tickTime; GVAR(keyDownTimeDistance) = diag_tickTime;
["distance"] call FUNC(clearDisplay);
if (diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5) then { if (diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5) then {
["azimuth"] call FUNC(clearDisplay); ["azimuth"] call FUNC(clearDisplay);
"distance" call _fnc_setPFH; "distance" call _fnc_setPFH;

View File

@ -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);// systemChat str (_this select 0);//

View File

@ -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);