2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-04-11 21:40:46 +00:00
|
|
|
/*
|
|
|
|
* Author: Ruthberg
|
|
|
|
* Creates the ATragMX dialog
|
|
|
|
*
|
|
|
|
* Arguments:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2015-04-11 21:40:46 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2015-04-11 21:40:46 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2016-07-20 04:15:18 +00:00
|
|
|
* call ace_atragmx_fnc_create_dialog
|
2015-04-11 21:40:46 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2015-05-26 10:32:37 +00:00
|
|
|
#define __dsp (uiNamespace getVariable "ATragMX_Display")
|
|
|
|
#define __ctrlBackground (__dsp displayCtrl 720000)
|
|
|
|
|
2017-02-25 01:20:27 +00:00
|
|
|
// Do all initialisation now
|
|
|
|
if (!GVAR(initialised)) then {
|
|
|
|
[] call FUNC(initGunList);
|
|
|
|
[] call FUNC(init);
|
|
|
|
[] call FUNC(restore_user_data);
|
|
|
|
[] call FUNC(read_gun_list_entries_from_config);
|
|
|
|
GVAR(initialised) = true;
|
|
|
|
TRACE_1("",GVAR(initialised));
|
|
|
|
};
|
|
|
|
|
2020-02-23 01:11:20 +00:00
|
|
|
if (GVAR(active) || {!(call FUNC(can_show))}) exitWith {false};
|
2015-04-06 13:51:59 +00:00
|
|
|
|
|
|
|
createDialog 'ATragMX_Display';
|
|
|
|
|
2015-04-11 12:51:40 +00:00
|
|
|
call FUNC(update_target_selection);
|
|
|
|
|
2015-04-16 11:46:32 +00:00
|
|
|
GVAR(showMainPage) call FUNC(show_main_page);
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2015-04-16 11:46:32 +00:00
|
|
|
GVAR(showAddNewGun) call FUNC(show_add_new_gun);
|
2015-04-17 22:11:53 +00:00
|
|
|
GVAR(showAtmoEnvData) call FUNC(show_atmo_env_data);
|
2016-11-02 12:56:59 +00:00
|
|
|
GVAR(showC1BallisticCoefficientData) call FUNC(show_c1_ballistic_coefficient_data);
|
2015-04-17 22:11:53 +00:00
|
|
|
GVAR(showGunAmmoData) call FUNC(show_gun_ammo_data);
|
2015-04-16 11:46:32 +00:00
|
|
|
GVAR(showGunList) call FUNC(show_gun_list);
|
2016-11-02 12:56:59 +00:00
|
|
|
GVAR(showMuzzleVelocityData) call FUNC(show_muzzle_velocity_data);
|
2015-04-16 11:46:32 +00:00
|
|
|
GVAR(showRangeCard) call FUNC(show_range_card);
|
|
|
|
if (GVAR(showRangeCard)) then {
|
2015-04-16 17:52:20 +00:00
|
|
|
ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 5001);
|
2015-04-16 11:46:32 +00:00
|
|
|
[] call FUNC(update_range_card);
|
|
|
|
};
|
|
|
|
GVAR(showRangeCardSetup) call FUNC(show_range_card_setup);
|
2015-04-21 13:01:23 +00:00
|
|
|
GVAR(showSolutionSetup) call FUNC(show_solution_setup);
|
2016-05-03 00:32:44 +00:00
|
|
|
GVAR(showTargetData) call FUNC(show_target_data);
|
2015-04-16 11:46:32 +00:00
|
|
|
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);
|
2016-11-02 12:56:59 +00:00
|
|
|
GVAR(showTruingDrop) call FUNC(show_truing_drop);
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2015-04-19 15:40:49 +00:00
|
|
|
[GVAR(currentGun), false, true] call FUNC(change_gun);
|
2015-04-19 08:47:43 +00:00
|
|
|
|
2015-04-06 13:51:59 +00:00
|
|
|
{
|
2015-04-07 20:44:26 +00:00
|
|
|
lbAdd [6000, _x select 0];
|
2015-04-08 09:05:28 +00:00
|
|
|
} forEach GVAR(gunList);
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2016-11-02 12:56:59 +00:00
|
|
|
ctrlShow [3001, false];
|
|
|
|
ctrlShow [3002, false];
|
|
|
|
|
|
|
|
{
|
|
|
|
(__dsp displayCtrl _x) ctrlEnable false;
|
|
|
|
} forEach [18006, 18007, 18008];
|
|
|
|
|
2015-05-09 19:41:01 +00:00
|
|
|
GVAR(active) = true;
|
|
|
|
|
2015-05-26 10:32:37 +00:00
|
|
|
GVAR(DialogPFH) = [{
|
|
|
|
if (!GVAR(active)) exitWith {
|
2015-11-30 15:45:20 +00:00
|
|
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
2015-05-26 10:32:37 +00:00
|
|
|
};
|
2016-04-08 18:34:50 +00:00
|
|
|
__ctrlBackground ctrlSetText format [QPATHTOF(UI\ATRAG_%1.paa), ["N", "D"] select (call EFUNC(common,ambientBrightness))];
|
2015-08-04 07:34:31 +00:00
|
|
|
}, 60, []] call CBA_fnc_addPerFrameHandler;
|
2015-05-26 10:32:37 +00:00
|
|
|
|
2015-04-06 13:51:59 +00:00
|
|
|
true
|