diff --git a/addons/units/CfgEventHandlers.hpp b/addons/units/CfgEventHandlers.hpp index e90bed419e..0d3301d6e0 100644 --- a/addons/units/CfgEventHandlers.hpp +++ b/addons/units/CfgEventHandlers.hpp @@ -3,11 +3,13 @@ class Extended_PreStart_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_preStart)); }; }; + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; + class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_postInit)); diff --git a/addons/units/config.cpp b/addons/units/config.cpp index 9d90326d5a..5b257acaf3 100644 --- a/addons/units/config.cpp +++ b/addons/units/config.cpp @@ -1,4 +1,5 @@ #include "script_component.hpp" +#include "\a3\ui_f\hpp\defineCommonGrids.inc" class CfgPatches { class ADDON { @@ -28,24 +29,24 @@ class RscInGameUI { class GVAR(alt): 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])"}; + 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])"}; text = "9999"; - x = "6.3 * (((safezoneW / safezoneH) min 1.2) / 40) + (profilenamespace getvariable [""IGUI_GRID_VEHICLE_X"", (safezoneX + 0.5 * (((safezoneW / safezoneH) min 1.2) / 40))])"; - y = "2.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getvariable [""IGUI_GRID_VEHICLE_Y"", (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; - w = "2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 6.3 * GUI_GRID_W + (profileNamespace getVariable ["IGUI_GRID_VEHICLE_X", (safezoneX + 0.5 * GUI_GRID_W)]); + y = 2.3 * GUI_GRID_H + (profileNamespace getVariable [""IGUI_GRID_VEHICLE_Y"", (safezoneY + 0.5 * GUI_GRID_H)]); + w = 2 * GUI_GRID_W; + h = 1 * GUI_GRID_H; + sizeEx = 0.8 * GUI_GRID_H; }; class GVAR(speed): 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])"}; + 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])"}; text = "9999"; - x = "6.3 * (((safezoneW / safezoneH) min 1.2) / 40) + (profilenamespace getvariable [""IGUI_GRID_VEHICLE_X"", (safezoneX + 0.5 * (((safezoneW / safezoneH) min 1.2) / 40))])"; - y = "1.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getvariable [""IGUI_GRID_VEHICLE_Y"", (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; - w = "2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + x = 6.3 * GUI_GRID_W + (profileNamespace getVariable ["IGUI_GRID_VEHICLE_X", (safezoneX + 0.5 * GUI_GRID_W)]); + y = 1.3 * GUI_GRID_H + (profileNamespace getVariable ["IGUI_GRID_VEHICLE_Y", (safezoneY + 0.5 * GUI_GRID_H)]); + w = 2 * GUI_GRID_W; + h = 1 * GUI_GRID_H; + sizeEx = 0.8 * GUI_GRID_H; }; #include "CfgEventHandlers.hpp" diff --git a/addons/units/functions/fnc_onAltLoad.sqf b/addons/units/functions/fnc_onAltLoad.sqf index d3e659cb7b..9b12ee9b7f 100644 --- a/addons/units/functions/fnc_onAltLoad.sqf +++ b/addons/units/functions/fnc_onAltLoad.sqf @@ -4,8 +4,8 @@ params ["_ctrl"]; private _alt = (ctrlParent _ctrl) ctrlCreate [QGVAR(alt), -1]; -private _units = (vehicle ace_player) call FUNC(altUnits); -private _altInfo = [_units select 0] call FUNC(altInfo); +private _units = (vehicle ACE_player) call FUNC(altUnits); +private _altInfo = _units call FUNC(altInfo); ((ctrlParent _alt) displayCtrl 1005) ctrlSetText (_altInfo select 0); GVAR(altRatio) = _altInfo select 1; @@ -28,7 +28,7 @@ private _settingEH = ["CBA_SettingChanged", { }; _ctrl ctrlSetFade 1; _ctrl ctrlCommit 0; - private _altValue = (((getPosATL vehicle ace_player) select 2) / GVAR(altRatio)); + private _altValue = (((getPosATL vehicle ACE_player) select 2) / GVAR(altRatio)); if (_altValue < 10) then { _altValue = _altValue toFixed 1; } else { diff --git a/addons/units/functions/fnc_onSpeedLoad.sqf b/addons/units/functions/fnc_onSpeedLoad.sqf index f9ba3572c8..b87b7b1975 100644 --- a/addons/units/functions/fnc_onSpeedLoad.sqf +++ b/addons/units/functions/fnc_onSpeedLoad.sqf @@ -4,8 +4,8 @@ params ["_ctrl"]; private _speed = (ctrlParent _ctrl) ctrlCreate [QGVAR(speed), -1]; -private _units = (vehicle ace_player) call FUNC(speedUnits); -private _speedInfo = [_units select 0] call FUNC(speedInfo); +private _units = (vehicle ACE_player) call FUNC(speedUnits); +private _speedInfo = _units call FUNC(speedInfo); ((ctrlParent _speed) displayCtrl 1004) ctrlSetText (_speedInfo select 0); GVAR(speedRatio) = _speedInfo select 1; @@ -28,5 +28,5 @@ private _settingEH = ["CBA_SettingChanged", { }; _ctrl ctrlSetFade 1; _ctrl ctrlCommit 0; - _speed ctrlSetText ((speed vehicle ace_player / GVAR(speedRatio)) toFixed 0); + _speed ctrlSetText ((speed vehicle ACE_player / GVAR(speedRatio)) toFixed 0); }, 0, [_ctrl, _speed, _settingEH]] call CBA_fnc_addPerFrameHandler;