ACE3/addons/mk6mortar/functions/fnc_turretDisplayLoaded.sqf

68 lines
3.3 KiB
Plaintext
Raw Normal View History

2015-04-05 06:57:24 +00:00
/*
* Author: PabstMirror
2015-04-05 22:50:07 +00:00
* Called when the mk6's in game UI is loaded. Hides rangefinder data if it is disabled.
2015-04-05 06:57:24 +00:00
*
* Arguments:
2015-04-05 22:50:07 +00:00
* None
2015-04-05 06:57:24 +00:00
*
* Return Value:
2015-04-05 22:50:07 +00:00
* None
2015-04-05 06:57:24 +00:00
*
* Example:
2015-04-06 06:05:28 +00:00
* [] call ace_mk6mortar_fnc_turretDisplayLoaded
2015-04-05 06:57:24 +00:00
*
* Public: No
*/
#include "script_component.hpp"
#define CTRL_CA_OPTICSPITCH (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_OPTICSPITCH")
#define CTRL_CA_OPTICSZOOM (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_OPTICSZOOM")
#define CTRL_CA_SOLUTION_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_SOLUTION_TEXT")
#define CTRL_CA_DISTANCE_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_DISTANCE_TEXT")
#define CTRL_CA_DISTANCE (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_DISTANCE")
#define CTRL_CA_TIME_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_TIME_TEXT")
#define CTRL_CA_TIME (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_TIME")
#define CTRL_CA_ELEV_NEED_TEXT (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_ELEV_NEED_TEXT")
#define CTRL_CA_RANGEELEMENTS_GROUP (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_RangeElements_group")
2015-04-05 19:34:39 +00:00
#define CTRL_CA_HEADING (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_Heading")
2015-04-05 06:57:24 +00:00
#define CTRL_CA_ELEV (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_ELEV")
#define CTRL_CA_ELEV_NEED (configFile >> "RscInGameUI" >> "ACE_Mk6_RscWeaponRangeArtillery" >> "CA_IGUI_elements_group" >> "controls" >> "CA_ELEV_NEED")
2015-04-08 00:30:07 +00:00
private ["_display", "_fnc_hideControl"];
2015-04-06 06:05:28 +00:00
2015-04-05 06:57:24 +00:00
disableSerialization;
_display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull];
if (isNull _display) exitWith {};
_fnc_hideControl = {
2015-04-08 00:30:07 +00:00
private "_idc";
2015-04-05 06:57:24 +00:00
PARAMS_2(_path,_hideCtrl);
_idc = getNumber (_path >> "IDC");
_pos = [];
if (_hideCtrl) then {
_pos = [-9,-9,0,0];
} else {
{
if (isNumber (_path >> _x)) then {
_pos pushBack (getNumber (_path >> _x));
} else {
_pos pushBack (call compile (getText (_path >> _x)));
};
} forEach ["x", "y", "w", "h"];
};
(_display displayCtrl _idc) ctrlSetPosition _pos;
(_display displayCtrl _idc) ctrlCommit 0;
};
{
2015-04-05 19:48:26 +00:00
[_x, (!GVAR(allowComputerRangefinder))] call _fnc_hideControl;
2015-04-05 19:34:39 +00:00
} forEach [CTRL_CA_OPTICSPITCH, CTRL_CA_OPTICSZOOM, CTRL_CA_SOLUTION_TEXT, CTRL_CA_DISTANCE_TEXT, CTRL_CA_DISTANCE, CTRL_CA_TIME_TEXT, CTRL_CA_TIME, CTRL_CA_ELEV_NEED_TEXT, CTRL_CA_RANGEELEMENTS_GROUP];
2015-04-05 06:57:24 +00:00
2015-04-05 19:34:39 +00:00
//Always hide these, handled by the mil convertions PFEH in handlePlayerVehChanged
[CTRL_CA_HEADING, true] call _fnc_hideControl;
2015-04-05 06:57:24 +00:00
[CTRL_CA_ELEV, true] call _fnc_hideControl;
[CTRL_CA_ELEV_NEED, true] call _fnc_hideControl;
2015-04-05 19:34:39 +00:00