From 56de4f05f38ae607c408ea4b12d8fbdb6a382b5b Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 12 Apr 2015 13:56:01 +0200 Subject: [PATCH] scripts for vector illum, renaming some files --- addons/vector/XEH_postInit.sqf | 10 +++++ addons/vector/XEH_preInit.sqf | 10 +---- .../vector/functions/fnc_adjustBrightness.sqf | 4 ++ addons/vector/functions/fnc_illuminate.sqf | 41 ++++++++++++++++++ addons/vector/functions/fnc_showAzimuth.sqf | 2 + .../functions/fnc_showAzimuthInclination.sqf | 2 + addons/vector/functions/fnc_showCenter.sqf | 2 + addons/vector/functions/fnc_showDistance.sqf | 2 + .../vector/functions/fnc_showFallOfShot.sqf | 2 + .../functions/fnc_showHeightDistance.sqf | 2 + addons/vector/functions/fnc_showP1.sqf | 2 + .../fnc_showRelativeAzimuthDistance.sqf | 2 + .../fnc_showRelativeHeightLength.sqf | 2 + addons/vector/functions/fnc_showReticle.sqf | 2 + addons/vector/functions/fnc_showText.sqf | 2 + ...tor_3_illum.paa.paa => vector_3_illum.paa} | Bin ...tor_4_illum.paa.paa => vector_4_illum.paa} | Bin ...tor_5_illum.paa.paa => vector_5_illum.paa} | Bin ...tor_6_illum.paa.paa => vector_6_illum.paa} | Bin ...tor_7_illum.paa.paa => vector_7_illum.paa} | Bin ...tor_8_illum.paa.paa => vector_8_illum.paa} | Bin ...tor_9_illum.paa.paa => vector_9_illum.paa} | Bin ...tor_a_illum.paa.paa => vector_a_illum.paa} | Bin ...tor_b_illum.paa.paa => vector_b_illum.paa} | Bin ...tor_c_illum.paa.paa => vector_c_illum.paa} | Bin ...tor_d_illum.paa.paa => vector_d_illum.paa} | Bin ..._illum.paa.paa => vector_degree_illum.paa} | Bin ...tor_e_illum.paa.paa => vector_e_illum.paa} | Bin ...tor_f_illum.paa.paa => vector_f_illum.paa} | Bin ...tor_g_illum.paa.paa => vector_g_illum.paa} | Bin ...tor_i_illum.paa.paa => vector_i_illum.paa} | Bin ...tor_l_illum.paa.paa => vector_l_illum.paa} | Bin ...s_illum.paa.paa => vector_minus_illum.paa} | Bin ...tor_n_illum.paa.paa => vector_n_illum.paa} | Bin ...tor_o_illum.paa.paa => vector_o_illum.paa} | Bin ...tor_p_illum.paa.paa => vector_p_illum.paa} | Bin ...us_illum.paa.paa => vector_plus_illum.paa} | Bin ...tor_r_illum.paa.paa => vector_r_illum.paa} | Bin ...tor_t_illum.paa.paa => vector_t_illum.paa} | Bin ...tor_u_illum.paa.paa => vector_u_illum.paa} | Bin 40 files changed, 78 insertions(+), 9 deletions(-) create mode 100644 addons/vector/functions/fnc_illuminate.sqf rename addons/vector/rsc/{vector_3_illum.paa.paa => vector_3_illum.paa} (100%) rename addons/vector/rsc/{vector_4_illum.paa.paa => vector_4_illum.paa} (100%) rename addons/vector/rsc/{vector_5_illum.paa.paa => vector_5_illum.paa} (100%) rename addons/vector/rsc/{vector_6_illum.paa.paa => vector_6_illum.paa} (100%) rename addons/vector/rsc/{vector_7_illum.paa.paa => vector_7_illum.paa} (100%) rename addons/vector/rsc/{vector_8_illum.paa.paa => vector_8_illum.paa} (100%) rename addons/vector/rsc/{vector_9_illum.paa.paa => vector_9_illum.paa} (100%) rename addons/vector/rsc/{vector_a_illum.paa.paa => vector_a_illum.paa} (100%) rename addons/vector/rsc/{vector_b_illum.paa.paa => vector_b_illum.paa} (100%) rename addons/vector/rsc/{vector_c_illum.paa.paa => vector_c_illum.paa} (100%) rename addons/vector/rsc/{vector_d_illum.paa.paa => vector_d_illum.paa} (100%) rename addons/vector/rsc/{vector_degree_illum.paa.paa => vector_degree_illum.paa} (100%) rename addons/vector/rsc/{vector_e_illum.paa.paa => vector_e_illum.paa} (100%) rename addons/vector/rsc/{vector_f_illum.paa.paa => vector_f_illum.paa} (100%) rename addons/vector/rsc/{vector_g_illum.paa.paa => vector_g_illum.paa} (100%) rename addons/vector/rsc/{vector_i_illum.paa.paa => vector_i_illum.paa} (100%) rename addons/vector/rsc/{vector_l_illum.paa.paa => vector_l_illum.paa} (100%) rename addons/vector/rsc/{vector_minus_illum.paa.paa => vector_minus_illum.paa} (100%) rename addons/vector/rsc/{vector_n_illum.paa.paa => vector_n_illum.paa} (100%) rename addons/vector/rsc/{vector_o_illum.paa.paa => vector_o_illum.paa} (100%) rename addons/vector/rsc/{vector_p_illum.paa.paa => vector_p_illum.paa} (100%) rename addons/vector/rsc/{vector_plus_illum.paa.paa => vector_plus_illum.paa} (100%) rename addons/vector/rsc/{vector_r_illum.paa.paa => vector_r_illum.paa} (100%) rename addons/vector/rsc/{vector_t_illum.paa.paa => vector_t_illum.paa} (100%) rename addons/vector/rsc/{vector_u_illum.paa.paa => vector_u_illum.paa} (100%) diff --git a/addons/vector/XEH_postInit.sqf b/addons/vector/XEH_postInit.sqf index 8bbf7d7aa6..7e1d0eac27 100644 --- a/addons/vector/XEH_postInit.sqf +++ b/addons/vector/XEH_postInit.sqf @@ -1,4 +1,14 @@ // by commy2 #include "script_component.hpp" +GVAR(holdKeyHandler) = -1; +GVAR(isKeyDownAzimuth) = false; +GVAR(isKeyDownDistance) = false; +GVAR(keyDownTimeAzimuth) = -1; +GVAR(keyDownTimeDistance) = -1; +GVAR(useMil) = false; +GVAR(useFeet) = false; +GVAR(modeReticle) = 0; +GVAR(illuminate) = false; + #include "initKeybinds.sqf" diff --git a/addons/vector/XEH_preInit.sqf b/addons/vector/XEH_preInit.sqf index fcae0f282b..f170198a15 100644 --- a/addons/vector/XEH_preInit.sqf +++ b/addons/vector/XEH_preInit.sqf @@ -31,14 +31,6 @@ PREP(showText); PREP(nextMode); PREP(adjustBrightness); PREP(showReticle); - -GVAR(holdKeyHandler) = -1; -GVAR(isKeyDownAzimuth) = false; -GVAR(isKeyDownDistance) = false; -GVAR(keyDownTimeAzimuth) = -1; -GVAR(keyDownTimeDistance) = -1; -GVAR(useMil) = false; -GVAR(useFeet) = false; -GVAR(modeReticle) = 0; +PREP(illuminate); ADDON = true; diff --git a/addons/vector/functions/fnc_adjustBrightness.sqf b/addons/vector/functions/fnc_adjustBrightness.sqf index 8832329796..13c604315d 100644 --- a/addons/vector/functions/fnc_adjustBrightness.sqf +++ b/addons/vector/functions/fnc_adjustBrightness.sqf @@ -26,3 +26,7 @@ _color = [[1,0,0,0.5], [1,0,0,1]] select (_this select 0); (_dlgVector displayCtrl 1322) ctrlSetTextColor _color; (_dlgVector displayCtrl 1323) ctrlSetTextColor _color; (_dlgVector displayCtrl 1324) ctrlSetTextColor _color; + +GVAR(illuminate) = _this select 0; + +_this call FUNC(illuminate); diff --git a/addons/vector/functions/fnc_illuminate.sqf b/addons/vector/functions/fnc_illuminate.sqf new file mode 100644 index 0000000000..0c3779e441 --- /dev/null +++ b/addons/vector/functions/fnc_illuminate.sqf @@ -0,0 +1,41 @@ +// by commy2 +#include "script_component.hpp" + +private "_dlgVector"; + +disableSerialization; +_dlgVector = GETUVAR(ACE_dlgVector,displayNull); + +if (_this select 0) then { + + { + private ["_string", "_index"]; + + _string = ctrlText _x; + _index = _string find ".paa"; + + if (_index != -1 && {_string find "_illum.paa" == -1}) then { + _string = toArray _string; + _string resize _index; + + _x ctrlSetText format ["%1_illum.paa", toString _string]; + }; + } forEach allControls _dlgVector; + +} else { + + { + private ["_string", "_index"]; + + _string = ctrlText _x; + _index = _string find "_illum.paa"; + + if (_index != -1) then { + _string = toArray _string; + _string resize _index; + + _x ctrlSetText format ["%1.paa", toString _string]; + }; + } forEach allControls _dlgVector; + +}; diff --git a/addons/vector/functions/fnc_showAzimuth.sqf b/addons/vector/functions/fnc_showAzimuth.sqf index d4b5421cc3..42e874d83c 100644 --- a/addons/vector/functions/fnc_showAzimuth.sqf +++ b/addons/vector/functions/fnc_showAzimuth.sqf @@ -16,3 +16,5 @@ _digits = _direction call FUNC(convertToTexturesDegree); (_dlgVector displayCtrl 1316) ctrlSetText (_digits select 1); (_dlgVector displayCtrl 1317) ctrlSetText (_digits select 2); (_dlgVector displayCtrl 1318) ctrlSetText (_digits select 3); + +[GVAR(illuminate)] call FUNC(illuminate); diff --git a/addons/vector/functions/fnc_showAzimuthInclination.sqf b/addons/vector/functions/fnc_showAzimuthInclination.sqf index 9d5bb82506..3daed0d4df 100644 --- a/addons/vector/functions/fnc_showAzimuthInclination.sqf +++ b/addons/vector/functions/fnc_showAzimuthInclination.sqf @@ -25,3 +25,5 @@ _digits = [_direction select 1] call FUNC(convertToTexturesDegree); (_dlgVector displayCtrl 1312) ctrlSetText (_digits select 1); (_dlgVector displayCtrl 1313) ctrlSetText (_digits select 2); (_dlgVector displayCtrl 1314) ctrlSetText (_digits select 3); + +[GVAR(illuminate)] call FUNC(illuminate); diff --git a/addons/vector/functions/fnc_showCenter.sqf b/addons/vector/functions/fnc_showCenter.sqf index 58899ff1e7..1293e1286d 100644 --- a/addons/vector/functions/fnc_showCenter.sqf +++ b/addons/vector/functions/fnc_showCenter.sqf @@ -8,3 +8,5 @@ Shows or hides the vectors center square thingy. #include "script_component.hpp" ((GETUVAR(ACE_dlgVector,displayNull)) displayCtrl 1301) ctrlSetText (["", QUOTE(PATHTOF(rsc\vector_center.paa))] select (_this select 0)); + +[GVAR(illuminate)] call FUNC(illuminate); diff --git a/addons/vector/functions/fnc_showDistance.sqf b/addons/vector/functions/fnc_showDistance.sqf index 69d17faa9e..540bd01824 100644 --- a/addons/vector/functions/fnc_showDistance.sqf +++ b/addons/vector/functions/fnc_showDistance.sqf @@ -16,3 +16,5 @@ _digits = [_distance] call FUNC(convertToTexturesDistance); (_dlgVector displayCtrl 1312) ctrlSetText (_digits select 1); (_dlgVector displayCtrl 1313) ctrlSetText (_digits select 2); (_dlgVector displayCtrl 1314) ctrlSetText (_digits select 3); + +[GVAR(illuminate)] call FUNC(illuminate); diff --git a/addons/vector/functions/fnc_showFallOfShot.sqf b/addons/vector/functions/fnc_showFallOfShot.sqf index 45a2232daf..24d933815d 100644 --- a/addons/vector/functions/fnc_showFallOfShot.sqf +++ b/addons/vector/functions/fnc_showFallOfShot.sqf @@ -53,3 +53,5 @@ if !(_this select 0) then { (_dlgVector displayCtrl 1319) ctrlSetText ""; }; + +[GVAR(illuminate)] call FUNC(illuminate); diff --git a/addons/vector/functions/fnc_showHeightDistance.sqf b/addons/vector/functions/fnc_showHeightDistance.sqf index cc563ae11d..67dde19547 100644 --- a/addons/vector/functions/fnc_showHeightDistance.sqf +++ b/addons/vector/functions/fnc_showHeightDistance.sqf @@ -25,3 +25,5 @@ _digits = [_heightDistance select 1] call FUNC(convertToTexturesDistance); (_dlgVector displayCtrl 1316) ctrlSetText (_digits select 1); (_dlgVector displayCtrl 1317) ctrlSetText (_digits select 2); (_dlgVector displayCtrl 1318) ctrlSetText (_digits select 3); + +[GVAR(illuminate)] call FUNC(illuminate); diff --git a/addons/vector/functions/fnc_showP1.sqf b/addons/vector/functions/fnc_showP1.sqf index 6d7baf7412..73453961c1 100644 --- a/addons/vector/functions/fnc_showP1.sqf +++ b/addons/vector/functions/fnc_showP1.sqf @@ -23,3 +23,5 @@ if (_this select 0) then { (_dlgVector displayCtrl 1323) ctrlSetText ""; (_dlgVector displayCtrl 1324) ctrlSetText ""; }; + +[GVAR(illuminate)] call FUNC(illuminate); diff --git a/addons/vector/functions/fnc_showRelativeAzimuthDistance.sqf b/addons/vector/functions/fnc_showRelativeAzimuthDistance.sqf index 7dfc157571..e7c4378866 100644 --- a/addons/vector/functions/fnc_showRelativeAzimuthDistance.sqf +++ b/addons/vector/functions/fnc_showRelativeAzimuthDistance.sqf @@ -25,3 +25,5 @@ _digits = [_azimuthDistance select 1] call FUNC(convertToTexturesDistance); (_dlgVector displayCtrl 1312) ctrlSetText (_digits select 1); (_dlgVector displayCtrl 1313) ctrlSetText (_digits select 2); (_dlgVector displayCtrl 1314) ctrlSetText (_digits select 3); + +[GVAR(illuminate)] call FUNC(illuminate); diff --git a/addons/vector/functions/fnc_showRelativeHeightLength.sqf b/addons/vector/functions/fnc_showRelativeHeightLength.sqf index 599195f376..7fed122786 100644 --- a/addons/vector/functions/fnc_showRelativeHeightLength.sqf +++ b/addons/vector/functions/fnc_showRelativeHeightLength.sqf @@ -25,3 +25,5 @@ _digits = [_heightLength select 1] call FUNC(convertToTexturesDistance); (_dlgVector displayCtrl 1316) ctrlSetText (_digits select 1); (_dlgVector displayCtrl 1317) ctrlSetText (_digits select 2); (_dlgVector displayCtrl 1318) ctrlSetText (_digits select 3); + +[GVAR(illuminate)] call FUNC(illuminate); diff --git a/addons/vector/functions/fnc_showReticle.sqf b/addons/vector/functions/fnc_showReticle.sqf index a3c07010dc..d44adfb68d 100644 --- a/addons/vector/functions/fnc_showReticle.sqf +++ b/addons/vector/functions/fnc_showReticle.sqf @@ -8,3 +8,5 @@ Shows or hides the electronic reticle. #include "script_component.hpp" ((GETUVAR(ACE_dlgVector,displayNull)) displayCtrl 1302) ctrlSetText (["", QUOTE(PATHTOF(rsc\vector_crosshair.paa))] select (_this select 0)); + +[GVAR(illuminate)] call FUNC(illuminate); diff --git a/addons/vector/functions/fnc_showText.sqf b/addons/vector/functions/fnc_showText.sqf index 33e1c4766f..68dbe9d642 100644 --- a/addons/vector/functions/fnc_showText.sqf +++ b/addons/vector/functions/fnc_showText.sqf @@ -153,3 +153,5 @@ switch (_this select 0) do { (_dlgVector displayCtrl 1324) ctrlSetText ""; }; }; + +[GVAR(illuminate)] call FUNC(illuminate); diff --git a/addons/vector/rsc/vector_3_illum.paa.paa b/addons/vector/rsc/vector_3_illum.paa similarity index 100% rename from addons/vector/rsc/vector_3_illum.paa.paa rename to addons/vector/rsc/vector_3_illum.paa diff --git a/addons/vector/rsc/vector_4_illum.paa.paa b/addons/vector/rsc/vector_4_illum.paa similarity index 100% rename from addons/vector/rsc/vector_4_illum.paa.paa rename to addons/vector/rsc/vector_4_illum.paa diff --git a/addons/vector/rsc/vector_5_illum.paa.paa b/addons/vector/rsc/vector_5_illum.paa similarity index 100% rename from addons/vector/rsc/vector_5_illum.paa.paa rename to addons/vector/rsc/vector_5_illum.paa diff --git a/addons/vector/rsc/vector_6_illum.paa.paa b/addons/vector/rsc/vector_6_illum.paa similarity index 100% rename from addons/vector/rsc/vector_6_illum.paa.paa rename to addons/vector/rsc/vector_6_illum.paa diff --git a/addons/vector/rsc/vector_7_illum.paa.paa b/addons/vector/rsc/vector_7_illum.paa similarity index 100% rename from addons/vector/rsc/vector_7_illum.paa.paa rename to addons/vector/rsc/vector_7_illum.paa diff --git a/addons/vector/rsc/vector_8_illum.paa.paa b/addons/vector/rsc/vector_8_illum.paa similarity index 100% rename from addons/vector/rsc/vector_8_illum.paa.paa rename to addons/vector/rsc/vector_8_illum.paa diff --git a/addons/vector/rsc/vector_9_illum.paa.paa b/addons/vector/rsc/vector_9_illum.paa similarity index 100% rename from addons/vector/rsc/vector_9_illum.paa.paa rename to addons/vector/rsc/vector_9_illum.paa diff --git a/addons/vector/rsc/vector_a_illum.paa.paa b/addons/vector/rsc/vector_a_illum.paa similarity index 100% rename from addons/vector/rsc/vector_a_illum.paa.paa rename to addons/vector/rsc/vector_a_illum.paa diff --git a/addons/vector/rsc/vector_b_illum.paa.paa b/addons/vector/rsc/vector_b_illum.paa similarity index 100% rename from addons/vector/rsc/vector_b_illum.paa.paa rename to addons/vector/rsc/vector_b_illum.paa diff --git a/addons/vector/rsc/vector_c_illum.paa.paa b/addons/vector/rsc/vector_c_illum.paa similarity index 100% rename from addons/vector/rsc/vector_c_illum.paa.paa rename to addons/vector/rsc/vector_c_illum.paa diff --git a/addons/vector/rsc/vector_d_illum.paa.paa b/addons/vector/rsc/vector_d_illum.paa similarity index 100% rename from addons/vector/rsc/vector_d_illum.paa.paa rename to addons/vector/rsc/vector_d_illum.paa diff --git a/addons/vector/rsc/vector_degree_illum.paa.paa b/addons/vector/rsc/vector_degree_illum.paa similarity index 100% rename from addons/vector/rsc/vector_degree_illum.paa.paa rename to addons/vector/rsc/vector_degree_illum.paa diff --git a/addons/vector/rsc/vector_e_illum.paa.paa b/addons/vector/rsc/vector_e_illum.paa similarity index 100% rename from addons/vector/rsc/vector_e_illum.paa.paa rename to addons/vector/rsc/vector_e_illum.paa diff --git a/addons/vector/rsc/vector_f_illum.paa.paa b/addons/vector/rsc/vector_f_illum.paa similarity index 100% rename from addons/vector/rsc/vector_f_illum.paa.paa rename to addons/vector/rsc/vector_f_illum.paa diff --git a/addons/vector/rsc/vector_g_illum.paa.paa b/addons/vector/rsc/vector_g_illum.paa similarity index 100% rename from addons/vector/rsc/vector_g_illum.paa.paa rename to addons/vector/rsc/vector_g_illum.paa diff --git a/addons/vector/rsc/vector_i_illum.paa.paa b/addons/vector/rsc/vector_i_illum.paa similarity index 100% rename from addons/vector/rsc/vector_i_illum.paa.paa rename to addons/vector/rsc/vector_i_illum.paa diff --git a/addons/vector/rsc/vector_l_illum.paa.paa b/addons/vector/rsc/vector_l_illum.paa similarity index 100% rename from addons/vector/rsc/vector_l_illum.paa.paa rename to addons/vector/rsc/vector_l_illum.paa diff --git a/addons/vector/rsc/vector_minus_illum.paa.paa b/addons/vector/rsc/vector_minus_illum.paa similarity index 100% rename from addons/vector/rsc/vector_minus_illum.paa.paa rename to addons/vector/rsc/vector_minus_illum.paa diff --git a/addons/vector/rsc/vector_n_illum.paa.paa b/addons/vector/rsc/vector_n_illum.paa similarity index 100% rename from addons/vector/rsc/vector_n_illum.paa.paa rename to addons/vector/rsc/vector_n_illum.paa diff --git a/addons/vector/rsc/vector_o_illum.paa.paa b/addons/vector/rsc/vector_o_illum.paa similarity index 100% rename from addons/vector/rsc/vector_o_illum.paa.paa rename to addons/vector/rsc/vector_o_illum.paa diff --git a/addons/vector/rsc/vector_p_illum.paa.paa b/addons/vector/rsc/vector_p_illum.paa similarity index 100% rename from addons/vector/rsc/vector_p_illum.paa.paa rename to addons/vector/rsc/vector_p_illum.paa diff --git a/addons/vector/rsc/vector_plus_illum.paa.paa b/addons/vector/rsc/vector_plus_illum.paa similarity index 100% rename from addons/vector/rsc/vector_plus_illum.paa.paa rename to addons/vector/rsc/vector_plus_illum.paa diff --git a/addons/vector/rsc/vector_r_illum.paa.paa b/addons/vector/rsc/vector_r_illum.paa similarity index 100% rename from addons/vector/rsc/vector_r_illum.paa.paa rename to addons/vector/rsc/vector_r_illum.paa diff --git a/addons/vector/rsc/vector_t_illum.paa.paa b/addons/vector/rsc/vector_t_illum.paa similarity index 100% rename from addons/vector/rsc/vector_t_illum.paa.paa rename to addons/vector/rsc/vector_t_illum.paa diff --git a/addons/vector/rsc/vector_u_illum.paa.paa b/addons/vector/rsc/vector_u_illum.paa similarity index 100% rename from addons/vector/rsc/vector_u_illum.paa.paa rename to addons/vector/rsc/vector_u_illum.paa