The previous GUI state is now restored when you open the ATragMX

This commit is contained in:
ulteq 2015-04-16 13:46:32 +02:00
parent d6cadb593a
commit 55d9f7a3da
19 changed files with 94 additions and 70 deletions

View File

@ -23,15 +23,19 @@ createDialog 'ATragMX_Display';
call FUNC(update_target_selection);
true call FUNC(show_main_page);
GVAR(showMainPage) call FUNC(show_main_page);
false call FUNC(show_add_new_gun);
false call FUNC(show_gun_list);
false call FUNC(show_range_card);
false call FUNC(show_range_card_setup);
false call FUNC(show_target_range_assist);
false call FUNC(show_target_speed_assist);
false call FUNC(show_target_speed_assist_timer);
GVAR(showAddNewGun) call FUNC(show_add_new_gun);
GVAR(showGunList) call FUNC(show_gun_list);
GVAR(showRangeCard) call FUNC(show_range_card);
if (GVAR(showRangeCard)) then {
ctrlSetFocus (_dsp displayCtrl 5001);
[] call FUNC(update_range_card);
};
GVAR(showRangeCardSetup) call FUNC(show_range_card_setup);
GVAR(showTargetRangeAssist) call FUNC(show_target_range_assist);
GVAR(showTargetSpeedAssist) call FUNC(show_target_speed_assist);
GVAR(showTargetSpeedAssistTimer) call FUNC(show_target_speed_assist_timer);
{
lbAdd [6000, _x select 0];

View File

@ -56,3 +56,13 @@ GVAR(windageOutput) = [0, 0, 0, 0];
GVAR(leadOutput) = [0, 0, 0, 0];
GVAR(tofOutput) = [0, 0, 0, 0];
GVAR(velocityOutput) = [0, 0, 0, 0];
GVAR(showMainPage) = true;
GVAR(showAddNewGun) = false;
GVAR(showGunList) = false;
GVAR(showRangeCard) = false;
GVAR(showRangeCardSetup) = false;
GVAR(showTargetRangeAssist) = false;
GVAR(showTargetSpeedAssist) = false;
GVAR(showTargetSpeedAssistTimer) = false;

View File

@ -15,4 +15,6 @@
*/
#include "script_component.hpp"
GVAR(showAddNewGun) = _this;
{ctrlShow [_x, _this]} forEach [11000, 11001, 11002, 11003];

View File

@ -15,4 +15,12 @@
*/
#include "script_component.hpp"
{ctrlShow [_x, _this]} forEach [6000, 6001, 6002, 6003, 6004, 6005, 6006, 6007];
GVAR(showGunList) = _this;
{ctrlShow [_x, _this]} forEach [6000, 6001, 6002, 6003, 6004, 6005, 6006, 6007];
if (_this) then {
ctrlSetFocus (_dsp displayCtrl 6002);
lbSetCurSel [6000, (GVAR(currentGun) select GVAR(currentTarget))];
};

View File

@ -15,5 +15,7 @@
*/
#include "script_component.hpp"
GVAR(showMainPage) = _this;
{ctrlShow [_x, _this]} forEach [10, 100, 11, 110, 12, 120, 13, 130, 14, 140, 20, 200, 21, 210, 22, 220, 30, 300, 31, 310, 32, 320, 33, 330, 34, 340, 40, 400, 401, 402, 403, 41, 410, 411, 412, 42, 420,
500, 501, 502, 503, 600, 601, 602, 603, 1000, 2000, 3000, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008];

View File

@ -15,4 +15,6 @@
*/
#include "script_component.hpp"
GVAR(showRangeCard) = _this;
{ctrlShow [_x, _this]} forEach [5000, 5001, 5002, 5003, 5004, 5005, 5006, 5007];

View File

@ -15,4 +15,14 @@
*/
#include "script_component.hpp"
GVAR(showRangeCardSetup) = _this;
{ctrlShow [_x, _this]} forEach [10000, 10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009];
if (_this) then {
ctrlSetFocus (_dsp displayCtrl 10006);
ctrlSetText [10003, Str(Round(GVAR(rangeCardStartRange)))];
ctrlSetText [10004, Str(Round(GVAR(rangeCardEndRange)))];
ctrlSetText [10005, Str(Round(GVAR(rangeCardIncrement)))];
};

View File

@ -15,4 +15,21 @@
*/
#include "script_component.hpp"
GVAR(showTargetRangeAssist) = _this;
{ctrlShow [_x, _this]} forEach [7000, 7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020];
if (_this) then {
ctrlSetFocus (_dsp displayCtrl 7018);
ctrlSetText [7012, Str(parseNumber(ctrlText 320))];
ctrlSetText [7013, Str(parseNumber(ctrlText 340))];
if (GVAR(currentUnit) != 2) then
{
ctrlSetText [7016, "Yards"];
} else
{
ctrlSetText [7016, "Meters"];
};
};

View File

@ -15,4 +15,28 @@
*/
#include "script_component.hpp"
GVAR(showTargetSpeedAssist) = _this;
{ctrlShow [_x, _this]} forEach [8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015];
if (_this) then {
ctrlSetFocus (_dsp displayCtrl 8012);
ctrlSetText [8004, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))];
if (GVAR(currentUnit) != 2) then
{
ctrlSetText [8008, "Yards"];
} else
{
ctrlSetText [8008, "Meters"];
};
if (GVAR(currentUnit) != 1) then
{
ctrlSetText [8011, "m/s"];
} else
{
ctrlSetText [8011, "mph"];
};
};

