Added a new solution setup menu

This commit is contained in:
ulteq 2015-04-21 15:01:23 +02:00
parent c24586ce02
commit 4833193860
11 changed files with 214 additions and 21 deletions

View File

@ -608,7 +608,7 @@ class ATragMX_Display {
w=0.03;
x=0.550*safezoneW+safezoneX+0.27;
text="4";
action="";
action=QUOTE(call FUNC(toggle_solution_setup));
};
class TEXT_CALCULATE: TEXT_SCOPE_UNIT {
idc=3000;
@ -1368,5 +1368,94 @@ class ATragMX_Display {
class TEXT_TARGET_DATA_NEXT: TEXT_TARGET_SPEED_ASSIST_NEXT {
idc=14011;
};
class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN: TEXT_GUN_AMMO_DATA_BORE_HEIGHT {
idc=15000;
style=64;
w=0.25;
h=0.07;
x=0.550*safezoneW+safezoneX+0.13;
y=0.265*safezoneH+safezoneY+0.32;
text="Show result in";
};
class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1: TEXT_TARGET_A {
idc=15001;
w=0.04;
x=0.550*safezoneW+safezoneX+0.14;
y=0.265*safezoneH+safezoneY+0.35;
text="1";
action=QUOTE(GVAR(currentScopeClickNumberTemp) = 1; call FUNC(update_solution_setup));
};
class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_2: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 {
idc=15002;
x=0.550*safezoneW+safezoneX+0.18;
text="2";
action=QUOTE(GVAR(currentScopeClickNumberTemp) = 2; call FUNC(update_solution_setup));
};
class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_3: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 {
idc=15003;
x=0.550*safezoneW+safezoneX+0.22;
text="3";
action=QUOTE(GVAR(currentScopeClickNumberTemp) = 3; call FUNC(update_solution_setup));
};
class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_4: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 {
idc=15004;
x=0.550*safezoneW+safezoneX+0.26;
text="4";
action=QUOTE(GVAR(currentScopeClickNumberTemp) = 4; call FUNC(update_solution_setup));
};
class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_8: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 {
idc=15005;
x=0.550*safezoneW+safezoneX+0.30;
text="8";
action=QUOTE(GVAR(currentScopeClickNumberTemp) = 8; call FUNC(update_solution_setup));
};
class TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_10: TEXT_SOLUTION_SETUP_SHOW_RESULT_IN_1 {
idc=15006;
x=0.550*safezoneW+safezoneX+0.34;
text="10";
action=QUOTE(GVAR(currentScopeClickNumberTemp) = 10; call FUNC(update_solution_setup));
};
class TEXT_SOLUTION_SETUP_CLICKS_PER: TEXT_GUN_AMMO_DATA_BORE_HEIGHT {
idc=15007;
style=64;
w=0.25;
h=0.07;
x=0.550*safezoneW+safezoneX+0.13;
y=0.265*safezoneH+safezoneY+0.42;
text="Clicks per";
};
class TEXT_SOLUTION_SETUP_CLICKS_PER_TMOA: TEXT_TARGET_A {
idc=15008;
w=0.05;
x=0.550*safezoneW+safezoneX+0.15;
y=0.265*safezoneH+safezoneY+0.45;
text="TMOA";
action=QUOTE(GVAR(currentScopeClickUnitTemp) = 0; call FUNC(update_solution_setup));
};
class TEXT_SOLUTION_SETUP_CLICKS_PER_SMOA: TEXT_SOLUTION_SETUP_CLICKS_PER_TMOA {
idc=15009;
x=0.550*safezoneW+safezoneX+0.23;
text="SMOA";
action=QUOTE(GVAR(currentScopeClickUnitTemp) = 1; call FUNC(update_solution_setup));
};
class TEXT_SOLUTION_SETUP_CLICKS_PER_MILS: TEXT_SOLUTION_SETUP_CLICKS_PER_TMOA {
idc=15010;
x=0.550*safezoneW+safezoneX+0.31;
text="MILS";
action=QUOTE(GVAR(currentScopeClickUnitTemp) = 2; call FUNC(update_solution_setup));
};
class TEXT_SOLUTION_SETUP_DONE: TEXT_TARGET_SPEED_ASSIST_DONE {
idc=15011;
x=0.550*safezoneW+safezoneX+0.18;
y=0.265*safezoneH+safezoneY+0.55;
action=QUOTE(1 call FUNC(toggle_solution_setup));
};
class TEXT_SOLUTION_SETUP_CANCEL: TEXT_TARGET_SPEED_ASSIST_CANCEL {
idc=15012;
x=0.550*safezoneW+safezoneX+0.26;
y=0.265*safezoneH+safezoneY+0.55;
action=QUOTE(0 call FUNC(toggle_solution_setup));
};
};
};

