2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-06-03 14:26:30 +00:00
|
|
|
/*
|
|
|
|
* Author: Ruthberg
|
|
|
|
* Shows the Yardage 450 screen elements
|
|
|
|
*
|
|
|
|
* Arguments:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2015-06-03 14:26:30 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2015-06-03 14:26:30 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2017-11-14 13:41:36 +00:00
|
|
|
* call ace_yardage450_fnc_turnOn
|
2015-06-03 14:26:30 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2024-04-02 13:26:42 +00:00
|
|
|
#define DISPLAY_YARDAGE (uiNamespace getVariable "ACE_RscYardage450")
|
|
|
|
#define CTRL_TARGET (DISPLAY_YARDAGE displayCtrl 720041)
|
|
|
|
#define CTRL_LASER (DISPLAY_YARDAGE displayCtrl 720042)
|
|
|
|
#define CTRL_RANGE (DISPLAY_YARDAGE displayCtrl 720043)
|
|
|
|
#define CTRL_METERS (DISPLAY_YARDAGE displayCtrl 720044)
|
|
|
|
#define CTRL_YARDS (DISPLAY_YARDAGE displayCtrl 720045)
|
2015-06-03 14:26:30 +00:00
|
|
|
|
|
|
|
if (currentWeapon ACE_player != "ACE_Yardage450" || cameraView != "GUNNER") exitWith {};
|
|
|
|
|
2016-03-02 10:01:39 +00:00
|
|
|
GVAR(powerOnTime) = CBA_missionTime;
|
2015-06-03 14:26:30 +00:00
|
|
|
|
|
|
|
if (GVAR(active)) exitWith {};
|
|
|
|
|
|
|
|
GVAR(active) = true;
|
|
|
|
|
|
|
|
[{
|
2016-03-02 10:01:39 +00:00
|
|
|
if (CBA_missionTime - GVAR(powerOnTime) > 30) exitWith {
|
2015-06-03 14:26:30 +00:00
|
|
|
GVAR(active) = false;
|
2024-04-01 11:28:08 +00:00
|
|
|
QUOTE(ADDON) cutText ["", "PLAIN"];
|
2015-06-03 14:26:30 +00:00
|
|
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
|
|
|
};
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2015-06-03 14:26:30 +00:00
|
|
|
if (currentWeapon ACE_player == "ACE_Yardage450" && cameraView == "GUNNER") then {
|
2024-04-02 13:26:42 +00:00
|
|
|
if (isNil {DISPLAY_YARDAGE} || {isNull DISPLAY_YARDAGE} || {ctrlIDD DISPLAY_YARDAGE != -1}) then {
|
|
|
|
TRACE_1("making display",DISPLAY_YARDAGE);
|
2024-04-01 11:28:08 +00:00
|
|
|
QUOTE(ADDON) cutRsc ["ACE_RscYardage450", "PLAIN", 1, false];
|
|
|
|
};
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2024-04-02 13:26:42 +00:00
|
|
|
CTRL_LASER ctrlShow GVAR(lasing);
|
2015-06-03 14:26:30 +00:00
|
|
|
if (GVAR(targetAcquired)) then {
|
2024-04-02 13:26:42 +00:00
|
|
|
CTRL_TARGET ctrlSetText "Target Acquired";
|
|
|
|
CTRL_RANGE ctrlSetText GVAR(targetRangeText);
|
2015-06-03 14:26:30 +00:00
|
|
|
} else {
|
2024-04-02 13:26:42 +00:00
|
|
|
CTRL_TARGET ctrlSetText "";
|
|
|
|
CTRL_RANGE ctrlSetText "---";
|
2015-06-03 14:26:30 +00:00
|
|
|
};
|
2024-04-02 13:26:42 +00:00
|
|
|
CTRL_METERS ctrlShow !GVAR(useYards);
|
|
|
|
CTRL_YARDS ctrlShow GVAR(useYards);
|
2015-06-03 14:26:30 +00:00
|
|
|
} else {
|
2024-04-01 11:28:08 +00:00
|
|
|
QUOTE(ADDON) cutText ["", "PLAIN"];
|
2015-06-03 14:26:30 +00:00
|
|
|
};
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2015-06-03 14:26:30 +00:00
|
|
|
}, 0, []] call CBA_fnc_addPerFrameHandler;
|