From fa2acfbb502310e1fbedabc3c300c19867e559e9 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 17 Jan 2015 22:49:06 +0100 Subject: [PATCH] vector FOS mode --- addons/vector/XEH_preInit.sqf | 13 +- .../functions/{fnc_abort.sqf => _abort.sqf} | 0 .../functions/{fnc_config.sqf => _config.sqf} | 0 .../{fnc_convertFOS.sqf => _convertFOS.sqf} | 0 .../{fnc_settings.sqf => _settings.sqf} | 0 ...c_tabAzimuthKey.sqf => _tabAzimuthKey.sqf} | 0 ...tabDistanceKey.sqf => _tabDistanceKey.sqf} | 0 addons/vector/functions/fnc_clearDisplay.sqf | 32 +-- .../functions/fnc_convertToTexturesFOS.sqf | 239 ++++++++++++++++++ .../vector/functions/fnc_getFallOfShort.sqf | 26 ++ .../vector/functions/fnc_modeFallOfShort.sqf | 104 -------- .../fnc_modeRelativeDistanceHeight.sqf | 68 ----- addons/vector/functions/fnc_onKeyDown.sqf | 21 +- addons/vector/functions/fnc_onKeyHold.sqf | 12 +- addons/vector/functions/fnc_onKeyUp.sqf | 2 + .../vector/functions/fnc_showFallOfShort.sqf | 135 +++------- addons/vector/rsc/_debug_crosshair.paa | Bin 1522 -> 0 bytes .../rsc/{doo.paa => _vector_degree.paa} | Bin addons/vector/rsc/{di.paa => _vector_i.paa} | Bin addons/vector/rsc/{dq.paa => _vector_q.paa} | Bin addons/vector/rsc/{dt.paa => _vector_t.paa} | Bin addons/vector/rsc/{dL.paa => vector_l.paa} | Bin addons/vector/rsc/{dn.paa => vector_n.paa} | Bin addons/vector/rsc/{dr.paa => vector_r.paa} | Bin addons/vector/rsc/{dU.paa => vector_u.paa} | Bin 25 files changed, 348 insertions(+), 304 deletions(-) rename addons/vector/functions/{fnc_abort.sqf => _abort.sqf} (100%) rename addons/vector/functions/{fnc_config.sqf => _config.sqf} (100%) rename addons/vector/functions/{fnc_convertFOS.sqf => _convertFOS.sqf} (100%) rename addons/vector/functions/{fnc_settings.sqf => _settings.sqf} (100%) rename addons/vector/functions/{fnc_tabAzimuthKey.sqf => _tabAzimuthKey.sqf} (100%) rename addons/vector/functions/{fnc_tabDistanceKey.sqf => _tabDistanceKey.sqf} (100%) create mode 100644 addons/vector/functions/fnc_convertToTexturesFOS.sqf create mode 100644 addons/vector/functions/fnc_getFallOfShort.sqf delete mode 100644 addons/vector/functions/fnc_modeFallOfShort.sqf delete mode 100644 addons/vector/functions/fnc_modeRelativeDistanceHeight.sqf delete mode 100644 addons/vector/rsc/_debug_crosshair.paa rename addons/vector/rsc/{doo.paa => _vector_degree.paa} (100%) rename addons/vector/rsc/{di.paa => _vector_i.paa} (100%) rename addons/vector/rsc/{dq.paa => _vector_q.paa} (100%) rename addons/vector/rsc/{dt.paa => _vector_t.paa} (100%) rename addons/vector/rsc/{dL.paa => vector_l.paa} (100%) rename addons/vector/rsc/{dn.paa => vector_n.paa} (100%) rename addons/vector/rsc/{dr.paa => vector_r.paa} (100%) rename addons/vector/rsc/{dU.paa => vector_u.paa} (100%) diff --git a/addons/vector/XEH_preInit.sqf b/addons/vector/XEH_preInit.sqf index 8844749fb0..ed020c4913 100644 --- a/addons/vector/XEH_preInit.sqf +++ b/addons/vector/XEH_preInit.sqf @@ -1,30 +1,21 @@ #include "script_component.hpp" -PREP(abort); -PREP(config); -PREP(convertFOS); -PREP(settings); -PREP(tabAzimuthKey); -PREP(tabDistanceKey); -///// - PREP(clearDisplay); PREP(convertToTexturesDegree); PREP(convertToTexturesDistance); +PREP(convertToTexturesFOS); PREP(showCenter); PREP(showP1); - PREP(onKeyDown); PREP(onKeyHold); PREP(onKeyUp); - PREP(getDirection); PREP(getDistance); PREP(getHeightDistance); PREP(getRelativeAzimuthDistance); PREP(getRelativeDistance); PREP(getRelativeHeightLength); - +PREP(getFallOfShort); PREP(showAzimuth); PREP(showAzimuthInclination); PREP(showHeightDistance); diff --git a/addons/vector/functions/fnc_abort.sqf b/addons/vector/functions/_abort.sqf similarity index 100% rename from addons/vector/functions/fnc_abort.sqf rename to addons/vector/functions/_abort.sqf diff --git a/addons/vector/functions/fnc_config.sqf b/addons/vector/functions/_config.sqf similarity index 100% rename from addons/vector/functions/fnc_config.sqf rename to addons/vector/functions/_config.sqf diff --git a/addons/vector/functions/fnc_convertFOS.sqf b/addons/vector/functions/_convertFOS.sqf similarity index 100% rename from addons/vector/functions/fnc_convertFOS.sqf rename to addons/vector/functions/_convertFOS.sqf diff --git a/addons/vector/functions/fnc_settings.sqf b/addons/vector/functions/_settings.sqf similarity index 100% rename from addons/vector/functions/fnc_settings.sqf rename to addons/vector/functions/_settings.sqf diff --git a/addons/vector/functions/fnc_tabAzimuthKey.sqf b/addons/vector/functions/_tabAzimuthKey.sqf similarity index 100% rename from addons/vector/functions/fnc_tabAzimuthKey.sqf rename to addons/vector/functions/_tabAzimuthKey.sqf diff --git a/addons/vector/functions/fnc_tabDistanceKey.sqf b/addons/vector/functions/_tabDistanceKey.sqf similarity index 100% rename from addons/vector/functions/fnc_tabDistanceKey.sqf rename to addons/vector/functions/_tabDistanceKey.sqf diff --git a/addons/vector/functions/fnc_clearDisplay.sqf b/addons/vector/functions/fnc_clearDisplay.sqf index 5a42461cb7..81c919a8ca 100644 --- a/addons/vector/functions/fnc_clearDisplay.sqf +++ b/addons/vector/functions/fnc_clearDisplay.sqf @@ -14,30 +14,18 @@ _dlgVector = GETUVAR(ACE_dlgVector,displayNull); switch (_this select 0) do { case ("azimuth"): { - private ["_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8"]; - - _ctrlDigit5 = _dlgVector displayCtrl 1315; - _ctrlDigit6 = _dlgVector displayCtrl 1316; - _ctrlDigit7 = _dlgVector displayCtrl 1317; - _ctrlDigit8 = _dlgVector displayCtrl 1318; - - _ctrlDigit5 ctrlSetText ""; - _ctrlDigit6 ctrlSetText ""; - _ctrlDigit7 ctrlSetText ""; - _ctrlDigit8 ctrlSetText ""; + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText ""; + (_dlgVector displayCtrl 1317) ctrlSetText ""; + (_dlgVector displayCtrl 1318) ctrlSetText ""; + (_dlgVector displayCtrl 1319) ctrlSetText ""; }; case ("distance"): { - private ["_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4"]; - - _ctrlDigit1 = _dlgVector displayCtrl 1311; - _ctrlDigit2 = _dlgVector displayCtrl 1312; - _ctrlDigit3 = _dlgVector displayCtrl 1313; - _ctrlDigit4 = _dlgVector displayCtrl 1314; - - _ctrlDigit1 ctrlSetText ""; - _ctrlDigit2 ctrlSetText ""; - _ctrlDigit3 ctrlSetText ""; - _ctrlDigit4 ctrlSetText ""; + (_dlgVector displayCtrl 1310) ctrlSetText ""; + (_dlgVector displayCtrl 1311) ctrlSetText ""; + (_dlgVector displayCtrl 1312) ctrlSetText ""; + (_dlgVector displayCtrl 1313) ctrlSetText ""; + (_dlgVector displayCtrl 1314) ctrlSetText ""; }; }; diff --git a/addons/vector/functions/fnc_convertToTexturesFOS.sqf b/addons/vector/functions/fnc_convertToTexturesFOS.sqf new file mode 100644 index 0000000000..79fe40962f --- /dev/null +++ b/addons/vector/functions/fnc_convertToTexturesFOS.sqf @@ -0,0 +1,239 @@ +/* by commy2 + +converts rangefinder distance into array of textures for the vectors scripted info control + +*/ + +#include "script_component.hpp" + +private ["_number", "_coordinate", "_isNegative"]; + +_number = _this select 0; +_coordinate = _this select 1; + +_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 +}; + +private ["_digit0", "_digit1", "_digit2", "_digit3", "_digit4"]; + +_digit0 = ""; +_digit1 = floor (_number / 1000); +_digit2 = floor (_number / 100) - _digit1 * 10; +_digit3 = floor (_number / 10) - _digit1 * 100 - _digit2 * 10; +_digit4 = _number mod 10; + +switch (_coordinate) do { + case 0 : { + + if (_isNegative) then { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit3 = ""; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + + } else { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_a.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit3 = ""; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_a.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_a.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + }; + + }; + + case 1 : { + + if (_isNegative) then { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_l.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit3 = ""; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_l.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_l.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + + } else { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_r.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit3 = ""; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_r.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_r.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + }; + + }; + + case 2 : { + + if (_isNegative) then { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_u.paa)); + _digit1 = QUOTE(PATHTOF(rsc\vector_p.paa)); + _digit2 = ""; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_u.paa)); + _digit1 = QUOTE(PATHTOF(rsc\vector_p.paa)); + _digit2 = ""; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_u.paa)); + _digit1 = QUOTE(PATHTOF(rsc\vector_p.paa)); + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + + } else { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = QUOTE(PATHTOF(rsc\vector_n.paa)); + _digit2 = ""; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = QUOTE(PATHTOF(rsc\vector_n.paa)); + _digit2 = ""; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = QUOTE(PATHTOF(rsc\vector_n.paa)); + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + }; + + }; +}; + +[_digit0, _digit1, _digit2, _digit3, _digit4] diff --git a/addons/vector/functions/fnc_getFallOfShort.sqf b/addons/vector/functions/fnc_getFallOfShort.sqf new file mode 100644 index 0000000000..365a41518e --- /dev/null +++ b/addons/vector/functions/fnc_getFallOfShort.sqf @@ -0,0 +1,26 @@ +// by commy2 +#include "script_component.hpp" + +private ["_distanceP1", "_directionP1", "_azimuthP1", "_inclinationP1", "_distanceP2", "_directionP2", "_azimuthP2", "_inclinationP2"]; + +_distanceP1 = GVAR(pData) select 0; +_directionP1 = GVAR(pData) select 1; +_azimuthP1 = _directionP1 select 0; +_inclinationP1 = _directionP1 select 1; + +_distanceP2 = call FUNC(getDistance); +_directionP2 = call FUNC(getDirection); +_azimuthP2 = _directionP2 select 0; +_inclinationP2 = _directionP2 select 1; + +private ["_abscissa", "_ordinate", "_applicate"]; + +_abscissa = _distanceP1 * sin (_azimuthP1 - _azimuthP2); +_ordinate = _distanceP1 * cos (_inclinationP1 - _inclinationP2) - _distanceP2 * cos (_azimuthP1 - _azimuthP2); +_applicate = (sin _inclinationP2 * _distanceP2) - (sin _inclinationP1 * _distanceP1); + +if (_distanceP1 < -999 || {_distanceP2 < -999}) exitWith { + [-1000, -1000, -1000] // return +}; + +[_abscissa, _ordinate, _applicate] diff --git a/addons/vector/functions/fnc_modeFallOfShort.sqf b/addons/vector/functions/fnc_modeFallOfShort.sqf deleted file mode 100644 index 5b37f24c85..0000000000 --- a/addons/vector/functions/fnc_modeFallOfShort.sqf +++ /dev/null @@ -1,104 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private["_dlgVector", "_ctrlVectorCenter", "_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4", "_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8", "_ctrlDigit9", "_ctrlDigitE1", "_ctrlDigitE2", "_ctrlDigitE3", "_distanceP1", "_directionP1", "_azimuthP1", "_inclinationP1", "_directionP2", "_azimuthP2", "_abscissa", "_ordinate", "_applicate", "_distanceP2", "_digits", "_inclinationP2", "_height", "_lenght", "_digits0", "_digits1", "_digits2"]; - -disableSerialization; -_dlgVector = uiNamespace getVariable "AGM_dlgVector"; -_ctrlVectorCenter = _dlgVector displayCtrl 1; -_ctrlDigit0 = _dlgVector displayCtrl 10; -_ctrlDigit1 = _dlgVector displayCtrl 11; -_ctrlDigit2 = _dlgVector displayCtrl 12; -_ctrlDigit3 = _dlgVector displayCtrl 13; -_ctrlDigit4 = _dlgVector displayCtrl 14; -_ctrlDigit5 = _dlgVector displayCtrl 15; -_ctrlDigit6 = _dlgVector displayCtrl 16; -_ctrlDigit7 = _dlgVector displayCtrl 17; -_ctrlDigit8 = _dlgVector displayCtrl 18; -_ctrlDigit9 = _dlgVector displayCtrl 19; -_ctrlDigitE1 = _dlgVector displayCtrl 21; -_ctrlDigitE2 = _dlgVector displayCtrl 22; -_ctrlDigitE3 = _dlgVector displayCtrl 23; - -_ctrlVectorCenter ctrlSetText "\AGM_Vector\rsc\Vector_Center.paa"; - -_distanceP1 = call AGM_Vector_fnc_getDistance; -_directionP1 = call AGM_Vector_fnc_getDirection; -_azimuthP1 = _directionP1 select 0; -_inclinationP1 = _directionP1 select 1; - -_ctrlDigitE1 ctrlSetText "\AGM_Vector\rsc\d1.paa"; -_ctrlDigitE2 ctrlSetText "\AGM_Vector\rsc\d-.paa"; -_ctrlDigitE3 ctrlSetText "\AGM_Vector\rsc\dP.paa"; - -waitUntil {!(AGM_vectorKey select 0)}; - -_distanceP2 = call AGM_Vector_fnc_getDistance; -_directionP2 = call AGM_Vector_fnc_getDirection; -_azimuthP2 = _directionP2 select 0; -_inclinationP2 = _directionP2 select 1; - -_abscissa = _distanceP1 * sin (_azimuthP1 - _azimuthP2); -_ordinate = _distanceP1 * cos (_inclinationP1 - _inclinationP2) - _distanceP2 * cos (_azimuthP1 - _azimuthP2); -_applicate = (sin _inclinationP2 * _distanceP2) - (sin _inclinationP1 * _distanceP1); -if (_distanceP1 == -9999 || {_distanceP2 == -9999}) then { - _abscissa = -9999; - _ordinate = -9999; - _applicate = -9999; -}; - -_digits0 = [_ordinate, 0] call AGM_Vector_fnc_convertFOS; -_digits1 = [_abscissa, 1] call AGM_Vector_fnc_convertFOS; -_digits2 = [_applicate, 2] call AGM_Vector_fnc_convertFOS; - -_ctrlVectorCenter ctrlShow false; - -_ctrlDigitE1 ctrlShow false; -_ctrlDigitE2 ctrlShow false; -_ctrlDigitE3 ctrlShow false; - -waitUntil { - _ctrlDigit0 ctrlSetText (_digits0 select 0); - _ctrlDigit1 ctrlSetText (_digits0 select 1); - _ctrlDigit2 ctrlSetText (_digits0 select 2); - _ctrlDigit3 ctrlSetText (_digits0 select 3); - _ctrlDigit4 ctrlSetText (_digits0 select 4); - _ctrlDigit5 ctrlSetText (_digits1 select 0); - _ctrlDigit6 ctrlSetText (_digits1 select 1); - _ctrlDigit7 ctrlSetText (_digits1 select 2); - _ctrlDigit8 ctrlSetText (_digits1 select 3); - _ctrlDigit9 ctrlSetText (_digits1 select 4); - - waitUntil {!(AGM_vectorKey select 1) || {AGM_vectorKey select 0}}; - waitUntil {AGM_vectorKey select 1 || {AGM_vectorKey select 0}}; - - if !(AGM_vectorKey select 0) then { - _ctrlDigit0 ctrlSetText (_digits2 select 0); - _ctrlDigit1 ctrlSetText (_digits2 select 1); - _ctrlDigit2 ctrlSetText (_digits2 select 2); - _ctrlDigit3 ctrlSetText (_digits2 select 3); - _ctrlDigit4 ctrlSetText (_digits2 select 4); - _ctrlDigit5 ctrlSetText ""; - _ctrlDigit6 ctrlSetText ""; - _ctrlDigit7 ctrlSetText ""; - _ctrlDigit8 ctrlSetText ""; - _ctrlDigit9 ctrlSetText ""; - }; - - waitUntil {!(AGM_vectorKey select 1) || {AGM_vectorKey select 0}}; - waitUntil {AGM_vectorKey select 1 || {AGM_vectorKey select 0}}; - - AGM_vectorKey select 0 -}; -_ctrlDigit0 ctrlSetText ""; -_ctrlDigit1 ctrlSetText ""; -_ctrlDigit2 ctrlSetText ""; -_ctrlDigit3 ctrlSetText ""; -_ctrlDigit4 ctrlSetText ""; -_ctrlDigit5 ctrlSetText ""; -_ctrlDigit6 ctrlSetText ""; -_ctrlDigit7 ctrlSetText ""; -_ctrlDigit8 ctrlSetText ""; -_ctrlDigit9 ctrlSetText ""; - -AGM_isVectorReady = true; diff --git a/addons/vector/functions/fnc_modeRelativeDistanceHeight.sqf b/addons/vector/functions/fnc_modeRelativeDistanceHeight.sqf deleted file mode 100644 index 0663c31473..0000000000 --- a/addons/vector/functions/fnc_modeRelativeDistanceHeight.sqf +++ /dev/null @@ -1,68 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private["_dlgVector", "_ctrlVectorCenter", "_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4", "_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8", "_ctrlDigitE1", "_ctrlDigitE2", "_ctrlDigitE3", "_distanceP1", "_directionP1", "_azimuthP1", "_inclinationP1", "_directionP2", "_azimuthP2", "_distanceP2", "_inclinationP2", "_azimuth", "_inclination", "_height", "_lenght", "_relDirection", "_relDistance", "_distance", "_digits"]; - -disableSerialization; -_dlgVector = uiNamespace getVariable "AGM_dlgVector"; -_ctrlVectorCenter = _dlgVector displayCtrl 1; -_ctrlDigit1 = _dlgVector displayCtrl 11; -_ctrlDigit2 = _dlgVector displayCtrl 12; -_ctrlDigit3 = _dlgVector displayCtrl 13; -_ctrlDigit4 = _dlgVector displayCtrl 14; -_ctrlDigit5 = _dlgVector displayCtrl 15; -_ctrlDigit6 = _dlgVector displayCtrl 16; -_ctrlDigit7 = _dlgVector displayCtrl 17; -_ctrlDigit8 = _dlgVector displayCtrl 18; -_ctrlDigitE1 = _dlgVector displayCtrl 21; -_ctrlDigitE2 = _dlgVector displayCtrl 22; -_ctrlDigitE3 = _dlgVector displayCtrl 23; - -_ctrlVectorCenter ctrlSetText "\AGM_Vector\rsc\Vector_Center.paa"; - -_distanceP1 = call AGM_Vector_fnc_getDistance; -_directionP1 = call AGM_Vector_fnc_getDirection; -_azimuthP1 = _directionP1 select 0; -_inclinationP1 = _directionP1 select 1; - -_ctrlDigitE1 ctrlSetText "\AGM_Vector\rsc\d1.paa"; -_ctrlDigitE2 ctrlSetText "\AGM_Vector\rsc\d-.paa"; -_ctrlDigitE3 ctrlSetText "\AGM_Vector\rsc\dP.paa"; - -waitUntil {!(AGM_vectorKey select 1)}; - -_distanceP2 = call AGM_Vector_fnc_getDistance; -_directionP2 = call AGM_Vector_fnc_getDirection; -_azimuthP2 = _directionP2 select 0; -_inclinationP2 = _directionP2 select 1; - -_azimuth = abs (_azimuthP1 - _azimuthP2); -_inclination = abs (_inclinationP1 - _inclinationP2); -_height = sqrt (_distanceP1^2 + _distanceP2^2 - 2 * _distanceP1 * _distanceP2 * cos _inclination); -_lenght = sqrt (_distanceP1^2 + _distanceP2^2 - 2 * _distanceP1 * _distanceP2 * cos _azimuth); -if (_inclination < 0) then {_height = -1 * _height}; - -if (_distanceP1 == -9999 || {_distanceP2 == -9999}) then { - _height = -9999; - _lenght = -9999; -}; - -_digits = _height call AGM_Vector_fnc_convertDistance; -_ctrlDigit1 ctrlSetText (_digits select 0); -_ctrlDigit2 ctrlSetText (_digits select 1); -_ctrlDigit3 ctrlSetText (_digits select 2); -_ctrlDigit4 ctrlSetText (_digits select 3); - -_digits = _lenght call AGM_Vector_fnc_convertDistance; -_ctrlDigit5 ctrlSetText (_digits select 0); -_ctrlDigit6 ctrlSetText (_digits select 1); -_ctrlDigit7 ctrlSetText (_digits select 2); -_ctrlDigit8 ctrlSetText (_digits select 3); - -_ctrlVectorCenter ctrlShow false; - -_ctrlDigitE1 ctrlShow false; -_ctrlDigitE2 ctrlShow false; -_ctrlDigitE3 ctrlShow false; - -AGM_isVectorReady = true; diff --git a/addons/vector/functions/fnc_onKeyDown.sqf b/addons/vector/functions/fnc_onKeyDown.sqf index 5db5da1b33..ec0b884ccc 100644 --- a/addons/vector/functions/fnc_onKeyDown.sqf +++ b/addons/vector/functions/fnc_onKeyDown.sqf @@ -41,7 +41,12 @@ switch (_this select 0) do { "azimuth" call _fnc_setPFH; }; } else { - "azimuth+distance" call _fnc_setPFH; + if (GETGVAR(isKeyDownDistance,false)) then { + "azimuth+distance" call _fnc_setPFH; + } else { + ["distance"] call FUNC(clearDisplay); + "azimuth" call _fnc_setPFH; + }; }; }; @@ -51,6 +56,11 @@ switch (_this select 0) do { // prevent additinal modifier input if advanced mode it set, spaghetti if (GETGVAR(isKeyDownAzimuth,false) && {GETGVAR(currentMode,"") in ["relative_azimuth+distance", "fall_of_short"]}) exitWith {}; + // toggle fos values + if (GETGVAR(currentMode,"") == "fall_of_short") exitWith { + [!(GETGVAR(FOSState,true))] call FUNC(showFallOfShort); + }; + ["distance"] call FUNC(clearDisplay); GVAR(isKeyDownDistance) = true; @@ -65,10 +75,15 @@ switch (_this select 0) do { if (diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5) then { if !(GETGVAR(isKeyDownAzimuth,false)) then { ["azimuth"] call FUNC(clearDisplay); - "distance" call _fnc_setPFH; + "distance" call _fnc_setPFH; }; } else { - "azimuth+distance" call _fnc_setPFH; + if (GETGVAR(isKeyDownAzimuth,false)) then { + "azimuth+distance" call _fnc_setPFH; + } else { + ["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 827a7a3381..dded828d26 100644 --- a/addons/vector/functions/fnc_onKeyHold.sqf +++ b/addons/vector/functions/fnc_onKeyHold.sqf @@ -10,9 +10,14 @@ PFH executed while holding a vector key down. switch (_this select 0) do { case ("azimuth"): { + private "_isReady"; + _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.2; + [false] call FUNC(showCenter); - call FUNC(showAzimuth); + if (_isReady) then { + call FUNC(showAzimuth); + }; if (!GVAR(isKeyDownAzimuth)) then { [_this select 1] call CBA_fnc_removePerFrameHandler; @@ -186,7 +191,8 @@ switch (_this select 0) do { if (!GVAR(isKeyDownAzimuth) && {!GVAR(isKeyDownDistance)}) then { if (_isReady) then { - call FUNC(showFallOfShort); + GVAR(FOSData) = call FUNC(getFallOfShort);// + [false] call FUNC(showFallOfShort); }; [false] call FUNC(showCenter); [false] call FUNC(showP1); @@ -202,4 +208,4 @@ switch (_this select 0) do { }; -systemChat str (_this select 0);// +//systemChat str (_this select 0); diff --git a/addons/vector/functions/fnc_onKeyUp.sqf b/addons/vector/functions/fnc_onKeyUp.sqf index 562f422d38..5fc2d84092 100644 --- a/addons/vector/functions/fnc_onKeyUp.sqf +++ b/addons/vector/functions/fnc_onKeyUp.sqf @@ -53,6 +53,7 @@ switch (_this select 0) do { switch (GVAR(currentMode)) do { case ("azimuth"): { + ["azimuth"] call FUNC(clearDisplay); ["distance"] call FUNC(clearDisplay); [true] call FUNC(showP1); GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)]; @@ -60,6 +61,7 @@ switch (_this select 0) do { }; case ("azimuth+inclination"): { + ["azimuth"] call FUNC(clearDisplay); ["distance"] call FUNC(clearDisplay); [true] call FUNC(showP1); GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)]; diff --git a/addons/vector/functions/fnc_showFallOfShort.sqf b/addons/vector/functions/fnc_showFallOfShort.sqf index 12fa004246..0f2040708e 100644 --- a/addons/vector/functions/fnc_showFallOfShort.sqf +++ b/addons/vector/functions/fnc_showFallOfShort.sqf @@ -1,106 +1,55 @@ // by commy2 #include "script_component.hpp" -if (true) exitWith {}; +GVAR(FOSState) = _this select 0; -private["_dlgVector", "_ctrlVectorCenter", "_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4", "_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8", "_ctrlDigit9", "_ctrlDigitE1", "_ctrlDigitE2", "_ctrlDigitE3", "_distanceP1", "_directionP1", "_azimuthP1", "_inclinationP1", "_directionP2", "_azimuthP2", "_abscissa", "_ordinate", "_applicate", "_distanceP2", "_digits", "_inclinationP2", "_height", "_lenght", "_digits0", "_digits1", "_digits2"]; +private "_dlgVector"; disableSerialization; -_dlgVector = uiNamespace getVariable "AGM_dlgVector"; -_ctrlVectorCenter = _dlgVector displayCtrl 1; -_ctrlDigit0 = _dlgVector displayCtrl 10; -_ctrlDigit1 = _dlgVector displayCtrl 11; -_ctrlDigit2 = _dlgVector displayCtrl 12; -_ctrlDigit3 = _dlgVector displayCtrl 13; -_ctrlDigit4 = _dlgVector displayCtrl 14; -_ctrlDigit5 = _dlgVector displayCtrl 15; -_ctrlDigit6 = _dlgVector displayCtrl 16; -_ctrlDigit7 = _dlgVector displayCtrl 17; -_ctrlDigit8 = _dlgVector displayCtrl 18; -_ctrlDigit9 = _dlgVector displayCtrl 19; -_ctrlDigitE1 = _dlgVector displayCtrl 21; -_ctrlDigitE2 = _dlgVector displayCtrl 22; -_ctrlDigitE3 = _dlgVector displayCtrl 23; +_dlgVector = GETUVAR(ACE_dlgVector,displayNull); -_ctrlVectorCenter ctrlSetText "\AGM_Vector\rsc\Vector_Center.paa"; +private "_fosData"; -_distanceP1 = call AGM_Vector_fnc_getDistance; -_directionP1 = call AGM_Vector_fnc_getDirection; -_azimuthP1 = _directionP1 select 0; -_inclinationP1 = _directionP1 select 1; +_fosData = GVAR(FOSData); -_ctrlDigitE1 ctrlSetText "\AGM_Vector\rsc\d1.paa"; -_ctrlDigitE2 ctrlSetText "\AGM_Vector\rsc\d-.paa"; -_ctrlDigitE3 ctrlSetText "\AGM_Vector\rsc\dP.paa"; +if !(_this select 0) then { + private "_digits"; -waitUntil {!(AGM_vectorKey select 0)}; + // of abscissa + _digits = [_fosData, 0] call FUNC(convertToTexturesFOS); -_distanceP2 = call AGM_Vector_fnc_getDistance; -_directionP2 = call AGM_Vector_fnc_getDirection; -_azimuthP2 = _directionP2 select 0; -_inclinationP2 = _directionP2 select 1; + (_dlgVector displayCtrl 1310) ctrlSetText (_digits select 0); + (_dlgVector displayCtrl 1311) ctrlSetText (_digits select 1); + (_dlgVector displayCtrl 1312) ctrlSetText (_digits select 2); + (_dlgVector displayCtrl 1313) ctrlSetText (_digits select 3); + (_dlgVector displayCtrl 1314) ctrlSetText (_digits select 4); + + // of ordinate + _digits = [_fosData, 1] call FUNC(convertToTexturesFOS); + + (_dlgVector displayCtrl 1315) ctrlSetText (_digits select 0); + (_dlgVector displayCtrl 1316) ctrlSetText (_digits select 1); + (_dlgVector displayCtrl 1317) ctrlSetText (_digits select 2); + (_dlgVector displayCtrl 1318) ctrlSetText (_digits select 3); + (_dlgVector displayCtrl 1319) ctrlSetText (_digits select 4); + +} else { + private "_digits"; + + // applicate + _digits = [_fosData, 2] call FUNC(convertToTexturesFOS); + + (_dlgVector displayCtrl 1310) ctrlSetText (_digits select 0); + (_dlgVector displayCtrl 1311) ctrlSetText (_digits select 1); + (_dlgVector displayCtrl 1312) ctrlSetText (_digits select 2); + (_dlgVector displayCtrl 1313) ctrlSetText (_digits select 3); + (_dlgVector displayCtrl 1314) ctrlSetText (_digits select 4); + + // nothing + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText ""; + (_dlgVector displayCtrl 1317) ctrlSetText ""; + (_dlgVector displayCtrl 1318) ctrlSetText ""; + (_dlgVector displayCtrl 1319) ctrlSetText ""; -_abscissa = _distanceP1 * sin (_azimuthP1 - _azimuthP2); -_ordinate = _distanceP1 * cos (_inclinationP1 - _inclinationP2) - _distanceP2 * cos (_azimuthP1 - _azimuthP2); -_applicate = (sin _inclinationP2 * _distanceP2) - (sin _inclinationP1 * _distanceP1); -if (_distanceP1 == -9999 || {_distanceP2 == -9999}) then { - _abscissa = -9999; - _ordinate = -9999; - _applicate = -9999; }; - -_digits0 = [_ordinate, 0] call AGM_Vector_fnc_convertFOS; -_digits1 = [_abscissa, 1] call AGM_Vector_fnc_convertFOS; -_digits2 = [_applicate, 2] call AGM_Vector_fnc_convertFOS; - -_ctrlVectorCenter ctrlShow false; - -_ctrlDigitE1 ctrlShow false; -_ctrlDigitE2 ctrlShow false; -_ctrlDigitE3 ctrlShow false; - -waitUntil { - _ctrlDigit0 ctrlSetText (_digits0 select 0); - _ctrlDigit1 ctrlSetText (_digits0 select 1); - _ctrlDigit2 ctrlSetText (_digits0 select 2); - _ctrlDigit3 ctrlSetText (_digits0 select 3); - _ctrlDigit4 ctrlSetText (_digits0 select 4); - _ctrlDigit5 ctrlSetText (_digits1 select 0); - _ctrlDigit6 ctrlSetText (_digits1 select 1); - _ctrlDigit7 ctrlSetText (_digits1 select 2); - _ctrlDigit8 ctrlSetText (_digits1 select 3); - _ctrlDigit9 ctrlSetText (_digits1 select 4); - - waitUntil {!(AGM_vectorKey select 1) || {AGM_vectorKey select 0}}; - waitUntil {AGM_vectorKey select 1 || {AGM_vectorKey select 0}}; - - if !(AGM_vectorKey select 0) then { - _ctrlDigit0 ctrlSetText (_digits2 select 0); - _ctrlDigit1 ctrlSetText (_digits2 select 1); - _ctrlDigit2 ctrlSetText (_digits2 select 2); - _ctrlDigit3 ctrlSetText (_digits2 select 3); - _ctrlDigit4 ctrlSetText (_digits2 select 4); - _ctrlDigit5 ctrlSetText ""; - _ctrlDigit6 ctrlSetText ""; - _ctrlDigit7 ctrlSetText ""; - _ctrlDigit8 ctrlSetText ""; - _ctrlDigit9 ctrlSetText ""; - }; - - waitUntil {!(AGM_vectorKey select 1) || {AGM_vectorKey select 0}}; - waitUntil {AGM_vectorKey select 1 || {AGM_vectorKey select 0}}; - - AGM_vectorKey select 0 -}; -_ctrlDigit0 ctrlSetText ""; -_ctrlDigit1 ctrlSetText ""; -_ctrlDigit2 ctrlSetText ""; -_ctrlDigit3 ctrlSetText ""; -_ctrlDigit4 ctrlSetText ""; -_ctrlDigit5 ctrlSetText ""; -_ctrlDigit6 ctrlSetText ""; -_ctrlDigit7 ctrlSetText ""; -_ctrlDigit8 ctrlSetText ""; -_ctrlDigit9 ctrlSetText ""; - -AGM_isVectorReady = true; diff --git a/addons/vector/rsc/_debug_crosshair.paa b/addons/vector/rsc/_debug_crosshair.paa deleted file mode 100644 index cce3aa8f4a6b70b6c39ce71d931c661f35d24c51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1522 zcmZSm@9ypx;_M#g$il$D@c;jRZZJQ>(HF`G%ey=JxPkbLKn#)(c60N00J0l^xE(0b z$I8HP6^Ka(3JeMi3?QQ+0O)}KFgA!D<>LsCf1uD|dH@d}5TCJtX5sap!E=&|=OnoK zK>h?4PelCuXYgoJ@nC|>Gl1Rq0l^137YN|)g>Z@H|7YNw0JL8PrXQF{fc8&dLE<;4 z0G$BiGyLPH$Udm^aJmoTe`NOnEk|-6A^oHBkPv{ymjHtRq;x?QrZkuu_HWCT-j=8U zv!;IkHs0GCWDmgjgv@W)&z1z#e;cO0VLv0!?G3qbJ|X?2%5yMqFgP$U6o7Nv90{1U oV7?!dI)dLh@d#3CD_|&igq-?VfF&w0Jarg6g%lVOi4@`*0PZE8NB{r; diff --git a/addons/vector/rsc/doo.paa b/addons/vector/rsc/_vector_degree.paa similarity index 100% rename from addons/vector/rsc/doo.paa rename to addons/vector/rsc/_vector_degree.paa diff --git a/addons/vector/rsc/di.paa b/addons/vector/rsc/_vector_i.paa similarity index 100% rename from addons/vector/rsc/di.paa rename to addons/vector/rsc/_vector_i.paa diff --git a/addons/vector/rsc/dq.paa b/addons/vector/rsc/_vector_q.paa similarity index 100% rename from addons/vector/rsc/dq.paa rename to addons/vector/rsc/_vector_q.paa diff --git a/addons/vector/rsc/dt.paa b/addons/vector/rsc/_vector_t.paa similarity index 100% rename from addons/vector/rsc/dt.paa rename to addons/vector/rsc/_vector_t.paa diff --git a/addons/vector/rsc/dL.paa b/addons/vector/rsc/vector_l.paa similarity index 100% rename from addons/vector/rsc/dL.paa rename to addons/vector/rsc/vector_l.paa diff --git a/addons/vector/rsc/dn.paa b/addons/vector/rsc/vector_n.paa similarity index 100% rename from addons/vector/rsc/dn.paa rename to addons/vector/rsc/vector_n.paa diff --git a/addons/vector/rsc/dr.paa b/addons/vector/rsc/vector_r.paa similarity index 100% rename from addons/vector/rsc/dr.paa rename to addons/vector/rsc/vector_r.paa diff --git a/addons/vector/rsc/dU.paa b/addons/vector/rsc/vector_u.paa similarity index 100% rename from addons/vector/rsc/dU.paa rename to addons/vector/rsc/vector_u.paa