View File

@ -15,4 +15,6 @@
*/
#include "script_component.hpp"
GVAR(showTargetSpeedAssistTimer) = _this;
{ctrlShow [_x, _this]} forEach [9000, 9001, 9002];

View File

@ -15,8 +15,6 @@
*/
#include "script_component.hpp"
#define _dsp (uiNamespace getVariable "ATragMX_Display")
if !(ctrlVisible 9000) then {
false call FUNC(show_target_speed_assist);

View File

@ -15,8 +15,6 @@
*/
#include "script_component.hpp"
#define _dsp (uiNamespace getVariable "ATragMX_Display")
if (ctrlVisible 6000) then
{
false call FUNC(show_gun_list);
@ -29,8 +27,4 @@ if (ctrlVisible 6000) then
{
false call FUNC(show_main_page);
true call FUNC(show_gun_list);
ctrlSetFocus (_dsp displayCtrl 6002);
lbSetCurSel [6000, (GVAR(currentGun) select GVAR(currentTarget))];
};

View File

@ -15,8 +15,6 @@
*/
#include "script_component.hpp"
#define _dsp (uiNamespace getVariable "ATragMX_Display")
if (ctrlVisible 5006) then
{
false call FUNC(show_range_card);

View File

@ -3,7 +3,7 @@
* Toggles the range card setup screen on/off
*
* Arguments:
* Nothing
* Apply new range card settings <BOOL>
*
* Return Value:
* Nothing
@ -15,8 +15,6 @@
*/
#include "script_component.hpp"
#define _dsp (uiNamespace getVariable "ATragMX_Display")
if (ctrlVisible 10000) then
{
false call FUNC(show_range_card_setup);
@ -35,10 +33,4 @@ if (ctrlVisible 10000) then
{
false call FUNC(show_range_card);
true call FUNC(show_range_card_setup);
ctrlSetFocus (_dsp displayCtrl 10006);
ctrlSetText [10003, Str(Round(GVAR(rangeCardStartRange)))];
ctrlSetText [10004, Str(Round(GVAR(rangeCardEndRange)))];
ctrlSetText [10005, Str(Round(GVAR(rangeCardIncrement)))];
};

View File

@ -15,8 +15,6 @@
*/
#include "script_component.hpp"
#define _dsp (uiNamespace getVariable "ATragMX_Display")
if (ctrlVisible 7000) then
{
false call FUNC(show_target_range_assist);
@ -31,17 +29,4 @@ if (ctrlVisible 7000) then
{
false call FUNC(show_main_page);
true call FUNC(show_target_range_assist);
ctrlSetFocus (_dsp displayCtrl 7018);
ctrlSetText [7012, Str(parseNumber(ctrlText 320))];
ctrlSetText [7013, Str(parseNumber(ctrlText 340))];
if (GVAR(currentUnit) != 2) then
{
ctrlSetText [7016, "Yards"];
} else
{
ctrlSetText [7016, "Meters"];
};
};

View File

@ -15,8 +15,6 @@
*/
#include "script_component.hpp"
#define _dsp (uiNamespace getVariable "ATragMX_Display")
if (ctrlVisible 8000) then
{
false call FUNC(show_target_speed_assist);
@ -31,24 +29,4 @@ if (ctrlVisible 8000) then
{
false call FUNC(show_main_page);
true call FUNC(show_target_speed_assist);
ctrlSetFocus (_dsp displayCtrl 8012);
ctrlSetText [8004, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))];
if (GVAR(currentUnit) != 2) then
{
ctrlSetText [8008, "Yards"];
} else
{
ctrlSetText [8008, "Meters"];
};
if (GVAR(currentUnit) != 1) then
{
ctrlSetText [8011, "m/s"];
} else
{
ctrlSetText [8011, "mph"];
};
};

View File

@ -15,8 +15,6 @@
*/
#include "script_component.hpp"
#define _dsp (uiNamespace getVariable "ATragMX_Display")
(_dsp displayCtrl 500) ctrlEnable true;
(_dsp displayCtrl 501) ctrlEnable true;
(_dsp displayCtrl 502) ctrlEnable true;

View File

@ -15,8 +15,6 @@
*/
#include "script_component.hpp"
#define _dsp (uiNamespace getVariable "ATragMX_Display")
(_dsp displayCtrl 600) ctrlEnable true;
(_dsp displayCtrl 601) ctrlEnable true;
(_dsp displayCtrl 602) ctrlEnable true;

View File

@ -9,4 +9,6 @@
#define DEBUG_SETTINGS DEBUG_SETTINGS_ATRAGMX
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#include "\z\ace\addons\main\script_macros.hpp"
#define _dsp (uiNamespace getVariable "ATragMX_Display")