View File

@ -34,6 +34,7 @@ PREP(show_gun_list);
PREP(show_main_page);
PREP(show_range_card);
PREP(show_range_card_setup);
PREP(show_solution_setup);
PREP(show_target_data);
PREP(show_target_range_assist);
PREP(show_target_speed_assist);
@ -46,6 +47,7 @@ PREP(toggle_gun_ammo_data);
PREP(toggle_gun_list);
PREP(toggle_range_card);
PREP(toggle_range_card_setup);
PREP(toggle_solution_setup);
PREP(toggle_target_data);
PREP(toggle_target_range_assist);
PREP(toggle_target_speed_assist);
@ -59,6 +61,7 @@ PREP(update_range_card);
PREP(update_relative_click_memory);
PREP(update_result);
PREP(update_scope_unit);
PREP(update_solution_setup);
PREP(update_target);
PREP(update_target_data);
PREP(update_target_selection);

View File

@ -35,6 +35,7 @@ if (GVAR(showRangeCard)) then {
[] call FUNC(update_range_card);
};
GVAR(showRangeCardSetup) call FUNC(show_range_card_setup);
GVAR(showSolutionSetup) call FUNC(show_solution_setup);
GVAR(showTargetData) call FUNC(show_target_data);
GVAR(showTargetRangeAssist) call FUNC(show_target_range_assist);
GVAR(showTargetSpeedAssist) call FUNC(show_target_speed_assist);

View File

@ -18,6 +18,7 @@
[] call FUNC(parse_input);
GVAR(currentScopeUnit) = (GVAR(currentScopeUnit) + 1) % (count GVAR(scopeUnits));
GVAR(workingMemory) set [6, GVAR(currentScopeUnit)];
[] call FUNC(update_scope_unit);
[] call FUNC(update_result);

View File

@ -42,7 +42,9 @@ GVAR(currentGun) = 0;
GVAR(currentTarget) = 0;
GVAR(currentScopeUnit) = 0;
GVAR(currentScopeClickUnit) = 2;
GVAR(currentScopeClickUnitTemp) = 2;
GVAR(currentScopeClickNumber) = 10;
GVAR(currentScopeClickNumberTemp) = 10;
GVAR(atmosphereModeTBH) = true;
GVAR(altitude) = 0;
@ -74,6 +76,7 @@ GVAR(showGunAmmoData) = false;
GVAR(showGunList) = false;
GVAR(showRangeCard) = false;
GVAR(showRangeCardSetup) = false;
GVAR(showSolutionSetup) = false;
GVAR(showTargetData) = false;
GVAR(showTargetRangeAssist) = false;
GVAR(showTargetSpeedAssist) = false;

View File

@ -0,0 +1,20 @@
/*
* Author: Ruthberg
* Shows/Hides the solution setup controls
*
* Arguments:
* visible - <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* false call ace_atragmx_fnc_show_solution_setup
*
* Public: No
*/
#include "script_component.hpp"
GVAR(showSolutionSetup) = _this;
{ctrlShow [_x, _this]} forEach [15000, 15001, 15002, 15003, 15004, 15005, 15006, 15007, 15008, 15009, 15010, 15011, 15012];

View File

@ -0,0 +1,38 @@
/*
* Author: Ruthberg
* Toggles the solution setup screen on/off
*
* Arguments:
* Apply new data? <NUMBER>
*
* Return Value:
* Nothing
*
* Example:
* 1 call ace_atragmx_fnc_toggle_solution_setup
*
* Public: No
*/
#include "script_component.hpp"
if (ctrlVisible 15000) then {
false call FUNC(show_solution_setup);
true call FUNC(show_main_page);
if (_this == 1) then {
GVAR(currentScopeClickUnit) = GVAR(currentScopeClickUnitTemp);
GVAR(currentScopeClickNumber) = GVAR(currentScopeClickNumberTemp);
GVAR(workingMemory) set [7, GVAR(currentScopeClickUnit)];
GVAR(workingMemory) set [8, GVAR(currentScopeClickNumber)];
[] call FUNC(update_scope_unit);
[] call FUNC(update_result);
};
} else {
true call FUNC(show_solution_setup);
false call FUNC(show_main_page);
GVAR(currentScopeClickUnitTemp) = GVAR(currentScopeClickUnit);
GVAR(currentScopeClickNumberTemp) = GVAR(currentScopeClickNumber);
[] call FUNC(update_solution_setup);
};

View File

