mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
add config, settings to vector
This commit is contained in:
parent
b6bdb71547
commit
2c4c1d7db2
@ -24,6 +24,7 @@ PREP(showRelativeAzimuthDistance);
|
||||
PREP(showRelativeDistance);
|
||||
PREP(showRelativeHeightLength);
|
||||
PREP(showFallOfShort);
|
||||
PREP(showText);
|
||||
|
||||
GVAR(holdKeyHandler) = -1;
|
||||
GVAR(isKeyDownAzimuth) = false;
|
||||
|
@ -14,13 +14,34 @@ _fnc_setPFH = {
|
||||
GVAR(holdKeyHandler) = -1;
|
||||
};
|
||||
|
||||
GVAR(currentMode) = _this;//
|
||||
GVAR(currentMode) = _this;
|
||||
GVAR(holdKeyHandler) = [FUNC(onKeyHold), 0, _this] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
||||
switch (_this select 0) do {
|
||||
case ("azimuth"): {
|
||||
|
||||
// handle input in option menu
|
||||
if (GVAR(currentMode) == "settings") exitWith {
|
||||
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {};
|
||||
|
||||
if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) then {
|
||||
GVAR(keyDownTabCountAzimuth) = (GETGVAR(keyDownTabCountAzimuth,0)) + 1;
|
||||
} else {
|
||||
GVAR(keyDownTabCountAzimuth) = 1;
|
||||
};
|
||||
|
||||
GVAR(keyDownTimeAzimuth) = diag_tickTime;
|
||||
|
||||
systemChat str GVAR(keyDownTabCountAzimuth);//
|
||||
};
|
||||
|
||||
if (GVAR(currentMode) == "config") exitWith {
|
||||
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {};
|
||||
|
||||
systemChat "azi in config";
|
||||
};
|
||||
|
||||
// prevent additinal modifier input if advanced mode it set, spaghetti
|
||||
if (GETGVAR(isKeyDownDistance,false) && {GETGVAR(currentMode,"") in ["relative_distance", "relative_height+length"]}) exitWith {};
|
||||
|
||||
@ -37,9 +58,13 @@ switch (_this select 0) do {
|
||||
GVAR(keyDownTabCountAzimuth) = 1;
|
||||
};
|
||||
|
||||
// open config menu
|
||||
// open settings menu
|
||||
if (GVAR(keyDownTabCountAzimuth) == 5) exitWith {
|
||||
systemChat "0";
|
||||
GVAR(keyDownTimeMenu) = diag_tickTime;
|
||||
GVAR(keyDownTimeAzimuth) = diag_tickTime;
|
||||
GVAR(keyDownTabCountAzimuth) = 0;
|
||||
["settings"] call FUNC(showText);
|
||||
"settings" call _fnc_setPFH;
|
||||
};
|
||||
|
||||
if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) exitWith {
|
||||
@ -66,6 +91,28 @@ switch (_this select 0) do {
|
||||
|
||||
case ("distance"): {
|
||||
|
||||
// handle input in option menu
|
||||
|
||||
if (GVAR(currentMode) == "config") exitWith {
|
||||
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {};
|
||||
|
||||
if (diag_tickTime < GVAR(keyDownTimeDistance) + 0.5) then {
|
||||
GVAR(keyDownTabCountDistance) = (GETGVAR(keyDownTabCountDistance,0)) + 1;
|
||||
} else {
|
||||
GVAR(keyDownTabCountDistance) = 1;
|
||||
};
|
||||
|
||||
GVAR(keyDownTimeDistance) = diag_tickTime;
|
||||
|
||||
systemChat str GVAR(keyDownTabCountDistance);//
|
||||
};
|
||||
|
||||
if (GVAR(currentMode) == "settings") exitWith {
|
||||
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {};
|
||||
|
||||
systemChat "dis in settings"
|
||||
};
|
||||
|
||||
// prevent additinal modifier input if advanced mode it set, spaghetti
|
||||
if (GETGVAR(isKeyDownAzimuth,false) && {GETGVAR(currentMode,"") in ["relative_azimuth+distance", "fall_of_short"]}) exitWith {};
|
||||
|
||||
@ -89,7 +136,12 @@ switch (_this select 0) do {
|
||||
|
||||
// open config menu
|
||||
if (GVAR(keyDownTabCountDistance) == 5) exitWith {
|
||||
systemChat "1";
|
||||
GVAR(keyDownTimeMenu) = diag_tickTime;
|
||||
GVAR(keyDownTimeDistance) = diag_tickTime;
|
||||
GVAR(keyDownTabCountDistance) = 0;
|
||||
GVAR(configTemp) = [GVAR(useFeet), GVAR(useMil)];
|
||||
["config"] call FUNC(showText);
|
||||
"config" call _fnc_setPFH;
|
||||
};
|
||||
|
||||
if (diag_tickTime < GVAR(keyDownTimeDistance) + 0.5) exitWith {
|
||||
|
@ -7,6 +7,16 @@ PFH executed while holding a vector key down.
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (currentWeapon ACE_player != "ACE_Vector") exitWith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
|
||||
GVAR(currentMode) = "";
|
||||
|
||||
if (GVAR(holdKeyHandler) > -1) then {
|
||||
GVAR(holdKeyHandler) = -1;
|
||||
};
|
||||
};
|
||||
|
||||
switch (_this select 0) do {
|
||||
case ("azimuth"): {
|
||||
|
||||
@ -211,6 +221,57 @@ switch (_this select 0) do {
|
||||
|
||||
};
|
||||
|
||||
case ("settings"): {
|
||||
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {
|
||||
GVAR(keyDownTimeAzimuth) = diag_tickTime;
|
||||
};
|
||||
|
||||
/*[["meter", "feet"] select GVAR(useFeet)] call FUNC(showText);
|
||||
[["deg", "mil" ] select GVAR(useMil)] call FUNC(showText);*/
|
||||
|
||||
if (GVAR(keyDownTabCountAzimuth) > 0 && {diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5}) exitWith {
|
||||
systemChat "abort";
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
|
||||
GVAR(currentMode) = "";
|
||||
|
||||
if (GVAR(holdKeyHandler) > -1) then {
|
||||
GVAR(holdKeyHandler) = -1;
|
||||
};
|
||||
};
|
||||
//show current mode
|
||||
};
|
||||
|
||||
case ("config"): {
|
||||
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {
|
||||
GVAR(keyDownTimeDistance) = diag_tickTime;
|
||||
};
|
||||
|
||||
[["meter", "feet"] select (GVAR(configTemp) select 0)] call FUNC(showText);
|
||||
[["deg", "mil" ] select (GVAR(configTemp) select 0)] call FUNC(showText);
|
||||
|
||||
if (GVAR(keyDownTabCountDistance) > 0 && {diag_tickTime > GVAR(keyDownTimeDistance) + 0.5}) exitWith {
|
||||
if (GVAR(keyDownTabCountDistance) >= 5) exitWith {
|
||||
GVAR(useFeet) = GVAR(configTemp) select 0;
|
||||
GVAR(useMil) = GVAR(configTemp) select 1;
|
||||
|
||||
systemChat "set";
|
||||
};
|
||||
|
||||
systemChat "abort";
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
|
||||
GVAR(currentMode) = "";
|
||||
|
||||
if (GVAR(holdKeyHandler) > -1) then {
|
||||
GVAR(holdKeyHandler) = -1;
|
||||
};
|
||||
};
|
||||
//show current mode
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//systemChat str (_this select 0);
|
||||
|
155
addons/vector/functions/fnc_showText.sqf
Normal file
155
addons/vector/functions/fnc_showText.sqf
Normal file
@ -0,0 +1,155 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_dlgVector";
|
||||
|
||||
disableSerialization;
|
||||
_dlgVector = GETUVAR(ACE_dlgVector,displayNull);
|
||||
|
||||
switch (_this select 0) do {
|
||||
case ("config"): {
|
||||
(_dlgVector displayCtrl 1315) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1316) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_c.paa));
|
||||
(_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa));
|
||||
(_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa));
|
||||
(_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_f.paa));
|
||||
(_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_i.paa));
|
||||
(_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_g.paa));
|
||||
(_dlgVector displayCtrl 1313) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1314) ctrlSetText "";
|
||||
};
|
||||
|
||||
case ("settings"): {
|
||||
(_dlgVector displayCtrl 1315) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_u.paa));
|
||||
(_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa));
|
||||
(_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_i.paa));
|
||||
(_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa));
|
||||
(_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_5.paa));
|
||||
(_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_e.paa));
|
||||
(_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa));
|
||||
(_dlgVector displayCtrl 1313) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa));
|
||||
(_dlgVector displayCtrl 1314) ctrlSetText "";
|
||||
};
|
||||
|
||||
case ("night"): {
|
||||
(_dlgVector displayCtrl 1315) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa));
|
||||
(_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_i.paa));
|
||||
(_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_g.paa));
|
||||
(_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa));
|
||||
};
|
||||
|
||||
case ("eret"): {
|
||||
(_dlgVector displayCtrl 1315) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_e.paa));
|
||||
(_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_r.paa));
|
||||
(_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_e.paa));
|
||||
(_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa));
|
||||
};
|
||||
|
||||
case ("on"): {
|
||||
(_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa));
|
||||
(_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa));
|
||||
(_dlgVector displayCtrl 1312) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1313) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1314) ctrlSetText "";
|
||||
};
|
||||
|
||||
case ("off"): {
|
||||
(_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa));
|
||||
(_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_f.paa));
|
||||
(_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_f.paa));
|
||||
(_dlgVector displayCtrl 1313) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1314) ctrlSetText "";
|
||||
};
|
||||
|
||||
case ("deg"): {
|
||||
(_dlgVector displayCtrl 1315) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_3.paa));
|
||||
(_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_6.paa));
|
||||
(_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_0.paa));
|
||||
(_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_degree.paa));
|
||||
};
|
||||
|
||||
case ("mil"): {
|
||||
(_dlgVector displayCtrl 1315) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_6.paa));
|
||||
(_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_4.paa));
|
||||
(_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_0.paa));
|
||||
(_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_0.paa));
|
||||
};
|
||||
|
||||
case ("meter"): {
|
||||
(_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_5.paa));
|
||||
(_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_1.paa));
|
||||
(_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_minus.paa));
|
||||
(_dlgVector displayCtrl 1313) ctrlSetText QUOTE(PATHTOF(rsc\vector_u.paa));
|
||||
(_dlgVector displayCtrl 1314) ctrlSetText "";
|
||||
};
|
||||
|
||||
case ("feet"): {
|
||||
(_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_f.paa));
|
||||
(_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_e.paa));
|
||||
(_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_e.paa));
|
||||
(_dlgVector displayCtrl 1313) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa));
|
||||
(_dlgVector displayCtrl 1314) ctrlSetText "";
|
||||
};
|
||||
|
||||
case ("stor"): {
|
||||
(_dlgVector displayCtrl 1321) ctrlSetText QUOTE(PATHTOF(rsc\vector_5.paa));
|
||||
(_dlgVector displayCtrl 1322) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa));
|
||||
(_dlgVector displayCtrl 1323) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa));
|
||||
(_dlgVector displayCtrl 1324) ctrlSetText QUOTE(PATHTOF(rsc\vector_r.paa));
|
||||
};
|
||||
|
||||
case ("old_config"): {
|
||||
(_dlgVector displayCtrl 1315) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1316) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa));
|
||||
(_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_1.paa));
|
||||
(_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_d.paa));
|
||||
(_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_c.paa));
|
||||
(_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa));
|
||||
(_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa));
|
||||
(_dlgVector displayCtrl 1313) ctrlSetText QUOTE(PATHTOF(rsc\vector_f.paa));
|
||||
(_dlgVector displayCtrl 1314) ctrlSetText "";
|
||||
};
|
||||
|
||||
case ("old_settings"): {
|
||||
(_dlgVector displayCtrl 1315) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1316) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa));
|
||||
(_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_1.paa));
|
||||
(_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_d.paa));
|
||||
(_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_u.paa));
|
||||
(_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa));
|
||||
(_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_i.paa));
|
||||
(_dlgVector displayCtrl 1313) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa));
|
||||
(_dlgVector displayCtrl 1314) ctrlSetText "";
|
||||
};
|
||||
|
||||
case ("clear_left"): {
|
||||
(_dlgVector displayCtrl 1315) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1316) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1317) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1318) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1319) ctrlSetText "";
|
||||
};
|
||||
|
||||
case ("clear_right"): {
|
||||
(_dlgVector displayCtrl 1310) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1311) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1312) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1313) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1314) ctrlSetText "";
|
||||
};
|
||||
|
||||
case ("clear_stor"): {
|
||||
(_dlgVector displayCtrl 1321) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1322) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1323) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1324) ctrlSetText "";
|
||||
};
|
||||
};
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user