vector settings

This commit is contained in:
commy2 2015-01-21 22:52:39 +01:00
parent 2c4c1d7db2
commit efb761a14c
8 changed files with 311 additions and 183 deletions

View File

@ -4,162 +4,162 @@ class RscPicture;
//class ScrollBar; //class ScrollBar;
class RscControlsGroup { class RscControlsGroup {
class VScrollbar;//: ScrollBar {}; class VScrollbar;//: ScrollBar {};
class HScrollbar;//: ScrollBar {}; class HScrollbar;//: ScrollBar {};
}; };
class RscInGameUI { class RscInGameUI {
class RscUnitInfo; class RscUnitInfo;
class ACE_RscOptics_vector: RscUnitInfo { class ACE_RscOptics_vector: RscUnitInfo {
onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['ACE_dlgVector', _this select 0];"; onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['ACE_dlgVector', _this select 0];";
onUnload = "[""onUnload"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; onUnload = "[""onUnload"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
idd = 300; idd = 300;
controls[] = {"CA_Distance","CA_Heading","CA_OpticsPitch","CA_Elev","CA_OpticsZoom","CA_VisionMode","ACE_ScriptedDisplayControlsGroup"}; controls[] = {"CA_Distance","CA_Heading","CA_OpticsPitch","CA_Elev","CA_OpticsZoom","CA_VisionMode","ACE_ScriptedDisplayControlsGroup"};
class CA_Distance: RscText { class CA_Distance: RscText {
idc = 151; // distance idc = 151; // distance
w = 0; w = 0;
h = 0; h = 0;
};
class CA_Heading: RscText {
idc = 156; // azimuth
w = 0;
h = 0;
};
class CA_OpticsPitch: RscText {
idc = 182; // inclination
w = 0;
h = 0;
};
class CA_Elev: RscText {
idc = 175; // inclination, more accurate
w = 0;
h = 0;
};
class CA_OpticsZoom: RscText {
idc = 180; // some kind of zoom
w = 0;
h = 0;
};
class CA_VisionMode: RscText {
idc = 179; // ???
w = 0;
h = 0;
};
class ACE_ScriptedDisplayControlsGroup: RscControlsGroup {
idc = 170;
x = "SafezoneX";
y = "SafezoneY";
w = "SafezoneW";
h = "SafezoneH";
class VScrollbar: VScrollbar {
width = 0;
};
class HScrollbar: HScrollbar {
height = 0;
};
class controls {
class Center: RscPicture {
idc = 1301;
text = "";
colorText[] = {1,0,0,0.5};
x = 0.488 * safezoneW /*+ safezoneX*/;
y = 0.4783 * safezoneH /*+ safezoneY*/;
w = 0.4 / 16 * safezoneW;
h = 0.4 / 9 * safezoneH;
};
class Crosshair: Center {
idc = 1302;
x = 0.4848 * safezoneW /*+ safezoneX*/;
y = 0.4732 * safezoneH /*+ safezoneY*/;
w = 0.5 / 16 * safezoneW;
h = 0.5 / 9 * safezoneH;
};
class Digit0: Center {
idc = 1310;
x = (0.54 + 0 * 0.02) * safezoneW /*+ safezoneX*/;
y = 0.54 * safezoneH /*+ safezoneY*/;
w = 0.5 / 16 * safezoneW;
h = 0.5 / 9 * safezoneH;
};
class Digit1: Digit0 {
idc = 1311;
x = (0.54 + 1 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit2: Digit0 {
idc = 1312;
x = (0.54 + 2 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit3: Digit0 {
idc = 1313;
x = (0.54 + 3 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit4: Digit0 {
idc = 1314;
x = (0.54 + 4 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit5: Digit0 {
idc = 1315;
x = (0.35 + 0 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit6: Digit0 {
idc = 1316;
x = (0.35 + 1 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit7: Digit0 {
idc = 1317;
x = (0.35 + 2 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit8: Digit0 {
idc = 1318;
x = (0.35 + 3 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit9: Digit0 {
idc = 1319;
x = (0.35 + 4 * 0.02) * safezoneW /*+ safezoneX*/;
};
class DigitE1: Digit0 {
idc = 1321;
x = (0.39 + 0 * 0.02) * safezoneW /*+ safezoneX*/;
y = 0.42 * safezoneH /*+ safezoneY*/;
};
class DigitE2: DigitE1 {
idc = 1322;
x = (0.39 + 1 * 0.02) * safezoneW /*+ safezoneX*/;
};
class DigitE3: DigitE1 {
idc = 1323;
x = (0.39 + 2 * 0.02) * safezoneW /*+ safezoneX*/;
};
class DigitE4: DigitE1 {
idc = 1324;
x = (0.39 + 3 * 0.02) * safezoneW /*+ safezoneX*/;
};
};
};
}; };
class CA_Heading: RscText {
idc = 156; // azimuth
w = 0;
h = 0;
};
class CA_OpticsPitch: RscText {
idc = 182; // inclination
w = 0;
h = 0;
};
class CA_Elev: RscText {
idc = 175; // inclination, more accurate
w = 0;
h = 0;
};
class CA_OpticsZoom: RscText {
idc = 180; // some kind of zoom
w = 0;
h = 0;
};
class CA_VisionMode: RscText {
idc = 179; // ???
w = 0;
h = 0;
};
class ACE_ScriptedDisplayControlsGroup: RscControlsGroup {
idc = 170;
x = "SafezoneX";
y = "SafezoneY";
w = "SafezoneW";
h = "SafezoneH";
class VScrollbar: VScrollbar {
width = 0;
};
class HScrollbar: HScrollbar {
height = 0;
};
class controls {
class Center: RscPicture {
idc = 1301;
text = "";
colorText[] = {1,0,0,0.5};
x = 0.488 * safezoneW /*+ safezoneX*/;
y = 0.4783 * safezoneH /*+ safezoneY*/;
w = 0.4 / 16 * safezoneW;
h = 0.4 / 9 * safezoneH;
};
class Crosshair: Center {
idc = 1302;
x = 0.4848 * safezoneW /*+ safezoneX*/;
y = 0.4732 * safezoneH /*+ safezoneY*/;
w = 0.5 / 16 * safezoneW;
h = 0.5 / 9 * safezoneH;
};
class Digit0: Center {
idc = 1310;
x = (0.54 + 0 * 0.02) * safezoneW /*+ safezoneX*/;
y = 0.54 * safezoneH /*+ safezoneY*/;
w = 0.5 / 16 * safezoneW;
h = 0.5 / 9 * safezoneH;
};
class Digit1: Digit0 {
idc = 1311;
x = (0.54 + 1 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit2: Digit0 {
idc = 1312;
x = (0.54 + 2 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit3: Digit0 {
idc = 1313;
x = (0.54 + 3 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit4: Digit0 {
idc = 1314;
x = (0.54 + 4 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit5: Digit0 {
idc = 1315;
x = (0.35 + 0 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit6: Digit0 {
idc = 1316;
x = (0.35 + 1 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit7: Digit0 {
idc = 1317;
x = (0.35 + 2 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit8: Digit0 {
idc = 1318;
x = (0.35 + 3 * 0.02) * safezoneW /*+ safezoneX*/;
};
class Digit9: Digit0 {
idc = 1319;
x = (0.35 + 4 * 0.02) * safezoneW /*+ safezoneX*/;
};
class DigitE1: Digit0 {
idc = 1321;
x = (0.39 + 0 * 0.02) * safezoneW /*+ safezoneX*/;
y = 0.42 * safezoneH /*+ safezoneY*/;
};
class DigitE2: DigitE1 {
idc = 1322;
x = (0.39 + 1 * 0.02) * safezoneW /*+ safezoneX*/;
};
class DigitE3: DigitE1 {
idc = 1323;
x = (0.39 + 2 * 0.02) * safezoneW /*+ safezoneX*/;
};
class DigitE4: DigitE1 {
idc = 1324;
x = (0.39 + 3 * 0.02) * safezoneW /*+ safezoneX*/;
};
};
};
};
}; };

View File

@ -25,6 +25,8 @@ PREP(showRelativeDistance);
PREP(showRelativeHeightLength); PREP(showRelativeHeightLength);
PREP(showFallOfShort); PREP(showFallOfShort);
PREP(showText); PREP(showText);
PREP(nextMode);
PREP(adjustBrightness);
GVAR(holdKeyHandler) = -1; GVAR(holdKeyHandler) = -1;
GVAR(isKeyDownAzimuth) = false; GVAR(isKeyDownAzimuth) = false;
@ -33,3 +35,4 @@ GVAR(keyDownTimeAzimuth) = -1;
GVAR(keyDownTimeDistance) = -1; GVAR(keyDownTimeDistance) = -1;
GVAR(useMil) = false; GVAR(useMil) = false;
GVAR(useFeet) = false; GVAR(useFeet) = false;
GVAR(modeReticle) = 0;

View 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;

View 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);
};
};
};
};

View File

@ -20,10 +20,11 @@ _fnc_setPFH = {
switch (_this select 0) do { switch (_this select 0) do {
case ("azimuth"): { case ("azimuth"): {
GVAR(keyDownTabCountDistance) = 0;
// handle input in option menu // handle input in option menu
if (GVAR(currentMode) == "settings") exitWith { 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 { if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) then {
GVAR(keyDownTabCountAzimuth) = (GETGVAR(keyDownTabCountAzimuth,0)) + 1; GVAR(keyDownTabCountAzimuth) = (GETGVAR(keyDownTabCountAzimuth,0)) + 1;
@ -32,14 +33,12 @@ switch (_this select 0) do {
}; };
GVAR(keyDownTimeAzimuth) = diag_tickTime; GVAR(keyDownTimeAzimuth) = diag_tickTime;
systemChat str GVAR(keyDownTabCountAzimuth);//
}; };
if (GVAR(currentMode) == "config") exitWith { if (GVAR(currentMode) == "config") exitWith {
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) 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 // prevent additinal modifier input if advanced mode it set, spaghetti
@ -63,6 +62,7 @@ switch (_this select 0) do {
GVAR(keyDownTimeMenu) = diag_tickTime; GVAR(keyDownTimeMenu) = diag_tickTime;
GVAR(keyDownTimeAzimuth) = diag_tickTime; GVAR(keyDownTimeAzimuth) = diag_tickTime;
GVAR(keyDownTabCountAzimuth) = 0; GVAR(keyDownTabCountAzimuth) = 0;
GVAR(configTemp) = [GVAR(useFeet), GVAR(useMil)];
["settings"] call FUNC(showText); ["settings"] call FUNC(showText);
"settings" call _fnc_setPFH; "settings" call _fnc_setPFH;
}; };
@ -90,9 +90,9 @@ switch (_this select 0) do {
}; };
case ("distance"): { case ("distance"): {
GVAR(keyDownTabCountAzimuth) = 0;
// handle input in option menu // handle input in option menu
if (GVAR(currentMode) == "config") exitWith { if (GVAR(currentMode) == "config") exitWith {
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {}; if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {};
@ -103,14 +103,12 @@ switch (_this select 0) do {
}; };
GVAR(keyDownTimeDistance) = diag_tickTime; GVAR(keyDownTimeDistance) = diag_tickTime;
systemChat str GVAR(keyDownTabCountDistance);//
}; };
if (GVAR(currentMode) == "settings") exitWith { if (GVAR(currentMode) == "settings") exitWith {
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) 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 // prevent additinal modifier input if advanced mode it set, spaghetti
@ -139,7 +137,7 @@ switch (_this select 0) do {
GVAR(keyDownTimeMenu) = diag_tickTime; GVAR(keyDownTimeMenu) = diag_tickTime;
GVAR(keyDownTimeDistance) = diag_tickTime; GVAR(keyDownTimeDistance) = diag_tickTime;
GVAR(keyDownTabCountDistance) = 0; GVAR(keyDownTabCountDistance) = 0;
GVAR(configTemp) = [GVAR(useFeet), GVAR(useMil)]; GVAR(configTemp) = GVAR(modeReticle);
["config"] call FUNC(showText); ["config"] call FUNC(showText);
"config" call _fnc_setPFH; "config" call _fnc_setPFH;
}; };

View File

@ -222,15 +222,35 @@ switch (_this select 0) do {
}; };
case ("settings"): { case ("settings"): {
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith { if (diag_tickTime < GVAR(keyDownTimeMenu) + 1) exitWith {
GVAR(keyDownTimeAzimuth) = diag_tickTime; GVAR(keyDownTimeAzimuth) = diag_tickTime;
}; };
/*[["meter", "feet"] select GVAR(useFeet)] call FUNC(showText); [["meter", "feet"] select (GVAR(configTemp) select 0)] call FUNC(showText);
[["deg", "mil" ] select GVAR(useMil)] call FUNC(showText);*/ [["deg", "mil" ] select (GVAR(configTemp) select 1)] call FUNC(showText);
if (GVAR(keyDownTabCountAzimuth) > 0 && {diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5}) exitWith { if (GVAR(keyDownTabCountAzimuth) >= 5) exitWith {
systemChat "abort"; GVAR(useFeet) = GVAR(configTemp) select 0;
GVAR(useMil) = GVAR(configTemp) select 1;
["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; [_this select 1] call CBA_fnc_removePerFrameHandler;
@ -240,26 +260,62 @@ switch (_this select 0) do {
GVAR(holdKeyHandler) = -1; GVAR(holdKeyHandler) = -1;
}; };
}; };
//show current mode
}; };
case ("config"): { case ("config"): {
if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith { if (diag_tickTime < GVAR(keyDownTimeMenu) + 1) exitWith {
GVAR(keyDownTimeDistance) = diag_tickTime; GVAR(keyDownTimeDistance) = diag_tickTime;
}; };
[["meter", "feet"] select (GVAR(configTemp) select 0)] call FUNC(showText); switch (GVAR(configTemp)) do {
[["deg", "mil" ] select (GVAR(configTemp) select 0)] call FUNC(showText); case (0): {
["eret"] call FUNC(showText);
if (GVAR(keyDownTabCountDistance) > 0 && {diag_tickTime > GVAR(keyDownTimeDistance) + 0.5}) exitWith { ["off"] call FUNC(showText);
if (GVAR(keyDownTabCountDistance) >= 5) exitWith {
GVAR(useFeet) = GVAR(configTemp) select 0;
GVAR(useMil) = GVAR(configTemp) select 1;
systemChat "set";
}; };
case (1): {
["eret"] call FUNC(showText);
["on"] call FUNC(showText);
};
case (2): {
["nigt"] call FUNC(showText);
["on"] call FUNC(showText);
};
};
systemChat "abort"; 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; [_this select 1] call CBA_fnc_removePerFrameHandler;
@ -269,9 +325,6 @@ switch (_this select 0) do {
GVAR(holdKeyHandler) = -1; GVAR(holdKeyHandler) = -1;
}; };
}; };
//show current mode
}; };
}; };
//systemChat str (_this select 0);

View File

@ -16,8 +16,10 @@ if (_this select 0) then {
(_dlgVector displayCtrl 1321) ctrlSetText QUOTE(PATHTOF(rsc\vector_1.paa)); (_dlgVector displayCtrl 1321) ctrlSetText QUOTE(PATHTOF(rsc\vector_1.paa));
(_dlgVector displayCtrl 1322) ctrlSetText QUOTE(PATHTOF(rsc\vector_minus.paa)); (_dlgVector displayCtrl 1322) ctrlSetText QUOTE(PATHTOF(rsc\vector_minus.paa));
(_dlgVector displayCtrl 1323) ctrlSetText QUOTE(PATHTOF(rsc\vector_p.paa)); (_dlgVector displayCtrl 1323) ctrlSetText QUOTE(PATHTOF(rsc\vector_p.paa));
(_dlgVector displayCtrl 1324) ctrlSetText "";
} else { } else {
(_dlgVector displayCtrl 1321) ctrlSetText ""; (_dlgVector displayCtrl 1321) ctrlSetText "";
(_dlgVector displayCtrl 1322) ctrlSetText ""; (_dlgVector displayCtrl 1322) ctrlSetText "";
(_dlgVector displayCtrl 1323) ctrlSetText ""; (_dlgVector displayCtrl 1323) ctrlSetText "";
(_dlgVector displayCtrl 1324) ctrlSetText "";
}; };

View File

@ -33,7 +33,7 @@ switch (_this select 0) do {
(_dlgVector displayCtrl 1314) ctrlSetText ""; (_dlgVector displayCtrl 1314) ctrlSetText "";
}; };
case ("night"): { case ("nigt"): {
(_dlgVector displayCtrl 1315) ctrlSetText ""; (_dlgVector displayCtrl 1315) ctrlSetText "";
(_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa)); (_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa));
(_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_i.paa)); (_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_i.paa));