@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
private ["_range", "_elevation", "_windage1", "_windage2", "_elevationScopeStep", "_windageScopeStep", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput"];
private ["_range", "_elevation", "_windage1", "_windage2", "_clickSize", "_clickNumber", "_clickInterval", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput"];
_lastColumnOutput = "";
if (GVAR(showWind2) && GVAR(rangeCardCurrentColumn) == 0) then {
@ -54,12 +54,17 @@ lnbClear 5007;
_windage2 = _windage2 * 1.047;
};
case 3: {
_elevationScopeStep = (GVAR(workingMemory) select 7);
_windageScopeStep = (GVAR(workingMemory) select 8);
switch (GVAR(workingMemory) select 7) do {
case 0: { _clickSize = 1; };
case 1: { _clickSize = 1 / 1.047; };
case 2: { _clickSize = 3.38; };
};
_clickNumber = GVAR(workingMemory) select 8;
_clickInterval = _clickSize / _clickNumber;
_elevation = Round(_elevation / _elevationScopeStep);
_windage1 = Round(_windage1 / _windageScopeStep);
_windage2 = Round(_windage2 / _windageScopeStep);
_elevation = Round(_elevation / _clickInterval);
_windage1 = Round(_windage1 / _clickInterval);
_windage2 = Round(_windage2 / _clickInterval);
};
};

View File

@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_wind2", "_windageRel", "_windageCur", "_lead", "_elevationScopeStep", "_windageScopeStep"];
private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_wind2", "_windageRel", "_windageCur", "_lead", "_clickSize", "_clickNumber", "_clickInterval"];
_elevationAbs = GVAR(elevationOutput) select GVAR(currentTarget);
_windageAbs = GVAR(windage1Output) select GVAR(currentTarget);
@ -55,19 +55,24 @@ switch (GVAR(currentScopeUnit)) do {
_windageCur = _windageCur * 1.047;
};
case 3: {
_elevationScopeStep = (GVAR(workingMemory) select 7);
_windageScopeStep = (GVAR(workingMemory) select 8);
switch (GVAR(workingMemory) select 7) do {
case 0: { _clickSize = 1; };
case 1: { _clickSize = 1 / 1.047; };
case 2: { _clickSize = 3.38; };
};
_clickNumber = GVAR(workingMemory) select 8;
_clickInterval = _clickSize / _clickNumber;
_elevationAbs = Round(_elevationAbs / _elevationScopeStep);
_windageAbs = Round(_windageAbs / _windageScopeStep);
_elevationAbs = Round(_elevationAbs / _clickInterval);
_windageAbs = Round(_windageAbs / _clickInterval);
_wind2 = Round(_wind2 / _windageScopeStep);
_wind2 = Round(_wind2 / _clickInterval);
_elevationRel = Round(_elevationRel / _elevationScopeStep);
_windageRel = Round(_windageRel / _windageScopeStep);
_elevationRel = Round(_elevationRel / _clickInterval);
_windageRel = Round(_windageRel / _clickInterval);
_elevationCur = Round(_elevationCur / _elevationScopeStep);
_windageCur = Round(_windageCur / _windageScopeStep);
_elevationCur = Round(_elevationCur / _clickInterval);
_windageCur = Round(_windageCur / _clickInterval);
};
};

View File

@ -0,0 +1,31 @@
/*
* Author: Ruthberg
* Updates all solution setup input fields
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_update_solution_setup
*
* Public: No
*/
#include "script_component.hpp"
{((uiNamespace getVariable "ATragMX_Display") displayCtrl _x) ctrlEnable true} forEach [15001, 15002, 15003, 15004, 15005, 15006, 15008, 15009, 15010];
switch (GVAR(currentScopeClickNumberTemp)) do {
case 1: { ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15001) ctrlEnable false; };
case 2: { ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15002) ctrlEnable false; };
case 3: { ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15003) ctrlEnable false; };
case 4: { ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15004) ctrlEnable false; };
case 8: { ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15005) ctrlEnable false; };
case 10: { ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15006) ctrlEnable false; };
};
((uiNamespace getVariable "ATragMX_Display") displayCtrl (15008 + GVAR(currentScopeClickUnitTemp))) ctrlEnable false;
ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 15011);

View File

@ -15,10 +15,7 @@
*/
#include "script_component.hpp"
((uiNamespace getVariable "ATragMX_Display") displayCtrl 500) ctrlEnable true;
((uiNamespace getVariable "ATragMX_Display") displayCtrl 501) ctrlEnable true;
((uiNamespace getVariable "ATragMX_Display") displayCtrl 502) ctrlEnable true;
((uiNamespace getVariable "ATragMX_Display") displayCtrl 503) ctrlEnable true;
{((uiNamespace getVariable "ATragMX_Display") displayCtrl _x) ctrlEnable true} forEach [500, 501, 502, 503];
((uiNamespace getVariable "ATragMX_Display") displayCtrl 500 + GVAR(currentTarget)) ctrlEnable false;