Change aircraft altimiter to show height ASL

This commit is contained in:
PabstMirror 2017-02-04 13:50:52 -06:00
parent 06f99f044c
commit 5f392e3485
4 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,5 @@
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -10,6 +10,13 @@ class HScrollbar;
class RscLadderPicture;
class RscControlsGroupNoScrollbars;
class GVAR(aslAltitudeText): RscText {
style = 1;
colorText[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])", "(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])", "(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])", "(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])"};
sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class RscInGameUI {
class RscUnitInfo;
class Rsc_ACE_Helo_UI_Turret: RscUnitInfo {

View File

@ -0,0 +1,33 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
["ace_infoDisplayChanged", {
params ["_display", "_type"];
TRACE_2("ace_infoDisplayChanged",_display,_type);
if (_type == "Aircraft") then {
if (!(missionNamespace getVariable [QEGVAR(ui,vehicleAltitude), true])) exitWith {TRACE_1("Disabled in ace_ui",EGVAR(ui,vehicleAltitude));};
[{
params ["_display"];
private _oldCtrl = _display displayCtrl 122;
if (isNull _oldCtrl) exitWith {WARNING("old ctrl (122) is null");};
private _newCtrl = _display ctrlCreate [QGVAR(aslAltitudeText), -1];
TRACE_2("",_oldCtrl,_newCtrl);
private _pos = ctrlPosition _oldCtrl;
_newCtrl ctrlSetPosition _pos;
_newCtrl ctrlCommit 0;
_oldCtrl ctrlSetFade 1;
_oldCtrl ctrlCommit 0;
[{
_this ctrlSetText format ["%1", floor ((getPosASL vehicle ACE_player) select 2)];
isNull _this
}, {
TRACE_2("ctrl deleted",_this,isNull _this);
}, _newCtrl] call CBA_fnc_waitUntilAndExecute;
}, [_display]] call CBA_fnc_execNextFrame;
};
}] call CBA_fnc_addEventHandler;

View File

@ -17,6 +17,7 @@ class CfgPatches {
};
};
#include "CfgEventHandlers.hpp"
#include "CfgAmmo.hpp"
#include "CfgMagazines.hpp"
#include "CfgVehicles.hpp"