mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
vector settings
This commit is contained in:
parent
2c4c1d7db2
commit
efb761a14c
@ -25,6 +25,8 @@ PREP(showRelativeDistance);
|
||||
PREP(showRelativeHeightLength);
|
||||
PREP(showFallOfShort);
|
||||
PREP(showText);
|
||||
PREP(nextMode);
|
||||
PREP(adjustBrightness);
|
||||
|
||||
GVAR(holdKeyHandler) = -1;
|
||||
GVAR(isKeyDownAzimuth) = false;
|
||||
@ -33,3 +35,4 @@ GVAR(keyDownTimeAzimuth) = -1;
|
||||
GVAR(keyDownTimeDistance) = -1;
|
||||
GVAR(useMil) = false;
|
||||
GVAR(useFeet) = false;
|
||||
GVAR(modeReticle) = 0;
|
||||
|
28
addons/vector/functions/fnc_adjustBrightness.sqf
Normal file
28
addons/vector/functions/fnc_adjustBrightness.sqf
Normal file
@ -0,0 +1,28 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_dlgVector";
|
||||
|
||||
disableSerialization;
|
||||
_dlgVector = GETUVAR(ACE_dlgVector,displayNull);
|
||||
|
||||
private "_color";
|
||||
|
||||
_color = [[1,0,0,0.5], [1,0,0,1]] select (_this select 0);
|
||||
|
||||
(_dlgVector displayCtrl 1301) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1302) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1310) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1311) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1312) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1313) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1314) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1315) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1316) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1317) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1318) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1319) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1321) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1322) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1323) ctrlSetTextColor _color;
|
||||
(_dlgVector displayCtrl 1324) ctrlSetTextColor _color;
|
44
addons/vector/functions/fnc_nextMode.sqf
Normal file
44
addons/vector/functions/fnc_nextMode.sqf
Normal file
@ -0,0 +1,44 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
switch (_this select 0) do {
|
||||
case ("settings"): {
|
||||
switch (GVAR(configTemp)) do {
|
||||
case ([false, false]): {
|
||||
GVAR(configTemp) = [false, true];
|
||||
};
|
||||
case ([false, true]): {
|
||||
GVAR(configTemp) = [true, true];
|
||||
};
|
||||
case ([true, true]): {
|
||||
GVAR(configTemp) = [true, false];
|
||||
};
|
||||
case ([true, false]): {
|
||||
GVAR(configTemp) = [false, false];
|
||||
};
|
||||
};
|
||||
|
||||
[["meter", "feet"] select (GVAR(configTemp) select 0)] call FUNC(showText);
|
||||
[["deg", "mil" ] select (GVAR(configTemp) select 1)] call FUNC(showText);
|
||||
};
|
||||
|
||||
case ("config"): {
|
||||
GVAR(configTemp) = GVAR(configTemp) + 1;
|
||||
if (GVAR(configTemp) > 2) then {GVAR(configTemp) = 0};
|
||||
|
||||
switch (GVAR(configTemp)) do {
|
||||
case (0): {
|
||||
["eret"] call FUNC(showText);
|
||||
["off"] call FUNC(showText);
|
||||
};
|
||||
case (1): {
|
||||
["eret"] call FUNC(showText);
|
||||
["on"] call FUNC(showText);
|
||||
};
|
||||
case (2): {
|
||||
["nigt"] call FUNC(showText);
|
||||
["on"] call FUNC(showText);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -20,10 +20,11 @@ _fnc_setPFH = {
|
||||
|
||||
switch (_this select 0) do {
|
||||
case ("azimuth"): {
|
||||
GVAR(keyDownTabCountDistance) = 0;
|
||||
|
||||
// handle input in option menu
|
||||
if (GVAR(currentMode) == "settings") exitWith {
|
||||
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {};
|
||||
if (diag_tickTime < GVAR(keyDownTimeMenu) + 1) exitWith {};
|
||||
|
||||
if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) then {
|
||||
GVAR(keyDownTabCountAzimuth) = (GETGVAR(keyDownTabCountAzimuth,0)) + 1;
|
||||
@ -32,14 +33,12 @@ switch (_this select 0) do {
|
||||
};
|
||||
|
||||
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";
|
||||
["config"] call FUNC(nextMode);
|
||||
};
|
||||
|
||||
// prevent additinal modifier input if advanced mode it set, spaghetti
|
||||
@ -63,6 +62,7 @@ switch (_this select 0) do {
|
||||
GVAR(keyDownTimeMenu) = diag_tickTime;
|
||||
GVAR(keyDownTimeAzimuth) = diag_tickTime;
|
||||
GVAR(keyDownTabCountAzimuth) = 0;
|
||||
GVAR(configTemp) = [GVAR(useFeet), GVAR(useMil)];
|
||||
["settings"] call FUNC(showText);
|
||||
"settings" call _fnc_setPFH;
|
||||
};
|
||||
@ -90,9 +90,9 @@ switch (_this select 0) do {
|
||||
};
|
||||
|
||||
case ("distance"): {
|
||||
GVAR(keyDownTabCountAzimuth) = 0;
|
||||
|
||||
// handle input in option menu
|
||||
|
||||
if (GVAR(currentMode) == "config") exitWith {
|
||||
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {};
|
||||
|
||||
@ -103,14 +103,12 @@ switch (_this select 0) do {
|
||||
};
|
||||
|
||||
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"
|
||||
["settings"] call FUNC(nextMode);
|
||||
};
|
||||
|
||||
// prevent additinal modifier input if advanced mode it set, spaghetti
|
||||
@ -139,7 +137,7 @@ switch (_this select 0) do {
|
||||
GVAR(keyDownTimeMenu) = diag_tickTime;
|
||||
GVAR(keyDownTimeDistance) = diag_tickTime;
|
||||
GVAR(keyDownTabCountDistance) = 0;
|
||||
GVAR(configTemp) = [GVAR(useFeet), GVAR(useMil)];
|
||||
GVAR(configTemp) = GVAR(modeReticle);
|
||||
["config"] call FUNC(showText);
|
||||
"config" call _fnc_setPFH;
|
||||
};
|
||||
|
@ -222,44 +222,100 @@ switch (_this select 0) do {
|
||||
};
|
||||
|
||||
case ("settings"): {
|
||||
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {
|
||||
if (diag_tickTime < GVAR(keyDownTimeMenu) + 1) 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);
|
||||
[["deg", "mil" ] select (GVAR(configTemp) select 1)] call FUNC(showText);
|
||||
|
||||
if (GVAR(keyDownTabCountDistance) > 0 && {diag_tickTime > GVAR(keyDownTimeDistance) + 0.5}) exitWith {
|
||||
if (GVAR(keyDownTabCountDistance) >= 5) exitWith {
|
||||
if (GVAR(keyDownTabCountAzimuth) >= 5) exitWith {
|
||||
GVAR(useFeet) = GVAR(configTemp) select 0;
|
||||
GVAR(useMil) = GVAR(configTemp) select 1;
|
||||
|
||||
systemChat "set";
|
||||
};
|
||||
|
||||
systemChat "abort";
|
||||
["clear_left"] call FUNC(showText);
|
||||
["clear_right"] call FUNC(showText);
|
||||
["stor"] call FUNC(showText);
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
|
||||
GVAR(currentMode) = "";
|
||||
|
||||
if (GVAR(holdKeyHandler) > -1) then {
|
||||
GVAR(holdKeyHandler) = -1;
|
||||
};
|
||||
};
|
||||
|
||||
if (GVAR(keyDownTabCountAzimuth) > 0 && {diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5}) exitWith {
|
||||
|
||||
["clear_left"] call FUNC(showText);
|
||||
["clear_right"] call FUNC(showText);
|
||||
["old_settings"] call FUNC(showText);
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
|
||||
GVAR(currentMode) = "";
|
||||
|
||||
if (GVAR(holdKeyHandler) > -1) then {
|
||||
GVAR(holdKeyHandler) = -1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
case ("config"): {
|
||||
if (diag_tickTime < GVAR(keyDownTimeMenu) + 1) exitWith {
|
||||
GVAR(keyDownTimeDistance) = diag_tickTime;
|
||||
};
|
||||
|
||||
switch (GVAR(configTemp)) do {
|
||||
case (0): {
|
||||
["eret"] call FUNC(showText);
|
||||
["off"] call FUNC(showText);
|
||||
};
|
||||
case (1): {
|
||||
["eret"] call FUNC(showText);
|
||||
["on"] call FUNC(showText);
|
||||
};
|
||||
case (2): {
|
||||
["nigt"] call FUNC(showText);
|
||||
["on"] call FUNC(showText);
|
||||
};
|
||||
};
|
||||
|
||||
if (GVAR(keyDownTabCountDistance) >= 5) exitWith {
|
||||
GVAR(modeReticle) = GVAR(configTemp);
|
||||
|
||||
["clear_left"] call FUNC(showText);
|
||||
["clear_right"] call FUNC(showText);
|
||||
["stor"] call FUNC(showText);
|
||||
|
||||
// set new config settings
|
||||
switch (GVAR(configTemp)) do {
|
||||
case (0): {
|
||||
[false] call FUNC(adjustBrightness);
|
||||
};
|
||||
case (1): {
|
||||
[false] call FUNC(adjustBrightness);
|
||||
};
|
||||
case (2): {
|
||||
[true] call FUNC(adjustBrightness);
|
||||
};
|
||||
};
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
|
||||
GVAR(currentMode) = "";
|
||||
|
||||
if (GVAR(holdKeyHandler) > -1) then {
|
||||
GVAR(holdKeyHandler) = -1;
|
||||
};
|
||||
};
|
||||
|
||||
if (GVAR(keyDownTabCountDistance) > 0 && {diag_tickTime > GVAR(keyDownTimeDistance) + 0.5}) exitWith {
|
||||
|
||||
["clear_left"] call FUNC(showText);
|
||||
["clear_right"] call FUNC(showText);
|
||||
["old_config"] call FUNC(showText);
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
|
||||
@ -269,9 +325,6 @@ switch (_this select 0) do {
|
||||
GVAR(holdKeyHandler) = -1;
|
||||
};
|
||||
};
|
||||
//show current mode
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//systemChat str (_this select 0);
|
||||
|
@ -16,8 +16,10 @@ if (_this select 0) then {
|
||||
(_dlgVector displayCtrl 1321) ctrlSetText QUOTE(PATHTOF(rsc\vector_1.paa));
|
||||
(_dlgVector displayCtrl 1322) ctrlSetText QUOTE(PATHTOF(rsc\vector_minus.paa));
|
||||
(_dlgVector displayCtrl 1323) ctrlSetText QUOTE(PATHTOF(rsc\vector_p.paa));
|
||||
(_dlgVector displayCtrl 1324) ctrlSetText "";
|
||||
} else {
|
||||
(_dlgVector displayCtrl 1321) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1322) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1323) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1324) ctrlSetText "";
|
||||
};
|
||||
|
@ -33,7 +33,7 @@ switch (_this select 0) do {
|
||||
(_dlgVector displayCtrl 1314) ctrlSetText "";
|
||||
};
|
||||
|
||||
case ("night"): {
|
||||
case ("nigt"): {
|
||||
(_dlgVector displayCtrl 1315) ctrlSetText "";
|
||||
(_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa));
|
||||
(_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_i.paa));
|
||||
|
Loading…
Reference in New Issue
Block a user