From e06658f71313a2147327072451f565550809bbcf Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 15 Jan 2023 15:23:41 -0600 Subject: [PATCH 01/21] Hemmit Config Compat --- .gitignore | 1 + addons/diagnostic/CfgDisplay3DEN.hpp | 6 +- addons/diagnostic/CfgFunctions.hpp | 2 +- addons/diagnostic/gui.hpp | 30 +- addons/jr/config.cpp | 14 +- addons/keybinding/gui.hpp | 134 +++---- addons/optics/RscInGameUI.hpp | 34 +- addons/settings/Display3DEN.hpp | 2 +- addons/settings/gui.hpp | 502 +++++++++++++------------- addons/strings/fnc_decodeURL.sqf | 220 +++++++++++ addons/strings/script_component.hpp | 220 ----------- addons/ui/CfgUIGrids.hpp | 24 +- addons/ui/Display3DEN.hpp | 2 +- addons/ui/LobbyManager.hpp | 106 +++--- addons/ui/RscDisplayOptionsLayout.hpp | 2 +- addons/ui/RscTitles.hpp | 22 +- addons/ui/config.cpp | 12 +- addons/xeh/CfgFunctions.hpp | 12 +- hemtt.toml | 2 - 19 files changed, 673 insertions(+), 674 deletions(-) diff --git a/.gitignore b/.gitignore index 5b388ddcd6..5bdeb94482 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ release/* releases/* keys/* +.hemtt hemtt hemtt.exe tools/hemtt*.tar.gz* diff --git a/addons/diagnostic/CfgDisplay3DEN.hpp b/addons/diagnostic/CfgDisplay3DEN.hpp index 71ed42dc6d..cf4ec8e966 100644 --- a/addons/diagnostic/CfgDisplay3DEN.hpp +++ b/addons/diagnostic/CfgDisplay3DEN.hpp @@ -5,13 +5,13 @@ class Display3DEN { class MenuStrip: ctrlMenuStrip { class Items { class DebugConsole { - shortcuts[] = {INPUT_CTRL_OFFSET + DIK_D}; + shortcuts[] = {QUOTE(INPUT_CTRL_OFFSET + DIK_D)}; }; class FunctionsViewer { - shortcuts[] = {INPUT_ALT_OFFSET + DIK_F}; + shortcuts[] = {QUOTE(INPUT_ALT_OFFSET + DIK_F)}; }; class ConfigViewer { - shortcuts[] = {INPUT_ALT_OFFSET + DIK_G}; + shortcuts[] = {QUOTE(INPUT_ALT_OFFSET + DIK_G)}; }; }; }; diff --git a/addons/diagnostic/CfgFunctions.hpp b/addons/diagnostic/CfgFunctions.hpp index 3a6fa3d83c..f795bc2f27 100644 --- a/addons/diagnostic/CfgFunctions.hpp +++ b/addons/diagnostic/CfgFunctions.hpp @@ -19,7 +19,7 @@ class CfgFunctions { class A3 { class Debug { class isDebugConsoleAllowed { - file = PATHTOF(fnc_isDebugConsoleAllowed.sqf); + file = QPATHTOF(fnc_isDebugConsoleAllowed.sqf); }; }; }; diff --git a/addons/diagnostic/gui.hpp b/addons/diagnostic/gui.hpp index 14628987e6..ff7f0d8fc6 100644 --- a/addons/diagnostic/gui.hpp +++ b/addons/diagnostic/gui.hpp @@ -13,11 +13,11 @@ class RscTitles { onLoad = QUOTE(uiNamespace setVariable [ARR_2('GVAR(Error)',_this select 0)]); idc = -1; font = "RobotoCondensedBold"; - sizeEx = 0.55 * GUI_GRID_CENTER_H; - x = 0 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X; - y = 5 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y; - w = 40 * GUI_GRID_CENTER_W; - h = 10 * GUI_GRID_CENTER_H; + sizeEx = QUOTE(0.55 * GUI_GRID_CENTER_H); + x = QUOTE( 0 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X); + y = QUOTE( 5 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y); + w = QUOTE(40 * GUI_GRID_CENTER_W); + h = QUOTE(10 * GUI_GRID_CENTER_H); colorBackground[] = {1,0.2,0,0.8}; }; }; @@ -29,11 +29,11 @@ class GVAR(watchInput): RscEdit { autocomplete = "scripting"; shadow = 0; font = "EtelkaMonospacePro"; - x = 0.5 * GUI_GRID_W; - y = 11 * GUI_GRID_H; - w = 21 * GUI_GRID_W; - h = 1 * GUI_GRID_H; - sizeEx = 0.7 * GUI_GRID_H; + x = QUOTE(0.5 * GUI_GRID_W); + y = QUOTE(11 * GUI_GRID_H); + w = QUOTE(21 * GUI_GRID_W); + h = QUOTE(1 * GUI_GRID_H); + sizeEx = QUOTE(0.7 * GUI_GRID_H); }; class GVAR(watchOutput): RscEdit { @@ -41,10 +41,10 @@ class GVAR(watchOutput): RscEdit { style = ST_NO_RECT; shadow = 0; font = "EtelkaMonospacePro"; - x = 0.5 * GUI_GRID_W; - y = 12 * GUI_GRID_H; - w = 21 * GUI_GRID_W; - h = 1 * GUI_GRID_H; + x = QUOTE(0.5 * GUI_GRID_W); + y = QUOTE(12 * GUI_GRID_H); + w = QUOTE(21 * GUI_GRID_W); + h = QUOTE(1 * GUI_GRID_H); colorBackground[] = {0,0,0,0.75}; - sizeEx = 0.7 * GUI_GRID_H; + sizeEx = QUOTE(0.7 * GUI_GRID_H); }; diff --git a/addons/jr/config.cpp b/addons/jr/config.cpp index 11c2e00edc..b569af19ae 100644 --- a/addons/jr/config.cpp +++ b/addons/jr/config.cpp @@ -1,13 +1,13 @@ #include "script_component.hpp" -#define private 0 // hidden -#define protected 1 // hidden but usable -#define public 2 // visible +#define private 0 +#define protected 1 +#define public 2 -#define ReadAndWrite 0 //! any modifications enabled -#define ReadAndCreate 1 //! only adding new class members is allowed -#define ReadOnly 2 //! no modifications enabled -#define ReadOnlyVerified 3 //! no modifications enabled, CRC test applied +#define ReadAndWrite 0 +#define ReadAndCreate 1 +#define ReadOnly 2 +#define ReadOnlyVerified 3 class CfgPatches { class ADDON { diff --git a/addons/keybinding/gui.hpp b/addons/keybinding/gui.hpp index 4f071c6fef..eb7c4dde81 100644 --- a/addons/keybinding/gui.hpp +++ b/addons/keybinding/gui.hpp @@ -9,10 +9,10 @@ class RscStructuredText; class GVAR(key): RscControlsGroupNoScrollbars { idc = -1; enableDisplay = 0; - x = POS_W(0); - y = POS_H(0); - w = POS_W(37); - h = POS_H(1); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(37)); + h = QUOTE(POS_H(1)); class controls { class EditButton: RscButton { @@ -28,10 +28,10 @@ class GVAR(key): RscControlsGroupNoScrollbars { tooltipColorBox[] = {1,1,1,1}; tooltipColorShade[] = {0,0,0,0.7}; tooltipColorText[] = {1,1,1,1}; - x = POS_W(0); - y = POS_H(0); - w = POS_W(17); - h = POS_H(1); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(17)); + h = QUOTE(POS_H(1)); }; class AssignedKey: RscStructuredText { @@ -40,46 +40,46 @@ class GVAR(key): RscControlsGroupNoScrollbars { tooltipColorBox[] = {1,1,1,1}; tooltipColorShade[] = {0,0,0,0.7}; tooltipColorText[] = {1,1,1,1}; - x = POS_W(17); - y = POS_H(0); - w = POS_W(20); - h = POS_H(1); + x = QUOTE(POS_W(17)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(20)); + h = QUOTE(POS_H(1)); }; }; }; class GVAR(subCat): RscControlsGroupNoScrollbars { - x = POS_W(1); - y = POS_H(0); - w = POS_W(37); - h = POS_H(1); + x = QUOTE(POS_W(1)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(37)); + h = QUOTE(POS_H(1)); class controls { class Background: RscText { colorBackground[] = {0.15,0.15,0.15,0.4}; - x = POS_W(0); - y = POS_H(0); - w = POS_W(36); - h = POS_H(1); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(36)); + h = QUOTE(POS_H(1)); }; class Name: RscText { idc = IDC_SUBCATEGORY_NAME; style = ST_LEFT; - SizeEx = POS_H(1); - x = POS_W(0); - y = POS_H(0); - w = POS_W(15.5); - h = POS_H(1); + SizeEx = QUOTE(POS_H(1)); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(15.5)); + h = QUOTE(POS_H(1)); }; class Bar: RscText { colorBackground[] = {1,1,1,1}; style = ST_LEFT; - x = POS_W(0); - y = POS_H(1) - 2 * pixelH; - w = POS_W(36); - h = pixelH; + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(1) - 2 * pixelH); + w = QUOTE(POS_W(36)); + h = QUOTE(pixelH); }; }; }; @@ -90,77 +90,77 @@ class RscDisplayConfigure { onButtonClick = QUOTE(_this call (uiNamespace getVariable 'FUNC(gui_configure)')); idc = IDC_BTN_CONFIGURE_ADDONS; text = CSTRING(configureAddons); - x = POS_X(20.15); - y = POS_Y(23); - w = POS_W(12.5); - h = POS_H(1); + x = QUOTE(POS_X(20.15)); + y = QUOTE(POS_Y(23)); + w = QUOTE(POS_W(12.5)); + h = QUOTE(POS_H(1)); }; class CBA_ButtonKeyboardFake: RscButtonMenu { idc = IDC_BTN_KEYBOARD_FAKE; text = "$STR_A3_RscDisplayConfigure_ButtonKeyboard"; - x = POS_X(1); - y = POS_Y(2.1); - w = POS_W(8); - h = POS_H(1); + x = QUOTE(POS_X(1)); + y = QUOTE(POS_Y(2.1)); + w = QUOTE(POS_W(8)); + h = QUOTE(POS_H(1)); }; class CBA_AddonsGroup: RscControlsGroupNoScrollbars { idc = IDC_ADDONS_GROUP; enableDisplay = 0; - x = POS_X(1); - y = POS_Y(3.1); - w = POS_W(38); - h = POS_H(19.6); + x = QUOTE(POS_X(1)); + y = QUOTE(POS_Y(3.1)); + w = QUOTE(POS_W(38)); + h = QUOTE(POS_H(19.6)); class controls { class Background: RscText { colorBackground[] = {0, 0, 0, 0.4}; - x = POS_W(0.5); - y = POS_H(3.5); - w = POS_W(37); - h = POS_H(15.8); + x = QUOTE(POS_W(0.5)); + y = QUOTE(POS_H(3.5)); + w = QUOTE(POS_W(37)); + h = QUOTE(POS_H(15.8)); }; class AddonText: RscText { style = ST_RIGHT; text = ECSTRING(main,AddonText); - x = POS_W(0.5); - y = POS_H(1); - w = POS_W(4); - h = POS_H(1); - sizeEx = POS_H(1); + x = QUOTE(POS_W(0.5)); + y = QUOTE(OS_H(1)); + w = QUOTE(POS_W(4)); + h = QUOTE(POS_H(1)); + sizeEx = QUOTE(POS_H(1)); }; class AddonsList: RscCombo { idc = IDC_ADDON_LIST; - x = POS_W(4.5); - y = POS_H(1); - w = POS_W(21); - h = POS_H(1); - wholeHeight = POS_H(12); + x = QUOTE(POS_W(4.5)); + y = QUOTE(POS_H(1)); + w = QUOTE(POS_W(21)); + h = QUOTE(POS_H(1)); + wholeHeight = QUOTE(POS_H(12)); }; class KeyList: RscControlsGroup { idc = IDC_KEY_LIST; - x = POS_W(0.5); - y = POS_H(3.5); - w = POS_W(37); - h = POS_H(15.8); + x = QUOTE(POS_W(0.5)); + y = QUOTE(POS_H(3.5)); + w = QUOTE(POS_W(37)); + h = QUOTE(POS_H(15.8)); }; class TextAction: RscText { onLoad = "(_this select 0) ctrlSetText toUpper ctrlText (_this select 0)"; text = "$STR_A3_RscDisplayConfigure_TextAction"; - x = POS_W(0.5); - y = POS_H(2.5); - w = POS_W(17); - h = POS_H(1); + x = QUOTE(POS_W(0.5)); + y = QUOTE(POS_H(2.5)); + w = QUOTE(POS_W(17)); + h = QUOTE(POS_H(1)); colorBackground[] = {0, 0, 0, 1}; }; class TextAssignedKeys: RscText { onLoad = "(_this select 0) ctrlSetText toUpper ctrlText (_this select 0)"; text = "$STR_A3_RscDisplayConfigure_TextAssignedKeys"; - x = POS_W(17.5); - y = POS_H(2.5); - w = POS_W(20); - h = POS_H(1); + x = QUOTE(POS_W(17.5)); + y = QUOTE(POS_H(2.5)); + w = QUOTE(POS_W(20)); + h = QUOTE(POS_H(1)); colorBackground[] = {0, 0, 0, 1}; }; }; diff --git a/addons/optics/RscInGameUI.hpp b/addons/optics/RscInGameUI.hpp index f173cf52bb..71d02eb0d2 100644 --- a/addons/optics/RscInGameUI.hpp +++ b/addons/optics/RscInGameUI.hpp @@ -39,26 +39,26 @@ class RscInGameUI { class ScopeBlack: RscPicture { idc = IDC_BLACK_SCOPE; text = QPATHTOF(reticles\scopeblack_ca.paa); - x = POS_X(2); - y = POS_Y(2); - w = POS_W(2); - h = POS_H(2); + x = QUOTE(POS_X(2)); + y = QUOTE(POS_Y(2)); + w = QUOTE(POS_W(2)); + h = QUOTE(POS_H(2)); }; // These are just black side panels to cover the areas that the optics p3d doesn't cover. // It will ONLY effect tripple head users, as (safeZoneX == safeZoneXAbs) for everyone else. class TrippleHeadLeft: RscText { idc = IDC_BLACK_LEFT; - x = safezoneXAbs; - y = safezoneY; - w = THIRD_SCREEN_WIDTH; - h = safezoneH; + x = QUOTE(safezoneXAbs); + y = QUOTE(safezoneY); + w = QUOTE(THIRD_SCREEN_WIDTH); + h = QUOTE(safezoneH); colorBackground[] = {0,0,0,1}; }; class TrippleHeadRight: TrippleHeadLeft { idc = IDC_BLACK_RIGHT; - x = safezoneXAbs + safezoneWAbs - THIRD_SCREEN_WIDTH; + x = QUOTE(safezoneXAbs + safezoneWAbs - THIRD_SCREEN_WIDTH); }; class Magnification: CA_Zeroing { @@ -79,18 +79,18 @@ class RscInGameUI { class RedDot: RscPicture { idc = IDC_RED_DOT; text = "\a3\weapons_f\acc\data\collimdot_red_ca.paa"; // alt: green - x = POS_X(0.025); - y = POS_Y(0.025); - w = POS_W(0.025); - h = POS_H(0.025); + x = QUOTE(POS_X(0.025)); + y = QUOTE(POS_Y(0.025)); + w = QUOTE(POS_W(0.025)); + h = QUOTE(POS_H(0.025)); }; class ReticleSafeZone: RscControlsGroupNoScrollbars { idc = IDC_RETICLE_SAFEZONE; - x = RETICLE_SAFEZONE_DEFAULT_LEFT; - y = RETICLE_SAFEZONE_DEFAULT_TOP; - w = RETICLE_SAFEZONE_DEFAULT_WIDTH; - h = RETICLE_SAFEZONE_DEFAULT_HEIGHT; + x = QUOTE(RETICLE_SAFEZONE_DEFAULT_LEFT); + y = QUOTE(RETICLE_SAFEZONE_DEFAULT_TOP); + w = QUOTE(RETICLE_SAFEZONE_DEFAULT_WIDTH); + h = QUOTE(RETICLE_SAFEZONE_DEFAULT_HEIGHT); class controls { class Reticle: Reticle {}; diff --git a/addons/settings/Display3DEN.hpp b/addons/settings/Display3DEN.hpp index b9098e0a51..83000f9548 100644 --- a/addons/settings/Display3DEN.hpp +++ b/addons/settings/Display3DEN.hpp @@ -11,7 +11,7 @@ class Display3DEN { text = CSTRING(3den_shortcut); action = QUOTE(findDisplay 313 call FUNC(openSettingsMenu)); data = QUOTE(ADDON); - shortcuts[] = {INPUT_CTRL_OFFSET + INPUT_ALT_OFFSET + DIK_S}; + shortcuts[] = {QUOTE(INPUT_CTRL_OFFSET + INPUT_ALT_OFFSET + DIK_S)}; }; }; }; diff --git a/addons/settings/gui.hpp b/addons/settings/gui.hpp index 4df25ede5e..a017affcf5 100644 --- a/addons/settings/gui.hpp +++ b/addons/settings/gui.hpp @@ -11,79 +11,79 @@ class RscDisplayGameOptions { class CBA_ButtonConfigureAddons: RscButtonMenu { idc = IDC_BTN_CONFIGURE_ADDONS; text = CSTRING(configureAddons); - x = POS_X(20.15); - y = POS_Y(23); - w = POS_W(12.5); - h = POS_H(1); + x = QUOTE(POS_X(20.15)); + y = QUOTE(POS_Y(23)); + w = QUOTE(POS_W(12.5)); + h = QUOTE(POS_H(1)); }; class CBA_ButtonServer: RscButtonMenu { idc = IDC_BTN_SERVER; text = CSTRING(ButtonServer); tooltip = CSTRING(ButtonServer_tooltip); - x = POS_X(1); - y = POS_Y(2.1); - w = POS_W(8); - h = POS_H(1); + x = QUOTE(POS_X(1)); + y = QUOTE(POS_Y(2.1)); + w = QUOTE(POS_W(8)); + h = QUOTE(POS_H(1)); }; class CBA_ButtonMission: CBA_ButtonServer { idc = IDC_BTN_MISSION; text = CSTRING(ButtonMission); tooltip = CSTRING(ButtonMission_tooltip); - x = POS_X(9); + x = QUOTE(POS_X(9)); }; class CBA_ButtonClient: CBA_ButtonServer { idc = IDC_BTN_CLIENT; text = CSTRING(ButtonClient); tooltip = CSTRING(ButtonClient_tooltip); - x = POS_X(17); + x = QUOTE(POS_X(17)); }; class CBA_AddonsGroup: RscControlsGroupNoScrollbars { idc = IDC_ADDONS_GROUP; enableDisplay = 0; - x = POS_X(1); - y = POS_Y(3.1); - w = POS_W(38); - h = POS_H(17.3); + x = QUOTE(POS_X(1)); + y = QUOTE(POS_Y(3.1)); + w = QUOTE(POS_W(38)); + h = QUOTE(POS_H(17.3)); class controls { class Background: RscText { idc = -1; colorBackground[] = {0,0,0,0.4}; - x = POS_W(0.5); - y = POS_H(3.5); - w = POS_W(37); - h = POS_H(13.8); + x = QUOTE(POS_W(0.5)); + y = QUOTE(POS_H(3.5)); + w = QUOTE(POS_W(37)); + h = QUOTE(POS_H(13.8)); }; class AddonText: RscText { idc = -1; style = ST_RIGHT; text = ECSTRING(main,AddonText); - x = POS_W(0.5); - y = POS_H(1); - w = POS_W(4); - h = POS_H(1); - sizeEx = POS_H(1); + x = QUOTE(POS_W(0.5)); + y = QUOTE(POS_H(1)); + w = QUOTE(POS_W(4)); + h = QUOTE(POS_H(1)); + sizeEx = QUOTE(POS_H(1)); }; class OverwriteClientText: RscText { // Set tooltip per script to avoid it being all upper case. // Disable multiline text to make in unselectable. onLoad = QUOTE((_this select 0) ctrlSetText localize QUOTE(LSTRING(overwrite_clients)); (_this select 0) ctrlEnable false;); idc = IDC_TXT_OVERWRITE_CLIENT; - style = ST_MULTI + ST_CENTER; - x = POS_W(30); - y = POS_H(2); - w = POS_W(4); - h = POS_H(2*3/4); - sizeEx = POS_H(3/4); + style = QUOTE(ST_MULTI + ST_CENTER); + x = QUOTE(POS_W(30)); + y = QUOTE(POS_H(2)); + w = QUOTE(POS_W(4)); + h = QUOTE(POS_H(2*3/4)); + sizeEx = QUOTE(POS_H(3/4)); }; class OverwriteMissionText: OverwriteClientText { onLoad = QUOTE((_this select 0) ctrlSetText localize QUOTE(LSTRING(overwrite_mission)); (_this select 0) ctrlEnable false;); idc = IDC_TXT_OVERWRITE_MISSION; - x = POS_W(33); + x = QUOTE(POS_W(33)); }; }; }; @@ -94,10 +94,10 @@ class GVAR(ButtonConfigure_base): RscButtonMenu { onButtonClick = QUOTE(ctrlParent (_this select 0) call FUNC(openSettingsMenu)); idc = IDC_BTN_CONFIGURE; text = CSTRING(configureAddons); - x = POS_X_LOW(11.1); - y = POS_Y_LOW(23); - w = POS_W(10); - h = POS_H(1); + x = QUOTE(POS_X_LOW(11.1)); + y = QUOTE(POS_Y_LOW(23)); + w = QUOTE(POS_W(10)); + h = QUOTE(POS_H(1)); }; class RscDisplayMainMap; @@ -125,11 +125,11 @@ class RscControlsGroupNoHScrollbars: RscControlsGroup { }; class GVAR(OptionsGroup): RscControlsGroupNoHScrollbars { - x = POS_W(0); - y = POS_H(3.5); - w = POS_W(37.5); - h = POS_H(13.8); - lineHeight = POS_H(1); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(3.5)); + w = QUOTE(POS_W(37.5)); + h = QUOTE(POS_H(13.8)); + lineHeight = QUOTE(POS_H(1)); class VScrollbar: VScrollbar { thumb = "\a3\3DEN\Data\Controls\ctrlDefault\thumb_ca.paa"; @@ -161,11 +161,11 @@ class GVAR(RscCombo): RscCombo { class GVAR(AddonsList): GVAR(RscCombo) { linespacing = 1; text = ""; - wholeHeight = POS_H(12); - x = POS_W(4.5); - y = POS_H(1); - w = POS_W(21); - h = POS_H(1); + wholeHeight = QUOTE(POS_H(12)); + x = QUOTE(POS_W(4.5)); + y = QUOTE(POS_H(1)); + w = QUOTE(POS_W(21)); + h = QUOTE(POS_H(1)); }; class RscButton; @@ -181,94 +181,94 @@ class GVAR(CheckboxSound): RscCheckBox { class GVAR(Row_Empty): RscText { GVAR(script) = ""; - x = POS_W(1); - y = POS_H(0); - w = POS_W(37); - h = POS_H(0); + x = QUOTE(POS_W(1)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(37)); + h = QUOTE(POS_H(0)); }; class GVAR(subCat): RscControlsGroupNoScrollbars { - x = POS_W(1); - y = POS_H(0); - w = POS_W(37); - h = POS_H(1); + x = QUOTE(POS_W(1)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(37)); + h = QUOTE(POS_H(1)); class controls { class Background: RscText { colorBackground[] = {0.15,0.15,0.15,0.4}; - x = POS_W(0); - y = POS_H(0); - w = POS_W(36); - h = POS_H(1); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(36)); + h = QUOTE(POS_H(1)); }; class Name: RscText { idc = IDC_SETTING_NAME; style = ST_LEFT; - SizeEx = POS_H(1); - x = POS_W(0); - y = POS_H(0); - w = POS_W(15.5); - h = POS_H(1); + SizeEx = QUOTE(POS_H(1)); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(15.5)); + h = QUOTE(POS_H(1)); }; class Bar: RscText { colorBackground[] = {1,1,1,1}; style = ST_LEFT; - x = POS_W(0); - y = POS_H(1) - 2 * pixelH; - w = POS_W(36); - h = pixelH; + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(1) - 2 * pixelH); + w = QUOTE(POS_W(36)); + h = QUOTE(pixelH); }; }; }; class GVAR(Row_Base): RscControlsGroupNoScrollbars { GVAR(script) = ""; - x = POS_W(1); - y = POS_H(0); - w = POS_W(37); - h = POS_H(1) + TABLE_LINE_SPACING; + x = QUOTE(POS_W(1)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(37)); + h = QUOTE(POS_H(1) + TABLE_LINE_SPACING); class controls { class Background: RscText { idc = IDC_SETTING_BACKGROUND; colorBackground[] = {0,0,0,0.4}; - x = POS_W(0); - y = POS_H(0) + TABLE_LINE_SPACING/2; - w = POS_W(36); - h = POS_H(1); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(36)); + h = QUOTE(POS_H(1)); }; class Name: RscText { idc = IDC_SETTING_NAME; style = ST_RIGHT; - x = POS_W(0); - y = POS_H(0) + TABLE_LINE_SPACING/2; - w = POS_W(15.5); - h = POS_H(1); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(15.5)); + h = QUOTE(POS_H(1)); }; class Default: RscButton { idc = IDC_SETTING_DEFAULT; style = ST_PICTURE; text = ICON_DEFAULT; - x = POS_W(27); - y = POS_H(0) + TABLE_LINE_SPACING/2; - w = POS_W(1); - h = POS_H(1); + x = QUOTE(POS_W(27)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(1)); + h = QUOTE(POS_H(1)); }; class Locked: RscPicture { idc = IDC_SETTING_LOCKED; - x = POS_W(28.5); - y = POS_H(0) + TABLE_LINE_SPACING/2; - w = POS_W(1); - h = POS_H(1); + x = QUOTE(POS_W(28.5)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(1)); + h = QUOTE(POS_H(1)); }; class OverwriteClients: GVAR(CheckboxSound) { idc = IDC_SETTING_OVERWRITE_CLIENT; - x = POS_W(30.5); - y = POS_H(0) + TABLE_LINE_SPACING/2; - w = POS_W(1); - h = POS_H(1); + x = QUOTE(POS_W(30.5)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(1)); + h = QUOTE(POS_H(1)); }; class OverwriteMission: OverwriteClients { idc = IDC_SETTING_OVERWRITE_MISSION; - x = POS_W(33.5); + x = QUOTE(POS_W(33.5)); }; }; }; @@ -280,10 +280,10 @@ class GVAR(Row_Checkbox): GVAR(Row_Base) { class Name: Name {}; class Checkbox: GVAR(CheckboxSound) { idc = IDC_SETTING_CHECKBOX; - x = POS_W(16); - y = POS_H(0) + TABLE_LINE_SPACING/2; - w = POS_W(1); - h = POS_H(1); + x = QUOTE(POS_W(16)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(1)); + h = QUOTE(POS_H(1)); }; class Default: Default {}; class Locked: Locked {}; @@ -301,10 +301,10 @@ class GVAR(Row_Editbox): GVAR(Row_Base) { class Name: Name {}; class Editbox: RscEdit { idc = IDC_SETTING_EDITBOX; - x = POS_W(16); - y = POS_H(0) + TABLE_LINE_SPACING/2; - w = POS_W(10.5); - h = POS_H(1); + x = QUOTE(POS_W(16)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(10.5)); + h = QUOTE(POS_H(1)); }; class Default: Default {}; class Locked: Locked {}; @@ -320,10 +320,10 @@ class GVAR(Row_List): GVAR(Row_Base) { class Name: Name {}; class List: GVAR(RscCombo) { idc = IDC_SETTING_LIST; - x = POS_W(16); - y = POS_H(0) + TABLE_LINE_SPACING/2; - w = POS_W(10.5); - h = POS_H(1); + x = QUOTE(POS_W(16)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(10.5)); + h = QUOTE(POS_H(1)); }; class Default: Default {}; class Locked: Locked {}; @@ -341,17 +341,17 @@ class GVAR(Row_Slider): GVAR(Row_Base) { class Name: Name {}; class Slider: ctrlXSliderH { idc = IDC_SETTING_SLIDER; - x = POS_W(16); - y = POS_H(0) + TABLE_LINE_SPACING/2; - w = POS_W(8.2); - h = POS_H(1); + x = QUOTE(POS_W(16)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(8.2)); + h = QUOTE(POS_H(1)); }; class Edit: RscEdit { idc = IDC_SETTING_SLIDER_EDIT; - x = POS_W(24.3); - y = POS_H(0) + TABLE_LINE_SPACING/2; - w = POS_W(2.2); - h = POS_H(1); + x = QUOTE(POS_W(24.3)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(2.2)); + h = QUOTE(POS_H(1)); }; class Default: Default {}; class Locked: Locked {}; @@ -362,82 +362,82 @@ class GVAR(Row_Slider): GVAR(Row_Base) { class GVAR(Row_Color): GVAR(Row_Base) { GVAR(script) = QFUNC(gui_settingColor); - h = POS_H(3) + TABLE_LINE_SPACING; + h = QUOTE(POS_H(3) + TABLE_LINE_SPACING); class controls: controls { class Name: Name { - y = POS_H(0.5) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(0.5) + TABLE_LINE_SPACING/2); }; class Preview: RscText { idc = IDC_SETTING_COLOR_PREVIEW; - x = POS_W(9.5); - y = POS_H(1.5) + TABLE_LINE_SPACING/2; - w = POS_W(6); - h = POS_H(1); + x = QUOTE(POS_W(9.5)); + y = QUOTE(POS_H(1.5) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(6)); + h = QUOTE(POS_H(1)); }; class Red: ctrlXSliderH { idc = IDC_SETTING_COLOR_RED; color[] = {1,0,0,0.6}; colorActive[] = {1,0,0,1}; colorDisable[] = {1,0,0,0.4}; - x = POS_W(16); - y = POS_H(0) + TABLE_LINE_SPACING/2; - w = POS_W(8.2); - h = POS_H(1); + x = QUOTE(POS_W(16)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(8.2)); + h = QUOTE(POS_H(1)); }; class Red_Edit: RscEdit { idc = IDC_SETTING_COLOR_RED_EDIT; - x = POS_W(24.3); - y = POS_H(0) + TABLE_LINE_SPACING/2; - w = POS_W(2.2); - h = POS_H(1); + x = QUOTE(POS_W(24.3)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(2.2)); + h = QUOTE(POS_H(1)); }; class Green: Red { idc = IDC_SETTING_COLOR_GREEN; color[] = {0,1,0,0.6}; colorActive[] = {0,1,0,1}; colorDisable[] = {0,1,0,0.4}; - y = POS_H(1) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(1) + TABLE_LINE_SPACING/2); }; class Green_Edit: Red_Edit { idc = IDC_SETTING_COLOR_GREEN_EDIT; - y = POS_H(1) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(1) + TABLE_LINE_SPACING/2); }; class Blue: Red { idc = IDC_SETTING_COLOR_BLUE; color[] = {0,0,1,0.6}; colorActive[] = {0,0,1,1}; colorDisable[] = {0,0,1,0.4}; - y = POS_H(2) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(2) + TABLE_LINE_SPACING/2); }; class Blue_Edit: Red_Edit { idc = IDC_SETTING_COLOR_BLUE_EDIT; - y = POS_H(2) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(2) + TABLE_LINE_SPACING/2); }; class Default: Default { - y = POS_H(1) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(1) + TABLE_LINE_SPACING/2); }; class Locked: Locked { - y = POS_H(1) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(1) + TABLE_LINE_SPACING/2); }; class OverwriteClients: OverwriteClients { - y = POS_H(1) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(1) + TABLE_LINE_SPACING/2); }; class OverwriteMission: OverwriteMission { - y = POS_H(1) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(1) + TABLE_LINE_SPACING/2); }; }; }; class GVAR(Row_ColorAlpha): GVAR(Row_Color) { - h = POS_H(4) + TABLE_LINE_SPACING; + h = QUOTE(POS_H(4) + TABLE_LINE_SPACING); class controls: controls { class Name: Name { - y = POS_H(1) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(1) + TABLE_LINE_SPACING/2); }; class Preview: Preview { - y = POS_H(2) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(2) + TABLE_LINE_SPACING/2); }; class Red: Red {}; class Red_Edit: Red_Edit {}; @@ -447,29 +447,29 @@ class GVAR(Row_ColorAlpha): GVAR(Row_Color) { class Blue_Edit: Blue_Edit {}; class Alpha: ctrlXSliderH { idc = IDC_SETTING_COLOR_ALPHA; - x = POS_W(16); - y = POS_H(3) + TABLE_LINE_SPACING/2; - w = POS_W(8.2); - h = POS_H(1); + x = QUOTE(POS_W(16)); + y = QUOTE(POS_H(3) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(8.2)); + h = QUOTE(POS_H(1)); }; class Alpha_Edit: RscEdit { idc = IDC_SETTING_COLOR_ALPHA_EDIT; - x = POS_W(24.3); - y = POS_H(3) + TABLE_LINE_SPACING/2; - w = POS_W(2.2); - h = POS_H(1); + x = QUOTE(POS_W(24.3)); + y = QUOTE(POS_H(3) + TABLE_LINE_SPACING/2); + w = QUOTE(POS_W(2.2)); + h = QUOTE(POS_H(1)); }; class Default: Default { - y = POS_H(1.5) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(1.5) + TABLE_LINE_SPACING/2); }; class Locked: Locked { - y = POS_H(1.5) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(1.5) + TABLE_LINE_SPACING/2); }; class OverwriteClients: OverwriteClients { - y = POS_H(1.5) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(1.5) + TABLE_LINE_SPACING/2); }; class OverwriteMission: OverwriteMission { - y = POS_H(1.5) + TABLE_LINE_SPACING/2; + y = QUOTE(POS_H(1.5) + TABLE_LINE_SPACING/2); }; }; }; @@ -478,69 +478,69 @@ class RscFrame; class GVAR(Row_Time): GVAR(Row_Base) { GVAR(script) = QFUNC(gui_settingTime); - h = POS_H(2) + TABLE_LINE_SPACING; + h = QUOTE(POS_H(2) + TABLE_LINE_SPACING); class controls: controls { class Name: Name { - y = POS_H(0.5) + TABLE_LINE_SPACING / 2; + y = QUOTE(POS_H(0.5) + TABLE_LINE_SPACING / 2); }; class Slider: ctrlXSliderH { idc = IDC_SETTING_TIME_SLIDER; - x = POS_W(16); - y = POS_H(0) + TABLE_LINE_SPACING / 2; - w = POS_W(10.5); - h = POS_H(1); + x = QUOTE(POS_W(16)); + y = QUOTE(POS_H(0) + TABLE_LINE_SPACING / 2); + w = QUOTE(POS_W(10.5)); + h = QUOTE(POS_H(1)); }; class Frame: RscFrame { - x = POS_W(18.25); - y = POS_H(1.1) + TABLE_LINE_SPACING / 2; - w = POS_W(6); - h = POS_H(0.9); + x = QUOTE(POS_W(18.25)); + y = QUOTE(POS_H(1.1) + TABLE_LINE_SPACING / 2); + w = QUOTE(POS_W(6)); + h = QUOTE(POS_H(0.9)); }; class Separator: RscText { style = ST_CENTER; text = ": :"; font = "EtelkaMonospaceProBold"; - x = POS_W(18.25); - y = POS_H(1.1) + TABLE_LINE_SPACING / 2; - w = POS_W(6); - h = POS_H(0.9); - sizeEx = POS_H(1); + x = QUOTE(POS_W(18.25)); + y = QUOTE(POS_H(1.1) + TABLE_LINE_SPACING / 2); + w = QUOTE(POS_W(6)); + h = QUOTE(POS_H(0.9)); + sizeEx = QUOTE(POS_H(1)); colorBackground[] = {0, 0, 0, 0.2}; }; class Hours: RscEdit { idc = IDC_SETTING_TIME_HOURS; - style = ST_CENTER + ST_NO_RECT; + style = QUOTE(ST_CENTER + ST_NO_RECT); tooltip = "$STR_3DEN_Attributes_SliderTime_Hour_tooltip"; font = "EtelkaMonospaceProBold"; - x = POS_W(18.25); - y = POS_H(1.1) + TABLE_LINE_SPACING / 2; - w = POS_W(2); - h = POS_H(0.9); - sizeEx = POS_H(0.9); + x = QUOTE(POS_W(18.25)); + y = QUOTE(POS_H(1.1) + TABLE_LINE_SPACING / 2); + w = QUOTE(POS_W(2)); + h = QUOTE(POS_H(0.9)); + sizeEx = QUOTE(POS_H(0.9)); maxChars = 2; }; class Minutes: Hours { idc = IDC_SETTING_TIME_MINUTES; tooltip = "$STR_3DEN_Attributes_SliderTime_Minute_tooltip"; - x = POS_W(20.25); + x = QUOTE(POS_W(20.25)); }; class Seconds: Hours { idc = IDC_SETTING_TIME_SECONDS; tooltip = "$STR_3DEN_Attributes_SliderTime_Second_tooltip"; - x = POS_W(22.25); + x = QUOTE(POS_W(22.25)); }; class Default: Default { - y = POS_H(0.5) + TABLE_LINE_SPACING / 2; + y = QUOTE(POS_H(0.5) + TABLE_LINE_SPACING / 2); }; class Locked: Locked { - y = POS_H(0.5) + TABLE_LINE_SPACING / 2; + y = QUOTE(POS_H(0.5) + TABLE_LINE_SPACING / 2); }; class OverwriteClients: OverwriteClients { - y = POS_H(0.5) + TABLE_LINE_SPACING / 2; + y = QUOTE(POS_H(0.5) + TABLE_LINE_SPACING / 2); }; class OverwriteMission: OverwriteMission { - y = POS_H(0.5) + TABLE_LINE_SPACING / 2; + y = QUOTE(POS_H(0.5) + TABLE_LINE_SPACING / 2); }; }; }; @@ -556,10 +556,10 @@ class GVAR(presets) { class controls { class Presets: RscControlsGroup { idc = IDC_PRESETS_GROUP; - x = POS_X(10); - y = POS_Y(0.9); - w = POS_W(20); - h = POS_H(22.2); + x = QUOTE(POS_X(10)); + y = QUOTE(POS_Y(0.9)); + w = QUOTE(POS_W(20)); + h = QUOTE(POS_H(22.2)); class controls { class Title: RscTitle { @@ -571,69 +571,69 @@ class GVAR(presets) { }; idc = IDC_PRESETS_TITLE; text = ""; - x = POS_W(0); - y = POS_H(0); - w = POS_W(20); - h = POS_H(1); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(20)); + h = QUOTE(POS_H(1)); }; class Background: RscText { idc = -1; colorBackground[] = {0,0,0,0.8}; - x = POS_W(0); - y = POS_H(1.1); - w = POS_W(20); - h = POS_H(20); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(1.1)); + w = QUOTE(POS_W(20)); + h = QUOTE(POS_H(20)); }; class TextName: RscText { idc = IDC_PRESETS_NAME; style = ST_RIGHT; text = "$STR_DISP_INTEL_NAME"; - x = POS_W(0.5); - y = POS_H(19.6); - w = POS_W(5.5); - h = POS_H(1); - sizeEx = POS_H(0.8); + x = QUOTE(POS_W(0.5)); + y = QUOTE(POS_H(19.6)); + w = QUOTE(POS_W(5.5)); + h = QUOTE(POS_H(1)); + sizeEx = QUOTE(POS_H(0.8)); }; class EditName: RscEdit { idc = IDC_PRESETS_EDIT; - x = POS_W(6); - y = POS_H(19.6); - w = POS_W(13.5); - h = POS_H(1); - sizeEx = POS_H(0.8); + x = QUOTE(POS_W(6)); + y = QUOTE(POS_H(19.6)); + w = QUOTE(POS_W(13.5)); + h = QUOTE(POS_H(1)); + sizeEx = QUOTE(POS_H(0.8)); }; class ValueName: RscListBox { idc = IDC_PRESETS_VALUE; colorBackground[] = {1,1,1,0.2}; - x = POS_W(0.5); - y = POS_H(1.6); - w = POS_W(19); - h = POS_H(17.5); - sizeEx = POS_H(0.8); + x = QUOTE(POS_W(0.5)); + y = QUOTE(POS_H(1.6)); + w = QUOTE(POS_W(19)); + h = QUOTE(POS_H(17.5)); + sizeEx = QUOTE(POS_H(0.8)); }; class ButtonOK: RscButtonMenu { idc = IDC_PRESETS_OK; text = "$STR_DISP_OK"; - x = POS_W(15); - y = POS_H(21.2); - w = POS_W(5); - h = POS_H(1); + x = QUOTE(POS_W(15)); + y = QUOTE(POS_H(21.2)); + w = QUOTE(POS_W(5)); + h = QUOTE(POS_H(1)); }; class ButtonCancel: RscButtonMenu { idc = IDC_PRESETS_CANCEL; text = "$STR_DISP_CANCEL"; - x = POS_W(0); - y = POS_H(21.2); - w = POS_W(5); - h = POS_H(1); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(21.2)); + w = QUOTE(POS_W(5)); + h = QUOTE(POS_H(1)); }; class ButtonDelete: RscButtonMenu { idc = IDC_PRESETS_DELETE; text = "$STR_DISP_DELETE"; - x = POS_W(9.9); - y = POS_H(21.2); - w = POS_W(5); - h = POS_H(1); + x = QUOTE(POS_W(9.9)); + y = QUOTE(POS_H(21.2)); + w = QUOTE(POS_W(5)); + h = QUOTE(POS_H(1)); }; }; }; @@ -655,10 +655,10 @@ class GVAR(export) { class controls { class Presets: RscControlsGroup { idc = IDC_EXPORT_GROUP; - x = POS_X(5); - y = POS_Y(-5.1); - w = POS_W(30); - h = POS_H(32.2); + x = QUOTE(POS_X(5)); + y = QUOTE(POS_Y(-5.1)); + w = QUOTE(POS_W(30)); + h = QUOTE(POS_H(32.2)); class controls { class Title: RscTitle { @@ -670,71 +670,71 @@ class GVAR(export) { }; idc = IDC_EXPORT_TITLE; text = ""; - x = POS_W(0); - y = POS_H(0); - w = POS_W(30); - h = POS_H(1); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(30)); + h = QUOTE(POS_H(1)); }; class Background: RscText { idc = -1; colorBackground[] = {0,0,0,0.8}; - x = POS_W(0); - y = POS_H(1.1); - w = POS_W(30); - h = POS_H(30); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(1.1)); + w = QUOTE(POS_W(30)); + h = QUOTE(POS_H(30)); }; class ValueGroup: RscControlsGroup { idc = IDC_EXPORT_VALUE_GROUP; - x = POS_W(0.5); - y = POS_H(1.6); - w = POS_W(29); - h = POS_H(29); + x = QUOTE(POS_W(0.5)); + y = QUOTE(POS_H(1.6)); + w = QUOTE(POS_W(29)); + h = QUOTE(POS_H(29)); class controls { class Value: RscEdit { idc = IDC_EXPORT_VALUE; - style = ST_MULTI + ST_NO_RECT; + style = QUOTE(ST_MULTI + ST_NO_RECT); colorDisabled[] = {0.95,0.95,0.95,1}; colorBackground[] = {1,1,1,0.2}; - x = POS_W(0); - y = POS_H(0); - w = POS_W(29); - h = POS_H(29); - sizeEx = POS_H(0.8); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(29)); + h = QUOTE(POS_H(29)); + sizeEx = QUOTE(POS_H(0.8)); }; }; }; class ButtonOK: RscButtonMenu { idc = IDC_EXPORT_OK; text = "$STR_DISP_OK"; - x = POS_W(20); - y = POS_H(31.2); - w = POS_W(10); - h = POS_H(1); + x = QUOTE(POS_W(20)); + y = QUOTE(POS_H(31.2)); + w = QUOTE(POS_W(10)); + h = QUOTE(POS_H(1)); }; class ButtonCancel: RscButtonMenu { idc = IDC_EXPORT_CANCEL; text = "$STR_DISP_CANCEL"; - x = POS_W(0); - y = POS_H(31.2); - w = POS_W(10); - h = POS_H(1); + x = QUOTE(POS_W(0)); + y = QUOTE(POS_H(31.2)); + w = QUOTE(POS_W(10)); + h = QUOTE(POS_H(1)); }; class ToggleDefaultText: RscText { idc = IDC_EXPORT_TOGGLE_DEFAULT_TEXT; style = ST_RIGHT; text = CSTRING(show_default); - x = POS_W(19); - y = POS_H(0); - w = POS_W(10); - h = POS_H(1); + x = QUOTE(POS_W(19)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(10)); + h = QUOTE(POS_H(1)); }; class ToggleDefault: GVAR(CheckboxSound) { idc = IDC_EXPORT_TOGGLE_DEFAULT; - x = POS_W(29); - y = POS_H(0); - w = POS_W(1); - h = POS_H(1); + x = QUOTE(POS_W(29)); + y = QUOTE(POS_H(0)); + w = QUOTE(POS_W(1)); + h = QUOTE(POS_H(1)); }; }; }; diff --git a/addons/strings/fnc_decodeURL.sqf b/addons/strings/fnc_decodeURL.sqf index a98f91bd70..e25fad7815 100644 --- a/addons/strings/fnc_decodeURL.sqf +++ b/addons/strings/fnc_decodeURL.sqf @@ -20,6 +20,226 @@ Author: commy2 ---------------------------------------------------------------------------- */ +#define UTF8_TABLE [\ + ["%20"," "],\ + ["%21","!"],\ + ["%22",""""],\ + ["%23","#"],\ + ["%24","$"],\ + ["%26","&"],\ + ["%27","'"],\ + ["%28","("],\ + ["%29",")"],\ + ["%2a","*"],\ + ["%2b","+"],\ + ["%2c",","],\ + ["%2d","-"],\ + ["%2e","."],\ + ["%2f","/"],\ + ["%30","0"],\ + ["%31","1"],\ + ["%32","2"],\ + ["%33","3"],\ + ["%34","4"],\ + ["%35","5"],\ + ["%36","6"],\ + ["%37","7"],\ + ["%38","8"],\ + ["%39","9"],\ + ["%3a",":"],\ + ["%3b",";"],\ + ["%3c","<"],\ + ["%3d","="],\ + ["%3e",">"],\ + ["%3f","?"],\ + ["%40","@"],\ + ["%41","A"],\ + ["%42","B"],\ + ["%43","C"],\ + ["%44","D"],\ + ["%45","E"],\ + ["%46","F"],\ + ["%47","G"],\ + ["%48","H"],\ + ["%49","I"],\ + ["%4a","J"],\ + ["%4b","K"],\ + ["%4c","L"],\ + ["%4d","M"],\ + ["%4e","N"],\ + ["%4f","O"],\ + ["%50","P"],\ + ["%51","Q"],\ + ["%52","R"],\ + ["%53","S"],\ + ["%54","T"],\ + ["%55","U"],\ + ["%56","V"],\ + ["%57","W"],\ + ["%58","X"],\ + ["%59","Y"],\ + ["%5a","Z"],\ + ["%5b","["],\ + ["%5c","\"],\ + ["%5d","]"],\ + ["%5e","^"],\ + ["%5f","_"],\ + ["%60","`"],\ + ["%61","a"],\ + ["%62","b"],\ + ["%63","c"],\ + ["%64","d"],\ + ["%65","e"],\ + ["%66","f"],\ + ["%67","g"],\ + ["%68","h"],\ + ["%69","i"],\ + ["%6a","j"],\ + ["%6b","k"],\ + ["%6c","l"],\ + ["%6d","m"],\ + ["%6e","n"],\ + ["%6f","o"],\ + ["%70","p"],\ + ["%71","q"],\ + ["%72","r"],\ + ["%73","s"],\ + ["%74","t"],\ + ["%75","u"],\ + ["%76","v"],\ + ["%77","w"],\ + ["%78","x"],\ + ["%79","y"],\ + ["%7a","z"],\ + ["%7b","{"],\ + ["%7c","|"],\ + ["%7d","}"],\ + ["%7e","~"],\ + ["%e2%82%ac","`"],\ + ["%e2%80%9a","‚"],\ + ["%c6%92","ƒ"],\ + ["%e2%80%9e","„"],\ + ["%e2%80%a6","…"],\ + ["%e2%80%a0","†"],\ + ["%e2%80%a1","‡"],\ + ["%cb%86","ˆ"],\ + ["%e2%80%b0","‰"],\ + ["%c5%a0","Š"],\ + ["%e2%80%b9","‹"],\ + ["%c5%92","Œ"],\ + ["%c5%bd","Ž"],\ + ["%e2%80%98","‘"],\ + ["%e2%80%99","’"],\ + ["%e2%80%9c","“"],\ + ["%e2%80%9d","”"],\ + ["%e2%80%a2","•"],\ + ["%e2%80%93","–"],\ + ["%e2%80%94","—"],\ + ["%cb%9c","˜"],\ + ["%e2%84","™"],\ + ["%c5%a1","š"],\ + ["%e2%80","›"],\ + ["%c5%93","œ"],\ + ["%c5%be","ž"],\ + ["%c5%b8","Ÿ"],\ + ["%c2%a1","¡"],\ + ["%c2%a2","¢"],\ + ["%c2%a3","£"],\ + ["%c2%a4","¤"],\ + ["%c2%a5","¥"],\ + ["%c2%a6","¦"],\ + ["%c2%a7","§"],\ + ["%c2%a8","¨"],\ + ["%c2%a9","©"],\ + ["%c2%aa","ª"],\ + ["%c2%ab","«"],\ + ["%c2%ac","¬"],\ + ["%c2%ae","®"],\ + ["%c2%af","¯"],\ + ["%c2%b0","°"],\ + ["%c2%b1","±"],\ + ["%c2%b2","²"],\ + ["%c2%b3","³"],\ + ["%c2%b4","´"],\ + ["%c2%b5","µ"],\ + ["%c2%b6","¶"],\ + ["%c2%b7","·"],\ + ["%c2%b8","¸"],\ + ["%c2%b9","¹"],\ + ["%c2%ba","º"],\ + ["%c2%bb","»"],\ + ["%c2%bc","¼"],\ + ["%c2%bd","½"],\ + ["%c2%be","¾"],\ + ["%c2%bf","¿"],\ + ["%c3%80","À"],\ + ["%c3%81","Á"],\ + ["%c3%82","Â"],\ + ["%c3%83","Ã"],\ + ["%c3%84","Ä"],\ + ["%c3%85","Å"],\ + ["%c3%86","Æ"],\ + ["%c3%87","Ç"],\ + ["%c3%88","È"],\ + ["%c3%89","É"],\ + ["%c3%8a","Ê"],\ + ["%c3%8b","Ë"],\ + ["%c3%8c","Ì"],\ + ["%c3%8d","Í"],\ + ["%c3%8e","Î"],\ + ["%c3%8f","Ï"],\ + ["%c3%90","Ð"],\ + ["%c3%91","Ñ"],\ + ["%c3%92","Ò"],\ + ["%c3%93","Ó"],\ + ["%c3%94","Ô"],\ + ["%c3%95","Õ"],\ + ["%c3%96","Ö"],\ + ["%c3%97","×"],\ + ["%c3%98","Ø"],\ + ["%c3%99","Ù"],\ + ["%c3%9a","Ú"],\ + ["%c3%9b","Û"],\ + ["%c3%9c","Ü"],\ + ["%c3%9d","Ý"],\ + ["%c3%9e","Þ"],\ + ["%c3%9f","ß"],\ + ["%c3%a0","à"],\ + ["%c3%a1","á"],\ + ["%c3%a2","â"],\ + ["%c3%a3","ã"],\ + ["%c3%a4","ä"],\ + ["%c3%a5","å"],\ + ["%c3%a6","æ"],\ + ["%c3%a7","ç"],\ + ["%c3%a8","è"],\ + ["%c3%a9","é"],\ + ["%c3%aa","ê"],\ + ["%c3%ab","ë"],\ + ["%c3%ac","ì"],\ + ["%c3%ad","í"],\ + ["%c3%ae","î"],\ + ["%c3%af","ï"],\ + ["%c3%b0","ð"],\ + ["%c3%b1","ñ"],\ + ["%c3%b2","ò"],\ + ["%c3%b3","ó"],\ + ["%c3%b4","ô"],\ + ["%c3%b5","õ"],\ + ["%c3%b6","ö"],\ + ["%c3%b7","÷"],\ + ["%c3%b8","ø"],\ + ["%c3%b9","ù"],\ + ["%c3%ba","ú"],\ + ["%c3%bb","û"],\ + ["%c3%bc","ü"],\ + ["%c3%bd","ý"],\ + ["%c3%be","þ"],\ + ["%c3%bf","ÿ"],\ + ["%%","%"],\ + ["%25","%"]\ +] + params [["_string", "", [""]]]; if (_string isEqualTo "") exitWith {""}; diff --git a/addons/strings/script_component.hpp b/addons/strings/script_component.hpp index 2e913ab891..a6a2024e65 100644 --- a/addons/strings/script_component.hpp +++ b/addons/strings/script_component.hpp @@ -10,223 +10,3 @@ #endif #include "\x\cba\addons\main\script_macros.hpp" - -#define UTF8_TABLE [\ - ["%20"," "],\ - ["%21","!"],\ - ["%22",""""],\ - ["%23","#"],\ - ["%24","$"],\ - ["%26","&"],\ - ["%27","'"],\ - ["%28","("],\ - ["%29",")"],\ - ["%2a","*"],\ - ["%2b","+"],\ - ["%2c",","],\ - ["%2d","-"],\ - ["%2e","."],\ - ["%2f","/"],\ - ["%30","0"],\ - ["%31","1"],\ - ["%32","2"],\ - ["%33","3"],\ - ["%34","4"],\ - ["%35","5"],\ - ["%36","6"],\ - ["%37","7"],\ - ["%38","8"],\ - ["%39","9"],\ - ["%3a",":"],\ - ["%3b",";"],\ - ["%3c","<"],\ - ["%3d","="],\ - ["%3e",">"],\ - ["%3f","?"],\ - ["%40","@"],\ - ["%41","A"],\ - ["%42","B"],\ - ["%43","C"],\ - ["%44","D"],\ - ["%45","E"],\ - ["%46","F"],\ - ["%47","G"],\ - ["%48","H"],\ - ["%49","I"],\ - ["%4a","J"],\ - ["%4b","K"],\ - ["%4c","L"],\ - ["%4d","M"],\ - ["%4e","N"],\ - ["%4f","O"],\ - ["%50","P"],\ - ["%51","Q"],\ - ["%52","R"],\ - ["%53","S"],\ - ["%54","T"],\ - ["%55","U"],\ - ["%56","V"],\ - ["%57","W"],\ - ["%58","X"],\ - ["%59","Y"],\ - ["%5a","Z"],\ - ["%5b","["],\ - ["%5c","\"],\ - ["%5d","]"],\ - ["%5e","^"],\ - ["%5f","_"],\ - ["%60","`"],\ - ["%61","a"],\ - ["%62","b"],\ - ["%63","c"],\ - ["%64","d"],\ - ["%65","e"],\ - ["%66","f"],\ - ["%67","g"],\ - ["%68","h"],\ - ["%69","i"],\ - ["%6a","j"],\ - ["%6b","k"],\ - ["%6c","l"],\ - ["%6d","m"],\ - ["%6e","n"],\ - ["%6f","o"],\ - ["%70","p"],\ - ["%71","q"],\ - ["%72","r"],\ - ["%73","s"],\ - ["%74","t"],\ - ["%75","u"],\ - ["%76","v"],\ - ["%77","w"],\ - ["%78","x"],\ - ["%79","y"],\ - ["%7a","z"],\ - ["%7b","{"],\ - ["%7c","|"],\ - ["%7d","}"],\ - ["%7e","~"],\ - ["%e2%82%ac","`"],\ - ["%e2%80%9a","‚"],\ - ["%c6%92","ƒ"],\ - ["%e2%80%9e","„"],\ - ["%e2%80%a6","…"],\ - ["%e2%80%a0","†"],\ - ["%e2%80%a1","‡"],\ - ["%cb%86","ˆ"],\ - ["%e2%80%b0","‰"],\ - ["%c5%a0","Š"],\ - ["%e2%80%b9","‹"],\ - ["%c5%92","Œ"],\ - ["%c5%bd","Ž"],\ - ["%e2%80%98","‘"],\ - ["%e2%80%99","’"],\ - ["%e2%80%9c","“"],\ - ["%e2%80%9d","”"],\ - ["%e2%80%a2","•"],\ - ["%e2%80%93","–"],\ - ["%e2%80%94","—"],\ - ["%cb%9c","˜"],\ - ["%e2%84","™"],\ - ["%c5%a1","š"],\ - ["%e2%80","›"],\ - ["%c5%93","œ"],\ - ["%c5%be","ž"],\ - ["%c5%b8","Ÿ"],\ - ["%c2%a1","¡"],\ - ["%c2%a2","¢"],\ - ["%c2%a3","£"],\ - ["%c2%a4","¤"],\ - ["%c2%a5","¥"],\ - ["%c2%a6","¦"],\ - ["%c2%a7","§"],\ - ["%c2%a8","¨"],\ - ["%c2%a9","©"],\ - ["%c2%aa","ª"],\ - ["%c2%ab","«"],\ - ["%c2%ac","¬"],\ - ["%c2%ae","®"],\ - ["%c2%af","¯"],\ - ["%c2%b0","°"],\ - ["%c2%b1","±"],\ - ["%c2%b2","²"],\ - ["%c2%b3","³"],\ - ["%c2%b4","´"],\ - ["%c2%b5","µ"],\ - ["%c2%b6","¶"],\ - ["%c2%b7","·"],\ - ["%c2%b8","¸"],\ - ["%c2%b9","¹"],\ - ["%c2%ba","º"],\ - ["%c2%bb","»"],\ - ["%c2%bc","¼"],\ - ["%c2%bd","½"],\ - ["%c2%be","¾"],\ - ["%c2%bf","¿"],\ - ["%c3%80","À"],\ - ["%c3%81","Á"],\ - ["%c3%82","Â"],\ - ["%c3%83","Ã"],\ - ["%c3%84","Ä"],\ - ["%c3%85","Å"],\ - ["%c3%86","Æ"],\ - ["%c3%87","Ç"],\ - ["%c3%88","È"],\ - ["%c3%89","É"],\ - ["%c3%8a","Ê"],\ - ["%c3%8b","Ë"],\ - ["%c3%8c","Ì"],\ - ["%c3%8d","Í"],\ - ["%c3%8e","Î"],\ - ["%c3%8f","Ï"],\ - ["%c3%90","Ð"],\ - ["%c3%91","Ñ"],\ - ["%c3%92","Ò"],\ - ["%c3%93","Ó"],\ - ["%c3%94","Ô"],\ - ["%c3%95","Õ"],\ - ["%c3%96","Ö"],\ - ["%c3%97","×"],\ - ["%c3%98","Ø"],\ - ["%c3%99","Ù"],\ - ["%c3%9a","Ú"],\ - ["%c3%9b","Û"],\ - ["%c3%9c","Ü"],\ - ["%c3%9d","Ý"],\ - ["%c3%9e","Þ"],\ - ["%c3%9f","ß"],\ - ["%c3%a0","à"],\ - ["%c3%a1","á"],\ - ["%c3%a2","â"],\ - ["%c3%a3","ã"],\ - ["%c3%a4","ä"],\ - ["%c3%a5","å"],\ - ["%c3%a6","æ"],\ - ["%c3%a7","ç"],\ - ["%c3%a8","è"],\ - ["%c3%a9","é"],\ - ["%c3%aa","ê"],\ - ["%c3%ab","ë"],\ - ["%c3%ac","ì"],\ - ["%c3%ad","í"],\ - ["%c3%ae","î"],\ - ["%c3%af","ï"],\ - ["%c3%b0","ð"],\ - ["%c3%b1","ñ"],\ - ["%c3%b2","ò"],\ - ["%c3%b3","ó"],\ - ["%c3%b4","ô"],\ - ["%c3%b5","õ"],\ - ["%c3%b6","ö"],\ - ["%c3%b7","÷"],\ - ["%c3%b8","ø"],\ - ["%c3%b9","ù"],\ - ["%c3%ba","ú"],\ - ["%c3%bb","û"],\ - ["%c3%bc","ü"],\ - ["%c3%bd","ý"],\ - ["%c3%be","þ"],\ - ["%c3%bf","ÿ"],\ - ["%%","%"],\ - ["%25","%"]\ -] diff --git a/addons/ui/CfgUIGrids.hpp b/addons/ui/CfgUIGrids.hpp index e525beeeb4..4571d254e9 100644 --- a/addons/ui/CfgUIGrids.hpp +++ b/addons/ui/CfgUIGrids.hpp @@ -5,24 +5,24 @@ class CfgUIGrids { class Variables { GVAR(grid)[] = { { - 1 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X, - 0 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y, - 38 * GUI_GRID_CENTER_W, - 1 * GUI_GRID_CENTER_H + QUOTE(1 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X), + QUOTE(0 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y), + QUOTE(38 * GUI_GRID_CENTER_W), + QUOTE(1 * GUI_GRID_CENTER_H) }, - 0.5 * GUI_GRID_CENTER_W, - 0.5 * GUI_GRID_CENTER_H + QUOTE(0.5 * GUI_GRID_CENTER_W), + QUOTE(0.5 * GUI_GRID_CENTER_H) }; GVAR(notify)[] = { { - NOTIFY_DEFAULT_X, - NOTIFY_DEFAULT_Y, - NOTIFY_MIN_WIDTH, - NOTIFY_MIN_HEIGHT + QUOTE(NOTIFY_DEFAULT_X), + QUOTE(NOTIFY_DEFAULT_Y), + QUOTE(NOTIFY_MIN_WIDTH), + QUOTE(NOTIFY_MIN_HEIGHT) }, - GUI_GRID_W, - GUI_GRID_H + QUOTE(GUI_GRID_W), + QUOTE(GUI_GRID_H) }; }; }; diff --git a/addons/ui/Display3DEN.hpp b/addons/ui/Display3DEN.hpp index 9934f61bd3..c53cb62013 100644 --- a/addons/ui/Display3DEN.hpp +++ b/addons/ui/Display3DEN.hpp @@ -8,7 +8,7 @@ class Display3DEN { class GVAR(LobbyManager) { text = CSTRING(LobbyManager); data = QGVAR(LobbyManager); - shortcuts[] = {INPUT_CTRL_OFFSET + DIK_L}; + shortcuts[] = {QUOTE(INPUT_CTRL_OFFSET + DIK_L)}; action = QUOTE(call (uiNamespace getVariable 'CBA_fnc_openLobbyManager')); enable = 1; opensNewWindow = 1; diff --git a/addons/ui/LobbyManager.hpp b/addons/ui/LobbyManager.hpp index b1ab0a469a..1c29c80602 100644 --- a/addons/ui/LobbyManager.hpp +++ b/addons/ui/LobbyManager.hpp @@ -10,109 +10,109 @@ class GVAR(LobbyManager) { class controls { class Background: ctrlStaticBackground { - x = (getResolution select 2) * 0.5 * pixelW - (140/2) * GRID_3DEN_W; - y = 0.5 - (120/2 - 5) * GRID_3DEN_H; - w = 140 * GRID_3DEN_W; - h = (120 - 10) * GRID_3DEN_H; + x = QUOTE((getResolution select 2) * 0.5 * pixelW - (140/2) * GRID_3DEN_W); + y = QUOTE(0.5 - (120/2 - 5) * GRID_3DEN_H); + w = QUOTE(140 * GRID_3DEN_W); + h = QUOTE((120 - 10) * GRID_3DEN_H); }; class BackgroundButtons: ctrlStaticFooter { - x = (getResolution select 2) * 0.5 * pixelW - (140/2) * GRID_3DEN_W; - y = 0.5 + (120/2 - 10 - 2) * GRID_3DEN_H; - w = 140 * GRID_3DEN_W; - h = 7 * GRID_3DEN_H; + x = QUOTE((getResolution select 2) * 0.5 * pixelW - (140/2) * GRID_3DEN_W); + y = QUOTE(0.5 + (120/2 - 10 - 2) * GRID_3DEN_H); + w = QUOTE(140 * GRID_3DEN_W); + h = QUOTE(7 * GRID_3DEN_H); }; class Title: ctrlStaticTitle { text = CSTRING(LobbyManager); - x = (getResolution select 2) * 0.5 * pixelW - (140/2) * GRID_3DEN_W; - y = 0.5 - (120/2 - 5) * GRID_3DEN_H; - w = 140 * GRID_3DEN_W; - h = 5 * GRID_3DEN_H; + x = QUOTE((getResolution select 2) * 0.5 * pixelW - (140/2) * GRID_3DEN_W); + y = QUOTE(0.5 - (120/2 - 5) * GRID_3DEN_H); + w = QUOTE(140 * GRID_3DEN_W); + h = QUOTE(5 * GRID_3DEN_H); }; class Slots: ctrlTree { idc = IDC_LM_SLOTS; - x = (getResolution select 2) * 0.5 * pixelW - (140/2 - 1) * GRID_3DEN_W; - y = 0.5 - (120/2 - 10 - 1) * GRID_3DEN_H; - w = 88 * GRID_3DEN_W; - h = (120 - 10 - 5 - 7 - 2) * GRID_3DEN_H; - sizeEx = 3.96 * (1 / (getResolution select 3)) * pixelGrid * 0.5; + x = QUOTE((getResolution select 2) * 0.5 * pixelW - (140/2 - 1) * GRID_3DEN_W); + y = QUOTE(0.5 - (120/2 - 10 - 1) * GRID_3DEN_H); + w = QUOTE(88 * GRID_3DEN_W); + h = QUOTE((120 - 10 - 5 - 7 - 2) * GRID_3DEN_H); + sizeEx = QUOTE(3.96 * (1 / (getResolution select 3)) * pixelGrid * 0.5); colorBackground[] = {0, 0, 0, 0.3}; - disableKeyboardSearch = 1; + disableKeyboardSearch = QUOTE(1); }; class CallsignLabel: ctrlStatic { text = "$STR_3DEN_Group_Attribute_Callsign_displayName"; tooltip = "$STR_3DEN_Group_Attribute_Callsign_tooltip"; - x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50) * GRID_3DEN_W; - y = 0.5 - (120/2 - 10 - 1) * GRID_3DEN_H; - w = 49 * GRID_3DEN_W; - h = 5 * GRID_3DEN_H; + x = QUOTE((getResolution select 2) * 0.5 * pixelW + (140/2 - 50) * GRID_3DEN_W); + y = QUOTE(0.5 - (120/2 - 10 - 1) * GRID_3DEN_H); + w = QUOTE(49 * GRID_3DEN_W); + h = QUOTE(5 * GRID_3DEN_H); }; class Callsign: ctrlEdit { idc = IDC_LM_CALLSIGN; onLoad = QUOTE((_this select 0) ctrlEnable false); - x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50) * GRID_3DEN_W; - y = 0.5 - (120/2 - 10 - 1 - 5) * GRID_3DEN_H; - w = 49 * GRID_3DEN_W; - h = 5 * GRID_3DEN_H; + x = QUOTE((getResolution select 2) * 0.5 * pixelW + (140/2 - 50) * GRID_3DEN_W); + y = QUOTE(0.5 - (120/2 - 10 - 1 - 5) * GRID_3DEN_H); + w = QUOTE(49 * GRID_3DEN_W); + h = QUOTE(5 * GRID_3DEN_H); colorDisabled[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0.25}; }; class DescriptionLabel: CallsignLabel { text = "$STR_3DEN_Object_Attribute_Description_displayName"; tooltip = "$STR_3DEN_Object_Attribute_Description_tooltip"; - y = 0.5 - (120/2 - 10 - 1 - 10) * GRID_3DEN_H; + y = QUOTE(0.5 - (120/2 - 10 - 1 - 10) * GRID_3DEN_H); }; class Description: Callsign { idc = IDC_LM_DESCRIPTION; - y = 0.5 - (120/2 - 10 - 1 - 5 - 10) * GRID_3DEN_H; + y = QUOTE(0.5 - (120/2 - 10 - 1 - 5 - 10) * GRID_3DEN_H); }; class MoveUp: ctrlButtonPictureKeepAspect { idc = IDC_LM_MOVE_UP; text = QPATHTOF(arrow_up_ca.paa); tooltip = "$STR_USRACT_CAMERA_MOVE_UP"; - x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50) * GRID_3DEN_W; - y = 0.5 + (120/2 - 10 - 7 - 1) * GRID_3DEN_H; - w = 5 * GRID_3DEN_W; - h = 5 * GRID_3DEN_H; + x = QUOTE((getResolution select 2) * 0.5 * pixelW + (140/2 - 50) * GRID_3DEN_W); + y = QUOTE(0.5 + (120/2 - 10 - 7 - 1) * GRID_3DEN_H); + w = QUOTE(5 * GRID_3DEN_W); + h = QUOTE(5 * GRID_3DEN_H); colorBackground[] = {0, 0, 0, 0}; }; class MoveDown: MoveUp { idc = IDC_LM_MOVE_DOWN; text = QPATHTOF(arrow_down_ca.paa); tooltip = "$STR_USRACT_CAMERA_MOVE_DOWN"; - x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50 + 5) * GRID_3DEN_W; + x = QUOTE((getResolution select 2) * 0.5 * pixelW + (140/2 - 50 + 5) * GRID_3DEN_W); }; class Collapse: ctrlButtonCollapseAll { idc = IDC_LM_COLLAPSE; - x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50 + 10) * GRID_3DEN_W; - y = 0.5 + (120/2 - 10 - 7 - 1) * GRID_3DEN_H; - w = 5 * GRID_3DEN_W; - h = 5 * GRID_3DEN_H; + x = QUOTE((getResolution select 2) * 0.5 * pixelW + (140/2 - 50 + 10) * GRID_3DEN_W); + y = QUOTE(0.5 + (120/2 - 10 - 7 - 1) * GRID_3DEN_H); + w = QUOTE(5 * GRID_3DEN_W); + h = QUOTE(5 * GRID_3DEN_H); }; class Expand: ctrlButtonExpandAll { idc = IDC_LM_EXPAND; - x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50 + 15) * GRID_3DEN_W; - y = 0.5 + (120/2 - 10 - 7 - 1) * GRID_3DEN_H; - w = 5 * GRID_3DEN_W; - h = 5 * GRID_3DEN_H; + x = QUOTE((getResolution select 2) * 0.5 * pixelW + (140/2 - 50 + 15) * GRID_3DEN_W); + y = QUOTE(0.5 + (120/2 - 10 - 7 - 1) * GRID_3DEN_H); + w = QUOTE(5 * GRID_3DEN_W); + h = QUOTE(5 * GRID_3DEN_H); }; class WarningLabel: ctrlStructuredText { idc = IDC_LM_WARNING; - x = (getResolution select 2) * 0.5 * pixelW - (140/2) * GRID_3DEN_W; - y = 0.5 + (120/2 - 10 - 1) * GRID_3DEN_H; - w = 87 * GRID_3DEN_W; - h = 5 * GRID_3DEN_H; + x = QUOTE((getResolution select 2) * 0.5 * pixelW - (140/2) * GRID_3DEN_W); + y = QUOTE(0.5 + (120/2 - 10 - 1) * GRID_3DEN_H); + w = QUOTE(87 * GRID_3DEN_W); + h = QUOTE(5 * GRID_3DEN_H); }; class ButtonOK: ctrlButtonOK { - x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50 - 2) * GRID_3DEN_W; - y = 0.5 + (120/2 - 10 - 1) * GRID_3DEN_H; - w = 25 * GRID_3DEN_W; - h = 5 * GRID_3DEN_H; + x = QUOTE((getResolution select 2) * 0.5 * pixelW + (140/2 - 50 - 2) * GRID_3DEN_W); + y = QUOTE(0.5 + (120/2 - 10 - 1) * GRID_3DEN_H); + w = QUOTE(25 * GRID_3DEN_W); + h = QUOTE(5 * GRID_3DEN_H); }; class ButtonCancel: ctrlButtonCancel { - x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 25 - 1) * GRID_3DEN_W; - y = 0.5 + (120/2 - 10 - 1) * GRID_3DEN_H; - w = 25 * GRID_3DEN_W; - h = 5 * GRID_3DEN_H; + x = QUOTE((getResolution select 2) * 0.5 * pixelW + (140/2 - 25 - 1) * GRID_3DEN_W); + y = QUOTE(0.5 + (120/2 - 10 - 1) * GRID_3DEN_H); + w = QUOTE(25 * GRID_3DEN_W); + h = QUOTE(5 * GRID_3DEN_H); }; }; }; diff --git a/addons/ui/RscDisplayOptionsLayout.hpp b/addons/ui/RscDisplayOptionsLayout.hpp index 945e2150bb..80dfc8b119 100644 --- a/addons/ui/RscDisplayOptionsLayout.hpp +++ b/addons/ui/RscDisplayOptionsLayout.hpp @@ -12,7 +12,7 @@ class RscDisplayOptionsLayout { onMouseButtonUp = "with uiNamespace do {['mouseButtonUp',_this,''] call RscDisplayOptionsLayout_script;};"; }; #define ADD_ELEMENT(var1) class Element##var1: Element022 {\ - idc = 12##var1;\ + idc = QUOTE(12##var1);\ } ADD_ELEMENT(023); ADD_ELEMENT(024); diff --git a/addons/ui/RscTitles.hpp b/addons/ui/RscTitles.hpp index d0fcd9c148..9811952828 100644 --- a/addons/ui/RscTitles.hpp +++ b/addons/ui/RscTitles.hpp @@ -1,6 +1,6 @@ class RscTitles { class GVAR(ProgressBar) { - onLoad = uiNamespace setVariable ['GVAR(ProgressBar)', _this select 0]; + onLoad = QUOTE(with uiNameSpace do { GVAR(ProgressBar) = _this select 0 }; ); idd = -1; duration = 1e+11; fadeIn = 0; @@ -17,14 +17,14 @@ class RscTitles { }; class TitleBackground: RscText { - idc = IDC_PROGRESSBAR_BACKGROUND; + // idc = IDC_PROGRESSBAR_BACKGROUND; style = ST_CENTER; - sizeEx = 1 * GUI_GRID_CENTER_H; + sizeEx = QUOTE(1 * GUI_GRID_CENTER_H); colorBackground[] = {0,0,0,0.5}; - x = profileNamespace getVariable ['TRIPLES(IGUI,GVAR(grid),X)', 0]; - y = profileNamespace getVariable ['TRIPLES(IGUI,GVAR(grid),Y)', 0]; - w = profileNamespace getVariable ['TRIPLES(IGUI,GVAR(grid),W)', 0]; - h = profileNamespace getVariable ['TRIPLES(IGUI,GVAR(grid),H)', 0]; + x = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),X))), 0)]); + y = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),Y))), 0)]); + w = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),W))), 0)]); + h = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),H))), 0)]); }; class TitleText: TitleBackground { @@ -38,10 +38,10 @@ class RscTitles { colorFrame[] = {0,0,0,0.5}; colorBar[] = GUI_BCG_COLOR; texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - x = profileNamespace getVariable ['TRIPLES(IGUI,GVAR(grid),X)', 0]; - y = profileNamespace getVariable ['TRIPLES(IGUI,GVAR(grid),Y)', 0]; - w = profileNamespace getVariable ['TRIPLES(IGUI,GVAR(grid),W)', 0]; - h = profileNamespace getVariable ['TRIPLES(IGUI,GVAR(grid),H)', 0]; + x = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),X))), 0)]); + y = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),Y))), 0)]); + w = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),W))), 0)]); + h = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),H))), 0)]); }; class Script: RscMapControl { diff --git a/addons/ui/config.cpp b/addons/ui/config.cpp index bee706a6bd..bc692fcd4e 100644 --- a/addons/ui/config.cpp +++ b/addons/ui/config.cpp @@ -60,7 +60,7 @@ class _flexiMenu_RscShortcutButton: RscShortcutButton { left = -0.006; top = -0.007; w = 0.0392157; - h = 2*(safeZoneH/36); //0.0522876; + h = QUOTE(2*(safeZoneH/36)); //0.0522876; }; class TextPos { left = 0.01; // indent @@ -70,8 +70,8 @@ class _flexiMenu_RscShortcutButton: RscShortcutButton { }; }; //----------------------------------------------------------------------------- -#include "flexiMenu\data\menu_rose.hpp" -#include "flexiMenu\data\menu_arma2.hpp" -#include "flexiMenu\data\menu_buttonList.hpp" -#include "flexiMenu\data\menu_iconRow.hpp" -#include "flexiMenu\data\menu_popup.hpp" +// #include "flexiMenu\data\menu_rose.hpp" +// #include "flexiMenu\data\menu_arma2.hpp" +// #include "flexiMenu\data\menu_buttonList.hpp" +// #include "flexiMenu\data\menu_iconRow.hpp" +// #include "flexiMenu\data\menu_popup.hpp" diff --git a/addons/xeh/CfgFunctions.hpp b/addons/xeh/CfgFunctions.hpp index 041f27a548..81c692257c 100644 --- a/addons/xeh/CfgFunctions.hpp +++ b/addons/xeh/CfgFunctions.hpp @@ -13,15 +13,15 @@ class CfgFunctions { class preStart { preStart = 1; - file = PATHTOF(fnc_preStart.sqf); + file = QPATHTOF(fnc_preStart.sqf); }; class preInit { preInit = 1; - file = PATHTOF(fnc_preInit.sqf); + file = QPATHTOF(fnc_preInit.sqf); }; class postInit { postInit = 1; - file = PATHTOF(fnc_postInit.sqf); + file = QPATHTOF(fnc_postInit.sqf); }; }; }; @@ -29,15 +29,15 @@ class CfgFunctions { class A3 { class GUI { class initDisplay { - file = PATHTOF(fnc_initDisplay.sqf); + file = QPATHTOF(fnc_initDisplay.sqf); }; }; class Misc { class startLoadingScreen { - file = PATHTOF(fnc_startLoadingScreen.sqf); + file = QPATHTOF(fnc_startLoadingScreen.sqf); }; class endLoadingScreen { - file = PATHTOF(fnc_endLoadingScreen.sqf); + file = QPATHTOF(fnc_endLoadingScreen.sqf); }; }; }; diff --git a/hemtt.toml b/hemtt.toml index 40efd4274a..6f038b155a 100644 --- a/hemtt.toml +++ b/hemtt.toml @@ -12,8 +12,6 @@ files = [ "userconfig" ] -version = "3.15.1" - modname = "{{name}}" key_name = "{{prefix}}_{{version}}" authority = "{{prefix}}_{{version}}-{{git \"id 8\"}}" From 57b87c4e6451a5f4d7e30e49a3bffee23b5af650 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 15 Jan 2023 15:57:24 -0600 Subject: [PATCH 02/21] fix --- addons/keybinding/gui.hpp | 2 +- addons/ui/LobbyManager.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/keybinding/gui.hpp b/addons/keybinding/gui.hpp index eb7c4dde81..1a93e520c4 100644 --- a/addons/keybinding/gui.hpp +++ b/addons/keybinding/gui.hpp @@ -125,7 +125,7 @@ class RscDisplayConfigure { style = ST_RIGHT; text = ECSTRING(main,AddonText); x = QUOTE(POS_W(0.5)); - y = QUOTE(OS_H(1)); + y = QUOTE(POS_H(1)); w = QUOTE(POS_W(4)); h = QUOTE(POS_H(1)); sizeEx = QUOTE(POS_H(1)); diff --git a/addons/ui/LobbyManager.hpp b/addons/ui/LobbyManager.hpp index 1c29c80602..436c70ef89 100644 --- a/addons/ui/LobbyManager.hpp +++ b/addons/ui/LobbyManager.hpp @@ -36,7 +36,7 @@ class GVAR(LobbyManager) { h = QUOTE((120 - 10 - 5 - 7 - 2) * GRID_3DEN_H); sizeEx = QUOTE(3.96 * (1 / (getResolution select 3)) * pixelGrid * 0.5); colorBackground[] = {0, 0, 0, 0.3}; - disableKeyboardSearch = QUOTE(1); + disableKeyboardSearch = 1; }; class CallsignLabel: ctrlStatic { text = "$STR_3DEN_Group_Attribute_Callsign_displayName"; From 3d6a89c2e8064ccde20f0fd30096b768f95285cd Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 19 Jan 2023 20:41:50 -0600 Subject: [PATCH 03/21] Create fn_isdebugconsoleallowed.sqf --- .../debug/fn_isdebugconsoleallowed.sqf | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 include/a3/functions_f/debug/fn_isdebugconsoleallowed.sqf diff --git a/include/a3/functions_f/debug/fn_isdebugconsoleallowed.sqf b/include/a3/functions_f/debug/fn_isdebugconsoleallowed.sqf new file mode 100644 index 0000000000..95d8833225 --- /dev/null +++ b/include/a3/functions_f/debug/fn_isdebugconsoleallowed.sqf @@ -0,0 +1,127 @@ +/* + Author: + Killzone_Kid + + Description: + Returns true if debug console is allowed in current context + + Parameter(s): + NONE + + Returns: + BOOLEAN +*/ + +// == 3DEN MODE == + +if (is3DEN || is3DENMultiplayer) exitWith {true}; // allowed in 3DEN or 3DEN test server (host only) + +// == SP MODE == + +if (!isMultiplayer) exitWith +{ + allDisplays find findDisplay 313 in [0, 1] // 3DEN preview + || + {allDisplays find findDisplay 26 in [0, 1]} // 2DEN + || + {(configFile >> "enableDebugConsole") call {isArray _this || {isNumber _this && {getNumber _this >= 1}}}} // allowed by mod +}; + +// == MP MODE == + +// Get debug console permission from config: mission param > description.ext > Eden attribute > mod config +// 0 - not allowed +// 1 - allowed for server host and logged in admin +// 2 - allowed always +// [, , ...] - same as 1 + whitelist + +private _fnc_getConfigValue = +{ + if (isArray _this) exitWith {getArray _this}; + if (isNumber _this) exitWith {getNumber _this}; + 0 +}; + +private _enableDebugConsole = call +{ + // --- mission param (0 - disabled, 1 - enabled for admin) + private _chk = ["DebugConsole", nil] call (missionNamespace getVariable "BIS_fnc_getParamValue"); + if (!isNil "_chk") exitWith {_chk}; + + // --- mission config (0 - disabled, 1 - enabled for admin, 2 - enabled for anyone, [...] - enabled for admin and whitelist) + private _cfg = missionConfigFile >> "enableDebugConsole"; + if (!isNull _cfg) exitWith {_cfg call _fnc_getConfigValue}; + + // --- mission attribute (1 - enabled for admin, 2 - enabled for anyone) + _chk = getMissionConfigValue ["enableDebugConsole", 0]; + if !(_chk isEqualTo 0) exitWith {_chk}; + + // --- mod config (0 - disabled, 1 - enabled for admin, 2 - enabled for anyone, [...] - enabled for admin and whitelist) + _cfg = configFile >> "enableDebugConsole"; + if (!isNull _cfg) exitWith {_cfg call _fnc_getConfigValue}; + + //--- disabled + 0 +}; + +if (_enableDebugConsole isEqualTo 2) exitWith {true}; // always allowed + +private _whitelist = []; + +if (_enableDebugConsole isEqualType []) then +{ + _whitelist = _enableDebugConsole - [""]; + _enableDebugConsole = 1; +}; + +if !(_enableDebugConsole isEqualTo 1) exitWith {false}; // only admin or whitelist mode check from this point + +// --- Client check +if ( + hasInterface + && + isUIContext + && + { + isServer // server host + || + { + call (missionNamespace getVariable "BIS_fnc_admin") isEqualTo 2 // logged in admin + } + || + { + !(_whitelist isEqualTo []) // non-empty whitelist check + && + { + getPlayerUID player in _whitelist // whitelisted caller + } + } + } +) +exitWith {true}; + +// --- Server check +if ( + isServer + && + isRemoteExecuted + && + { + remoteExecutedOwner isEqualto 2 // server host + || + { + admin remoteExecutedOwner isEqualTo 2 // logged in admin + } + || + { + !(_whitelist isEqualTo []) // non-empty whitelist check + && + { + getPlayerUID (allPlayers select {owner _x isEqualTo remoteExecutedOwner} param [0, objNull]) in _whitelist // whitelisted caller + } + } + } +) +exitWith {true}; + +false \ No newline at end of file From 4213ffea0c39d1c8025dbfeb3ba85501d8ab7924 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 19 Jan 2023 20:54:50 -0600 Subject: [PATCH 04/21] test --- .gitignore | 5 +--- hemtt.toml => .hemtt/project.toml | 35 +++++++++++++++++++++------ addons/common/fnc_switchPlayer.sqf | 6 ++--- addons/diagnostic/test_assertions.sqf | 8 +++--- 4 files changed, 35 insertions(+), 19 deletions(-) rename hemtt.toml => .hemtt/project.toml (88%) diff --git a/.gitignore b/.gitignore index 5bdeb94482..c23a9b5f9a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,9 @@ release/* releases/* keys/* -.hemtt +.hemttout hemtt hemtt.exe -tools/hemtt*.tar.gz* -tools/hemtt*.zip* -.hemtt/local *.cache *.pbo texHeaders.bin diff --git a/hemtt.toml b/.hemtt/project.toml similarity index 88% rename from hemtt.toml rename to .hemtt/project.toml index 6f038b155a..8c5ef1fb89 100644 --- a/hemtt.toml +++ b/.hemtt/project.toml @@ -3,19 +3,38 @@ name = "CBA_A3" prefix = "cba" author = "CBATeam" mainprefix = "x" -files = [ - "mod.cpp", - "README.md", - "LICENSE.md", - "logo_cba_ca.paa", - "meta.cpp", - "userconfig" -] + modname = "{{name}}" key_name = "{{prefix}}_{{version}}" authority = "{{prefix}}_{{version}}-{{git \"id 8\"}}" + + +[asc] +enabled = true +exclude = [ + "\\initsettings.sqf", + "\\initkeybinds.sqf", + "\\xeh_prep.sqf", + "\\backwards_comp.sqf", + "settings\\gui_createcategory.sqf", + "diagnostic\\fnc_isdebugconsoleallowed.sqf", + "xeh\\fnc_initdisplay.sqf", + "xeh\\fnc_startloadingscreen.sqf", + "xeh\\fnc_endloadingscreen.sqf" +] + + + + + + + + + + + check = [ "!version_set" ] diff --git a/addons/common/fnc_switchPlayer.sqf b/addons/common/fnc_switchPlayer.sqf index 371d7a6e3b..a99336c983 100644 --- a/addons/common/fnc_switchPlayer.sqf +++ b/addons/common/fnc_switchPlayer.sqf @@ -43,13 +43,13 @@ _dummyUnit = (_ar select 4) createUnit [_type, [0, 0, 0], [], 0, "NONE"]; // Joi if (isNull _dummyUnit) exitWith { hint "Sorry, something went wrong, dummyUnit is null" }; [_oldUnit] join _dummyGroup; -LOG(format["1.Dummy created, State saved and put oldUnit in new group: %1", _dummyGroup]); +// LOG(format["1.Dummy created, State saved and put oldUnit in new group: %1", _dummyGroup]); private _newUnit = _dummyGroup createUnit [_type, _ar select 5, [], 0, "NONE"]; if (isNull _newUnit) exitWith { hint "Sorry, something went wrong, newUnit is null" }; -LOG(format["2.New unit created, local: %1", local _newUnit]); +// LOG(format["2.New unit created, local: %1", local _newUnit]); sleep 1; addSwitchableUnit _newUnit; @@ -58,7 +58,7 @@ selectPlayer _newUnit; _newUnit setRank (_ar select 2); _newUnit addScore (_ar select 3); -LOG(format["3.State transfered, switched player control to new unit, local: %1", local _newUnit]); +// LOG(format["3.State transfered, switched player control to new unit, local: %1", local _newUnit]); sleep 1; if (_ar select 7 != "") then { diff --git a/addons/diagnostic/test_assertions.sqf b/addons/diagnostic/test_assertions.sqf index 57e11bd0f1..3565f846d0 100644 --- a/addons/diagnostic/test_assertions.sqf +++ b/addons/diagnostic/test_assertions.sqf @@ -13,14 +13,14 @@ private ["_a", "_b"]; ERROR("Testing that ERROR() is output correctly"); _a = false; -ASSERT_TRUE(_a,"Checking ASSERT_TRUE(" + str(_a) + ") outputs an error correctly"); +ASSERT_TRUE(_a,"Checking AXSSERT_TRUE(" + str(_a) + ") outputs an error correctly"); _a = true; -ASSERT_FALSE(_a,"Checking ASSERT_FALSE(" + str(_a) + ")outputs an error correctly"); +ASSERT_FALSE(_a,"Checking AXSSERT_FALSE(" + str(_a) + ")outputs an error correctly"); _a = 1; _b = 2; -ASSERT_OP(_a,>,_b,"Checking ASSERT_OP(1>2) outputs an error correctly"); -ASSERT_DEFINED("_imaginaryFox","Checking ASSERT_DEFINED() is output correctly"); +ASSERT_OP(_a,>,_b,"Checking AXSSERT_OP(1>2) outputs an error correctly"); +ASSERT_DEFINED("_imaginaryFox","Checking AXSSERT_DEFINED() is output correctly"); nil; From b97286849ed85ee08d490f217ab8710e90443990 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 20 Jan 2023 11:39:12 -0600 Subject: [PATCH 05/21] asc:exclude - use forward slashes --- .hemtt/project.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.hemtt/project.toml b/.hemtt/project.toml index 8c5ef1fb89..355ae3479f 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -14,15 +14,15 @@ authority = "{{prefix}}_{{version}}-{{git \"id 8\"}}" [asc] enabled = true exclude = [ - "\\initsettings.sqf", - "\\initkeybinds.sqf", - "\\xeh_prep.sqf", - "\\backwards_comp.sqf", - "settings\\gui_createcategory.sqf", - "diagnostic\\fnc_isdebugconsoleallowed.sqf", - "xeh\\fnc_initdisplay.sqf", - "xeh\\fnc_startloadingscreen.sqf", - "xeh\\fnc_endloadingscreen.sqf" + "/initsettings.sqf", + "/initkeybinds.sqf", + "/xeh_prep.sqf", + "/backwards_comp.sqf", + "settings/gui_createcategory.sqf", + "diagnostic/fnc_isdebugconsoleallowed.sqf", + "xeh/fnc_initdisplay.sqf", + "xeh/fnc_startloadingscreen.sqf", + "xeh/fnc_endloadingscreen.sqf" ] From f10a937a2c159a6a3d5413adb258a6033d7fcc61 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 20 Jan 2023 11:41:55 -0600 Subject: [PATCH 06/21] undo assert changes --- addons/diagnostic/test_assertions.sqf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/diagnostic/test_assertions.sqf b/addons/diagnostic/test_assertions.sqf index 3565f846d0..57e11bd0f1 100644 --- a/addons/diagnostic/test_assertions.sqf +++ b/addons/diagnostic/test_assertions.sqf @@ -13,14 +13,14 @@ private ["_a", "_b"]; ERROR("Testing that ERROR() is output correctly"); _a = false; -ASSERT_TRUE(_a,"Checking AXSSERT_TRUE(" + str(_a) + ") outputs an error correctly"); +ASSERT_TRUE(_a,"Checking ASSERT_TRUE(" + str(_a) + ") outputs an error correctly"); _a = true; -ASSERT_FALSE(_a,"Checking AXSSERT_FALSE(" + str(_a) + ")outputs an error correctly"); +ASSERT_FALSE(_a,"Checking ASSERT_FALSE(" + str(_a) + ")outputs an error correctly"); _a = 1; _b = 2; -ASSERT_OP(_a,>,_b,"Checking AXSSERT_OP(1>2) outputs an error correctly"); -ASSERT_DEFINED("_imaginaryFox","Checking AXSSERT_DEFINED() is output correctly"); +ASSERT_OP(_a,>,_b,"Checking ASSERT_OP(1>2) outputs an error correctly"); +ASSERT_DEFINED("_imaginaryFox","Checking ASSERT_DEFINED() is output correctly"); nil; From 12f0672498dd1362e82e66de8d0c76c466606ec9 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 16 May 2023 15:52:30 +0200 Subject: [PATCH 07/21] Adapt to HEMTT v1 --- .github/workflows/arma.yml | 22 ++-- .github/workflows/documentation.yml | 2 +- .github/workflows/pboproject.yml | 8 +- .gitignore | 1 + .hemtt/hooks/post_release/01_rename_zip.rhai | 9 ++ .hemtt/hooks/pre_build/01_set_version.rhai | 4 + .hemtt/project.toml | 113 +++++-------------- tools/setup.bat | 23 ++-- 8 files changed, 68 insertions(+), 114 deletions(-) create mode 100644 .hemtt/hooks/post_release/01_rename_zip.rhai create mode 100644 .hemtt/hooks/pre_build/01_set_version.rhai diff --git a/.github/workflows/arma.yml b/.github/workflows/arma.yml index 601e234160..e1009560ec 100644 --- a/.github/workflows/arma.yml +++ b/.github/workflows/arma.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the source code - uses: actions/checkout@master + uses: actions/checkout@v3 - name: Validate SQF run: python3 tools/sqf_validator.py - name: Validate Config @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the source code - uses: actions/checkout@master + uses: actions/checkout@v3 - name: Lint (sqflint) uses: arma-actions/sqflint@master continue-on-error: true # No failure due to many false-positives @@ -34,13 +34,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the source code - uses: actions/checkout@master - - name: Build using HEMTT - uses: arma-actions/hemtt@master - with: - command: build --release --ci + uses: actions/checkout@v3 + - name: Setup HEMTT + uses: arma-actions/hemtt@v1 + - name: Run HEMTT build + run: hemtt build + - name: Rename build folder + run: mv .hemttout/build .hemttout/@CBA_A3 - name: Upload Artifact - uses: actions/upload-artifact@v2-preview + uses: actions/upload-artifact@v3 with: - name: CBA_A3-${{ github.sha }}-nobin - path: releases/CBA_A3_*.zip + name: CBA_A3_${{ github.sha }}-nobin + path: .hemttout/@* diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 5d22270237..75e897014e 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the source code - uses: actions/checkout@master + uses: actions/checkout@v3 - name: Install Python packages run: | pip3 install wheel diff --git a/.github/workflows/pboproject.yml b/.github/workflows/pboproject.yml index b09abe5fad..ac7f30a527 100644 --- a/.github/workflows/pboproject.yml +++ b/.github/workflows/pboproject.yml @@ -27,12 +27,12 @@ jobs: env: ARMA3_DATA_URL: ${{ secrets.ARMA3_DATA_URL }} - name: Checkout CBA A3 - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: x\cba persist-credentials: false - name: Checkout pull request - uses: actions/checkout@v2 + uses: actions/checkout@v3 if: ${{ github.event_name == 'pull_request_target' }} with: path: pullrequest @@ -53,13 +53,13 @@ jobs: env: PYTHONUNBUFFERED: 1 - name: Archive logs - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: ${{ always() }} with: name: logs path: temp/*.log - name: Archive @cba_a3 - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: '@cba_a3-${{ github.sha }}' path: x\cba\release\@cba_a3 diff --git a/.gitignore b/.gitignore index c23a9b5f9a..de9253bd21 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ Thumbs.db /store/wiki/* .vscode/* +*.zip *.7z /addons/CBA_Project.sublime-workspace diff --git a/.hemtt/hooks/post_release/01_rename_zip.rhai b/.hemtt/hooks/post_release/01_rename_zip.rhai new file mode 100644 index 0000000000..076bc4c231 --- /dev/null +++ b/.hemtt/hooks/post_release/01_rename_zip.rhai @@ -0,0 +1,9 @@ +let releases = HEMTT_RFS.join("releases"); + +let src = releases.join(HEMTT.project().prefix() + "-" + HEMTT.project().version().to_string() + ".zip"); +let dst = releases.join(HEMTT.project().name() + "_v" + HEMTT.project().version().to_string_short() + ".zip"); + +print("Moving zip to " + dst); +if !src.move(dst) { + fatal("Failed to move " + src + " to " + dst); +} diff --git a/.hemtt/hooks/pre_build/01_set_version.rhai b/.hemtt/hooks/pre_build/01_set_version.rhai new file mode 100644 index 0000000000..6c653a5bc4 --- /dev/null +++ b/.hemtt/hooks/pre_build/01_set_version.rhai @@ -0,0 +1,4 @@ +let modcpp = HEMTT_VFS.join("mod.cpp").open_file().read(); +modcpp.replace("0.0.0", HEMTT.project().version().to_string_short()); +HEMTT_VFS.join("mod.cpp").create_file().write(modcpp); +print("mod.cpp version set"); diff --git a/.hemtt/project.toml b/.hemtt/project.toml index 355ae3479f..37ecca5ef9 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -1,95 +1,36 @@ -# HEMTT: https://github.com/synixebrett/HEMTT/commit/d828af84613f6725732a4c42c8b4611ae2a0cf81 name = "CBA_A3" prefix = "cba" author = "CBATeam" -mainprefix = "x" - - -modname = "{{name}}" -key_name = "{{prefix}}_{{version}}" -authority = "{{prefix}}_{{version}}-{{git \"id 8\"}}" +[files] +include = [ + "mod.cpp", + "README.md", + "LICENSE.md", + "logo_cba_ca.paa", + "meta.cpp", + "userconfig", +] +[version] +git_hash = 0 [asc] enabled = true exclude = [ - "/initsettings.sqf", - "/initkeybinds.sqf", - "/xeh_prep.sqf", - "/backwards_comp.sqf", - "settings/gui_createcategory.sqf", - "diagnostic/fnc_isdebugconsoleallowed.sqf", - "xeh/fnc_initdisplay.sqf", - "xeh/fnc_startloadingscreen.sqf", - "xeh/fnc_endloadingscreen.sqf" -] - - - - - - - - - - - -check = [ - "!version_set" -] -prebuild = ["!compile_sqf"] -releasebuild = [ - "@zip CBA_A3_v{{semver.major}}.{{semver.minor}}.{{semver.patch}}", - "!version_unset" - ,"!compile_sqf_cleanup" -] - -[header_exts] -version = "{{git \"id 8\"}}" - -[scripts.version_set] -steps_linux = [ - "echo Setting version", - "sed -i -r -s 's/[0-9]+\\.[0-9]+\\.[0-9]+/{{semver.major}}.{{semver.minor}}.{{semver.patch}}/g' mod.cpp README.md addons/main_a3/CfgMods.hpp", - "sed -i -r -s 's/#define BUILD 000000/#define BUILD {{date \"%y%m%d\"}}/g' addons/main/script_version.hpp" -] -steps_windows = [ - "echo Setting version", - "powershell -Command foreach ($f in 'mod.cpp', 'README.md', 'addons/main_a3/CfgMods.hpp') {(Get-Content $f) -replace '[0-9]+\\.[0-9]+\\.[0-9]+', '{{semver.major}}.{{semver.minor}}.{{semver.patch}}' -join \"`n\" ^| Set-Content -NoNewline $f; Add-Content -NoNewline \"`n\" $f}", - "powershell -Command foreach ($f in 'addons/main/script_version.hpp') {(Get-Content $f) -replace '#define BUILD 000000', '#define BUILD {{date \"%y%m%d\"}}' -join \"`n\" ^| Set-Content -NoNewline $f; Add-Content -NoNewline \"`n\" $f}" -] -only_release = true -show_output = true - -[scripts.version_unset] -steps_linux = [ - "echo 'Unsetting version'", - "sed -i -r -s 's/{{semver.major}}.{{semver.minor}}.{{semver.patch}}/0.0.0/g' mod.cpp addons/main_a3/CfgMods.hpp", - "sed -i -r -s 's/#define BUILD {{date \"%y%m%d\"}}/#define BUILD 000000/g' addons/main/script_version.hpp", - "echo '-> README.md version ready for commit (ignore until release)!'" -] -steps_windows = [ - "echo Unsetting version", - "powershell -Command foreach ($f in 'mod.cpp', 'addons/main_a3/CfgMods.hpp') {(Get-Content $f) -replace '{{semver.major}}.{{semver.minor}}.{{semver.patch}}', '0.0.0' -join \"`n\" ^| Set-Content -NoNewline $f; Add-Content -NoNewline \"`n\" $f}", - "powershell -Command foreach ($f in 'addons/main/script_version.hpp') {(Get-Content $f) -replace '#define BUILD {{date \"%y%m%d\"}}', '#define BUILD 000000' -join \"`n\" ^| Set-Content -NoNewline $f; Add-Content -NoNewline \"`n\" $f}", - "echo -^> README.md version ready for commit (ignore until release)!" -] -only_release = true -show_output = true - -[scripts.compile_sqf] -steps_windows = [ - "echo 'compile_sqf'", - "py tools/compile_sqf.py cleanup build" -] -only_release = true -show_output = true - -[scripts.compile_sqf_cleanup] -steps_windows = [ - "echo 'compile_sqf_cleanup'", - "py tools/compile_sqf.py cleanup" -] -only_release = true -show_output = true + "/initsettings.sqf", + "/initkeybinds.sqf", + "/xeh_prep.sqf", + "/backwards_comp.sqf", + "settings/gui_createcategory.sqf", + "diagnostic/fnc_isdebugconsoleallowed.sqf", + "xeh/fnc_initdisplay.sqf", + "xeh/fnc_startloadingscreen.sqf", + "xeh/fnc_endloadingscreen.sqf", +] + +[hemtt.config] +preset = "Hemtt" + +#[hemtt.release] +#folder = "CBA_A3" diff --git a/tools/setup.bat b/tools/setup.bat index 3138c0fbde..8d7245ab7b 100644 --- a/tools/setup.bat +++ b/tools/setup.bat @@ -1,19 +1,16 @@ ;@Findstr -bv ;@F "%~f0" | powershell -Command - & pause & goto:eof -# Unzip backwards compatibility (Windows 8) -Add-Type -AssemblyName System.IO.Compression.FileSystem -function Unzip { - param([string]$zipfile, [string]$outpath) +Write-Output "=> Downloading ..." +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - [System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath) -} +$url = "https://github.com/BrettMayson/HEMTT/releases/latest/download/windows-x64.zip" +(New-Object Net.WebClient).DownloadFile($url, "hemtt.zip"); Write-Output "$url => hemtt.zip" -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -$client = New-Object Net.WebClient +Write-Output "`n=> Extracting ..." +Expand-Archive -Path "hemtt.zip" -DestinationPath "..\." -Force; Write-Output "hemtt.zip" +Remove-Item "hemtt.zip" -Write-Output "=> Downloading HEMTT (Windows) ..." -$client.DownloadFile("https://ci.appveyor.com/api/buildjobs/y3p6cb7av05f83fo/artifacts/target%2Fx86_64-pc-windows-msvc%2Frelease%2Fhemtt.exe", "..\hemtt.exe") -$client.dispose() +Write-Output "`n=> Verifying ..." +Start-Process -FilePath ..\hemtt.exe -ArgumentList --version -NoNewWindow -Wait -Write-Output ("=> Version: {0}`n" -f (iex "..\hemtt.exe --version")) -Write-Output "=> HEMTT successfully installed to project!" +Write-Output "`nTools successfully installed to project!" From d72d8ac504abcf9569b4cbdc34502de94011faf9 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 16 May 2023 16:02:51 +0200 Subject: [PATCH 08/21] Set version in CfgMods.hpp and build in script_version.hpp in HEMTT hook --- .hemtt/hooks/pre_build/01_set_version.rhai | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.hemtt/hooks/pre_build/01_set_version.rhai b/.hemtt/hooks/pre_build/01_set_version.rhai index 6c653a5bc4..d58e083238 100644 --- a/.hemtt/hooks/pre_build/01_set_version.rhai +++ b/.hemtt/hooks/pre_build/01_set_version.rhai @@ -2,3 +2,13 @@ let modcpp = HEMTT_VFS.join("mod.cpp").open_file().read(); modcpp.replace("0.0.0", HEMTT.project().version().to_string_short()); HEMTT_VFS.join("mod.cpp").create_file().write(modcpp); print("mod.cpp version set"); + +let cfgmodshpp = HEMTT_VFS.join("addons").join("main_a3").join("CfgMods.hpp").open_file().read(); +cfgmodshpp.replace("0.0.0", HEMTT.project().version().to_string_short()); +HEMTT_VFS.join("addons").join("main_a3").join("CfgMods.hpp").create_file().write(cfgmodshpp); +print("addons/main_a3/CfgMods.hpp version set"); + +let scriptversion = HEMTT_VFS.join("addons").join("main").join("script_version.hpp").open_file().read(); +scriptversion.replace("000000", HEMTT.project().version().build()); // TODO date %y%m%d (eg. 220912) +HEMTT_VFS.join("addons").join("main").join("script_version.hpp").create_file().write(scriptversion); +print("addons/main/script_version.hpp build set"); From 3bc46af533dc66966cccb845544000a135916367 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 16 May 2023 16:18:36 +0200 Subject: [PATCH 09/21] Add missing includes, Fix script_version build set, Update HEMTT config --- .hemtt/hooks/pre_build/01_set_version.rhai | 2 +- .hemtt/project.toml | 8 +- .../diagnostic/fnc_isDebugConsoleAllowed.sqf | 2 +- addons/strings/fnc_decodeURL.sqf | 222 +----------------- addons/strings/script_component.hpp | 220 +++++++++++++++++ addons/ui/RscDisplayOptionsLayout.hpp | 2 +- addons/xeh/fnc_endLoadingScreen.sqf | 2 +- addons/xeh/fnc_initDisplay.sqf | 2 +- addons/xeh/fnc_startLoadingScreen.sqf | 2 +- ...lowed.sqf => fn_isDebugConsoleAllowed.sqf} | 0 include/a3/functions_f/gui/fn_initDisplay.sqf | 151 ++++++++++++ .../functions_f/misc/fn_endLoadingScreen.sqf | 33 +++ .../misc/fn_startLoadingScreen.sqf | 34 +++ 13 files changed, 449 insertions(+), 231 deletions(-) rename include/a3/functions_f/debug/{fn_isdebugconsoleallowed.sqf => fn_isDebugConsoleAllowed.sqf} (100%) create mode 100644 include/a3/functions_f/gui/fn_initDisplay.sqf create mode 100644 include/a3/functions_f/misc/fn_endLoadingScreen.sqf create mode 100644 include/a3/functions_f/misc/fn_startLoadingScreen.sqf diff --git a/.hemtt/hooks/pre_build/01_set_version.rhai b/.hemtt/hooks/pre_build/01_set_version.rhai index d58e083238..28bc30a643 100644 --- a/.hemtt/hooks/pre_build/01_set_version.rhai +++ b/.hemtt/hooks/pre_build/01_set_version.rhai @@ -9,6 +9,6 @@ HEMTT_VFS.join("addons").join("main_a3").join("CfgMods.hpp").create_file().write print("addons/main_a3/CfgMods.hpp version set"); let scriptversion = HEMTT_VFS.join("addons").join("main").join("script_version.hpp").open_file().read(); -scriptversion.replace("000000", HEMTT.project().version().build()); // TODO date %y%m%d (eg. 220912) +scriptversion.replace("000000", HEMTT.project().version().build().to_string()); // TODO date %y%m%d (eg. 220912) HEMTT_VFS.join("addons").join("main").join("script_version.hpp").create_file().write(scriptversion); print("addons/main/script_version.hpp build set"); diff --git a/.hemtt/project.toml b/.hemtt/project.toml index 37ecca5ef9..238b9d4ca6 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -9,14 +9,14 @@ include = [ "LICENSE.md", "logo_cba_ca.paa", "meta.cpp", - "userconfig", + "userconfig/**", ] [version] git_hash = 0 [asc] -enabled = true +enabled = false exclude = [ "/initsettings.sqf", "/initkeybinds.sqf", @@ -32,5 +32,5 @@ exclude = [ [hemtt.config] preset = "Hemtt" -#[hemtt.release] -#folder = "CBA_A3" +[hemtt.release] +folder = "CBA_A3" diff --git a/addons/diagnostic/fnc_isDebugConsoleAllowed.sqf b/addons/diagnostic/fnc_isDebugConsoleAllowed.sqf index 76601b29f8..01bc31afab 100644 --- a/addons/diagnostic/fnc_isDebugConsoleAllowed.sqf +++ b/addons/diagnostic/fnc_isDebugConsoleAllowed.sqf @@ -5,5 +5,5 @@ if (str missionConfigFile == "A3\Missions_F_Bootcamp\Scenarios\Arsenal.VR\descri if (!isMultiplayer && {getNumber (missionConfigFile >> "enableDebugConsoleSP") == 1}) exitWith {true}; call { - #include "\a3\functions_f\Debug\fn_isDebugConsoleAllowed.sqf"; + #include "\a3\functions_f\debug\fn_isDebugConsoleAllowed.sqf"; }; diff --git a/addons/strings/fnc_decodeURL.sqf b/addons/strings/fnc_decodeURL.sqf index e25fad7815..1c2bee2f75 100644 --- a/addons/strings/fnc_decodeURL.sqf +++ b/addons/strings/fnc_decodeURL.sqf @@ -20,226 +20,6 @@ Author: commy2 ---------------------------------------------------------------------------- */ -#define UTF8_TABLE [\ - ["%20"," "],\ - ["%21","!"],\ - ["%22",""""],\ - ["%23","#"],\ - ["%24","$"],\ - ["%26","&"],\ - ["%27","'"],\ - ["%28","("],\ - ["%29",")"],\ - ["%2a","*"],\ - ["%2b","+"],\ - ["%2c",","],\ - ["%2d","-"],\ - ["%2e","."],\ - ["%2f","/"],\ - ["%30","0"],\ - ["%31","1"],\ - ["%32","2"],\ - ["%33","3"],\ - ["%34","4"],\ - ["%35","5"],\ - ["%36","6"],\ - ["%37","7"],\ - ["%38","8"],\ - ["%39","9"],\ - ["%3a",":"],\ - ["%3b",";"],\ - ["%3c","<"],\ - ["%3d","="],\ - ["%3e",">"],\ - ["%3f","?"],\ - ["%40","@"],\ - ["%41","A"],\ - ["%42","B"],\ - ["%43","C"],\ - ["%44","D"],\ - ["%45","E"],\ - ["%46","F"],\ - ["%47","G"],\ - ["%48","H"],\ - ["%49","I"],\ - ["%4a","J"],\ - ["%4b","K"],\ - ["%4c","L"],\ - ["%4d","M"],\ - ["%4e","N"],\ - ["%4f","O"],\ - ["%50","P"],\ - ["%51","Q"],\ - ["%52","R"],\ - ["%53","S"],\ - ["%54","T"],\ - ["%55","U"],\ - ["%56","V"],\ - ["%57","W"],\ - ["%58","X"],\ - ["%59","Y"],\ - ["%5a","Z"],\ - ["%5b","["],\ - ["%5c","\"],\ - ["%5d","]"],\ - ["%5e","^"],\ - ["%5f","_"],\ - ["%60","`"],\ - ["%61","a"],\ - ["%62","b"],\ - ["%63","c"],\ - ["%64","d"],\ - ["%65","e"],\ - ["%66","f"],\ - ["%67","g"],\ - ["%68","h"],\ - ["%69","i"],\ - ["%6a","j"],\ - ["%6b","k"],\ - ["%6c","l"],\ - ["%6d","m"],\ - ["%6e","n"],\ - ["%6f","o"],\ - ["%70","p"],\ - ["%71","q"],\ - ["%72","r"],\ - ["%73","s"],\ - ["%74","t"],\ - ["%75","u"],\ - ["%76","v"],\ - ["%77","w"],\ - ["%78","x"],\ - ["%79","y"],\ - ["%7a","z"],\ - ["%7b","{"],\ - ["%7c","|"],\ - ["%7d","}"],\ - ["%7e","~"],\ - ["%e2%82%ac","`"],\ - ["%e2%80%9a","‚"],\ - ["%c6%92","ƒ"],\ - ["%e2%80%9e","„"],\ - ["%e2%80%a6","…"],\ - ["%e2%80%a0","†"],\ - ["%e2%80%a1","‡"],\ - ["%cb%86","ˆ"],\ - ["%e2%80%b0","‰"],\ - ["%c5%a0","Š"],\ - ["%e2%80%b9","‹"],\ - ["%c5%92","Œ"],\ - ["%c5%bd","Ž"],\ - ["%e2%80%98","‘"],\ - ["%e2%80%99","’"],\ - ["%e2%80%9c","“"],\ - ["%e2%80%9d","”"],\ - ["%e2%80%a2","•"],\ - ["%e2%80%93","–"],\ - ["%e2%80%94","—"],\ - ["%cb%9c","˜"],\ - ["%e2%84","™"],\ - ["%c5%a1","š"],\ - ["%e2%80","›"],\ - ["%c5%93","œ"],\ - ["%c5%be","ž"],\ - ["%c5%b8","Ÿ"],\ - ["%c2%a1","¡"],\ - ["%c2%a2","¢"],\ - ["%c2%a3","£"],\ - ["%c2%a4","¤"],\ - ["%c2%a5","¥"],\ - ["%c2%a6","¦"],\ - ["%c2%a7","§"],\ - ["%c2%a8","¨"],\ - ["%c2%a9","©"],\ - ["%c2%aa","ª"],\ - ["%c2%ab","«"],\ - ["%c2%ac","¬"],\ - ["%c2%ae","®"],\ - ["%c2%af","¯"],\ - ["%c2%b0","°"],\ - ["%c2%b1","±"],\ - ["%c2%b2","²"],\ - ["%c2%b3","³"],\ - ["%c2%b4","´"],\ - ["%c2%b5","µ"],\ - ["%c2%b6","¶"],\ - ["%c2%b7","·"],\ - ["%c2%b8","¸"],\ - ["%c2%b9","¹"],\ - ["%c2%ba","º"],\ - ["%c2%bb","»"],\ - ["%c2%bc","¼"],\ - ["%c2%bd","½"],\ - ["%c2%be","¾"],\ - ["%c2%bf","¿"],\ - ["%c3%80","À"],\ - ["%c3%81","Á"],\ - ["%c3%82","Â"],\ - ["%c3%83","Ã"],\ - ["%c3%84","Ä"],\ - ["%c3%85","Å"],\ - ["%c3%86","Æ"],\ - ["%c3%87","Ç"],\ - ["%c3%88","È"],\ - ["%c3%89","É"],\ - ["%c3%8a","Ê"],\ - ["%c3%8b","Ë"],\ - ["%c3%8c","Ì"],\ - ["%c3%8d","Í"],\ - ["%c3%8e","Î"],\ - ["%c3%8f","Ï"],\ - ["%c3%90","Ð"],\ - ["%c3%91","Ñ"],\ - ["%c3%92","Ò"],\ - ["%c3%93","Ó"],\ - ["%c3%94","Ô"],\ - ["%c3%95","Õ"],\ - ["%c3%96","Ö"],\ - ["%c3%97","×"],\ - ["%c3%98","Ø"],\ - ["%c3%99","Ù"],\ - ["%c3%9a","Ú"],\ - ["%c3%9b","Û"],\ - ["%c3%9c","Ü"],\ - ["%c3%9d","Ý"],\ - ["%c3%9e","Þ"],\ - ["%c3%9f","ß"],\ - ["%c3%a0","à"],\ - ["%c3%a1","á"],\ - ["%c3%a2","â"],\ - ["%c3%a3","ã"],\ - ["%c3%a4","ä"],\ - ["%c3%a5","å"],\ - ["%c3%a6","æ"],\ - ["%c3%a7","ç"],\ - ["%c3%a8","è"],\ - ["%c3%a9","é"],\ - ["%c3%aa","ê"],\ - ["%c3%ab","ë"],\ - ["%c3%ac","ì"],\ - ["%c3%ad","í"],\ - ["%c3%ae","î"],\ - ["%c3%af","ï"],\ - ["%c3%b0","ð"],\ - ["%c3%b1","ñ"],\ - ["%c3%b2","ò"],\ - ["%c3%b3","ó"],\ - ["%c3%b4","ô"],\ - ["%c3%b5","õ"],\ - ["%c3%b6","ö"],\ - ["%c3%b7","÷"],\ - ["%c3%b8","ø"],\ - ["%c3%b9","ù"],\ - ["%c3%ba","ú"],\ - ["%c3%bb","û"],\ - ["%c3%bc","ü"],\ - ["%c3%bd","ý"],\ - ["%c3%be","þ"],\ - ["%c3%bf","ÿ"],\ - ["%%","%"],\ - ["%25","%"]\ -] - params [["_string", "", [""]]]; if (_string isEqualTo "") exitWith {""}; @@ -248,7 +28,7 @@ private _return = _cache getVariable _string; if (isNil "_return") then { _return = _string; - + // Only replace if there is at least one character to replace if ("%" in _return) then { { diff --git a/addons/strings/script_component.hpp b/addons/strings/script_component.hpp index a6a2024e65..2e913ab891 100644 --- a/addons/strings/script_component.hpp +++ b/addons/strings/script_component.hpp @@ -10,3 +10,223 @@ #endif #include "\x\cba\addons\main\script_macros.hpp" + +#define UTF8_TABLE [\ + ["%20"," "],\ + ["%21","!"],\ + ["%22",""""],\ + ["%23","#"],\ + ["%24","$"],\ + ["%26","&"],\ + ["%27","'"],\ + ["%28","("],\ + ["%29",")"],\ + ["%2a","*"],\ + ["%2b","+"],\ + ["%2c",","],\ + ["%2d","-"],\ + ["%2e","."],\ + ["%2f","/"],\ + ["%30","0"],\ + ["%31","1"],\ + ["%32","2"],\ + ["%33","3"],\ + ["%34","4"],\ + ["%35","5"],\ + ["%36","6"],\ + ["%37","7"],\ + ["%38","8"],\ + ["%39","9"],\ + ["%3a",":"],\ + ["%3b",";"],\ + ["%3c","<"],\ + ["%3d","="],\ + ["%3e",">"],\ + ["%3f","?"],\ + ["%40","@"],\ + ["%41","A"],\ + ["%42","B"],\ + ["%43","C"],\ + ["%44","D"],\ + ["%45","E"],\ + ["%46","F"],\ + ["%47","G"],\ + ["%48","H"],\ + ["%49","I"],\ + ["%4a","J"],\ + ["%4b","K"],\ + ["%4c","L"],\ + ["%4d","M"],\ + ["%4e","N"],\ + ["%4f","O"],\ + ["%50","P"],\ + ["%51","Q"],\ + ["%52","R"],\ + ["%53","S"],\ + ["%54","T"],\ + ["%55","U"],\ + ["%56","V"],\ + ["%57","W"],\ + ["%58","X"],\ + ["%59","Y"],\ + ["%5a","Z"],\ + ["%5b","["],\ + ["%5c","\"],\ + ["%5d","]"],\ + ["%5e","^"],\ + ["%5f","_"],\ + ["%60","`"],\ + ["%61","a"],\ + ["%62","b"],\ + ["%63","c"],\ + ["%64","d"],\ + ["%65","e"],\ + ["%66","f"],\ + ["%67","g"],\ + ["%68","h"],\ + ["%69","i"],\ + ["%6a","j"],\ + ["%6b","k"],\ + ["%6c","l"],\ + ["%6d","m"],\ + ["%6e","n"],\ + ["%6f","o"],\ + ["%70","p"],\ + ["%71","q"],\ + ["%72","r"],\ + ["%73","s"],\ + ["%74","t"],\ + ["%75","u"],\ + ["%76","v"],\ + ["%77","w"],\ + ["%78","x"],\ + ["%79","y"],\ + ["%7a","z"],\ + ["%7b","{"],\ + ["%7c","|"],\ + ["%7d","}"],\ + ["%7e","~"],\ + ["%e2%82%ac","`"],\ + ["%e2%80%9a","‚"],\ + ["%c6%92","ƒ"],\ + ["%e2%80%9e","„"],\ + ["%e2%80%a6","…"],\ + ["%e2%80%a0","†"],\ + ["%e2%80%a1","‡"],\ + ["%cb%86","ˆ"],\ + ["%e2%80%b0","‰"],\ + ["%c5%a0","Š"],\ + ["%e2%80%b9","‹"],\ + ["%c5%92","Œ"],\ + ["%c5%bd","Ž"],\ + ["%e2%80%98","‘"],\ + ["%e2%80%99","’"],\ + ["%e2%80%9c","“"],\ + ["%e2%80%9d","”"],\ + ["%e2%80%a2","•"],\ + ["%e2%80%93","–"],\ + ["%e2%80%94","—"],\ + ["%cb%9c","˜"],\ + ["%e2%84","™"],\ + ["%c5%a1","š"],\ + ["%e2%80","›"],\ + ["%c5%93","œ"],\ + ["%c5%be","ž"],\ + ["%c5%b8","Ÿ"],\ + ["%c2%a1","¡"],\ + ["%c2%a2","¢"],\ + ["%c2%a3","£"],\ + ["%c2%a4","¤"],\ + ["%c2%a5","¥"],\ + ["%c2%a6","¦"],\ + ["%c2%a7","§"],\ + ["%c2%a8","¨"],\ + ["%c2%a9","©"],\ + ["%c2%aa","ª"],\ + ["%c2%ab","«"],\ + ["%c2%ac","¬"],\ + ["%c2%ae","®"],\ + ["%c2%af","¯"],\ + ["%c2%b0","°"],\ + ["%c2%b1","±"],\ + ["%c2%b2","²"],\ + ["%c2%b3","³"],\ + ["%c2%b4","´"],\ + ["%c2%b5","µ"],\ + ["%c2%b6","¶"],\ + ["%c2%b7","·"],\ + ["%c2%b8","¸"],\ + ["%c2%b9","¹"],\ + ["%c2%ba","º"],\ + ["%c2%bb","»"],\ + ["%c2%bc","¼"],\ + ["%c2%bd","½"],\ + ["%c2%be","¾"],\ + ["%c2%bf","¿"],\ + ["%c3%80","À"],\ + ["%c3%81","Á"],\ + ["%c3%82","Â"],\ + ["%c3%83","Ã"],\ + ["%c3%84","Ä"],\ + ["%c3%85","Å"],\ + ["%c3%86","Æ"],\ + ["%c3%87","Ç"],\ + ["%c3%88","È"],\ + ["%c3%89","É"],\ + ["%c3%8a","Ê"],\ + ["%c3%8b","Ë"],\ + ["%c3%8c","Ì"],\ + ["%c3%8d","Í"],\ + ["%c3%8e","Î"],\ + ["%c3%8f","Ï"],\ + ["%c3%90","Ð"],\ + ["%c3%91","Ñ"],\ + ["%c3%92","Ò"],\ + ["%c3%93","Ó"],\ + ["%c3%94","Ô"],\ + ["%c3%95","Õ"],\ + ["%c3%96","Ö"],\ + ["%c3%97","×"],\ + ["%c3%98","Ø"],\ + ["%c3%99","Ù"],\ + ["%c3%9a","Ú"],\ + ["%c3%9b","Û"],\ + ["%c3%9c","Ü"],\ + ["%c3%9d","Ý"],\ + ["%c3%9e","Þ"],\ + ["%c3%9f","ß"],\ + ["%c3%a0","à"],\ + ["%c3%a1","á"],\ + ["%c3%a2","â"],\ + ["%c3%a3","ã"],\ + ["%c3%a4","ä"],\ + ["%c3%a5","å"],\ + ["%c3%a6","æ"],\ + ["%c3%a7","ç"],\ + ["%c3%a8","è"],\ + ["%c3%a9","é"],\ + ["%c3%aa","ê"],\ + ["%c3%ab","ë"],\ + ["%c3%ac","ì"],\ + ["%c3%ad","í"],\ + ["%c3%ae","î"],\ + ["%c3%af","ï"],\ + ["%c3%b0","ð"],\ + ["%c3%b1","ñ"],\ + ["%c3%b2","ò"],\ + ["%c3%b3","ó"],\ + ["%c3%b4","ô"],\ + ["%c3%b5","õ"],\ + ["%c3%b6","ö"],\ + ["%c3%b7","÷"],\ + ["%c3%b8","ø"],\ + ["%c3%b9","ù"],\ + ["%c3%ba","ú"],\ + ["%c3%bb","û"],\ + ["%c3%bc","ü"],\ + ["%c3%bd","ý"],\ + ["%c3%be","þ"],\ + ["%c3%bf","ÿ"],\ + ["%%","%"],\ + ["%25","%"]\ +] diff --git a/addons/ui/RscDisplayOptionsLayout.hpp b/addons/ui/RscDisplayOptionsLayout.hpp index 80dfc8b119..945e2150bb 100644 --- a/addons/ui/RscDisplayOptionsLayout.hpp +++ b/addons/ui/RscDisplayOptionsLayout.hpp @@ -12,7 +12,7 @@ class RscDisplayOptionsLayout { onMouseButtonUp = "with uiNamespace do {['mouseButtonUp',_this,''] call RscDisplayOptionsLayout_script;};"; }; #define ADD_ELEMENT(var1) class Element##var1: Element022 {\ - idc = QUOTE(12##var1);\ + idc = 12##var1;\ } ADD_ELEMENT(023); ADD_ELEMENT(024); diff --git a/addons/xeh/fnc_endLoadingScreen.sqf b/addons/xeh/fnc_endLoadingScreen.sqf index 47f8487490..11abb2c29e 100644 --- a/addons/xeh/fnc_endLoadingScreen.sqf +++ b/addons/xeh/fnc_endLoadingScreen.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" private _return = call { - #include "\a3\functions_f\Misc\fn_endLoadingScreen.sqf" + #include "\a3\functions_f\misc\fn_endLoadingScreen.sqf" }; isNil { diff --git a/addons/xeh/fnc_initDisplay.sqf b/addons/xeh/fnc_initDisplay.sqf index b6d7947d65..3520626fec 100644 --- a/addons/xeh/fnc_initDisplay.sqf +++ b/addons/xeh/fnc_initDisplay.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" call { - #include "\a3\functions_f\GUI\fn_initDisplay.sqf" + #include "\a3\functions_f\gui\fn_initDisplay.sqf" }; params [["_event", "", [""]], ["_args", []], ["_className", "", [""]]]; diff --git a/addons/xeh/fnc_startLoadingScreen.sqf b/addons/xeh/fnc_startLoadingScreen.sqf index ca026c78e2..4f4c723539 100644 --- a/addons/xeh/fnc_startLoadingScreen.sqf +++ b/addons/xeh/fnc_startLoadingScreen.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" private _return = call { - #include "\a3\functions_f\Misc\fn_startLoadingScreen.sqf" + #include "\a3\functions_f\misc\fn_startLoadingScreen.sqf" }; isNil { diff --git a/include/a3/functions_f/debug/fn_isdebugconsoleallowed.sqf b/include/a3/functions_f/debug/fn_isDebugConsoleAllowed.sqf similarity index 100% rename from include/a3/functions_f/debug/fn_isdebugconsoleallowed.sqf rename to include/a3/functions_f/debug/fn_isDebugConsoleAllowed.sqf diff --git a/include/a3/functions_f/gui/fn_initDisplay.sqf b/include/a3/functions_f/gui/fn_initDisplay.sqf new file mode 100644 index 0000000000..b552313c7d --- /dev/null +++ b/include/a3/functions_f/gui/fn_initDisplay.sqf @@ -0,0 +1,151 @@ +/* + Author: + Karel Moricky, improved by Killzone_Kid + + Description: + Initialize displays during preStart or init GUI display and run its script + The config class of the display is available in "BIS_fnc_initDisplay_configClass" stored on display + Example: _display getVariable "BIS_fnc_initDisplay_configClass"; + Display is also stored in uiNamespace variable with config class name + Example: uiNamespace getVariable "RscAvCamera"; + + Parameter(s): + ARRAY - [] init displays during preStart + or + 0: STRING - mode, can be "onLoad" or "onUnload" + 1: ARRAY - params passed from "onLoad" or "onUnload" event handler, contains only DISPLAY + 2: STRING - display class + 3: STRING - script path from CfgScriptPaths + + Returns: + NOTHING +*/ + +#define CONFIG_CLASS_VAR "BIS_fnc_initDisplay_configClass" +#define INIT_GAME_VAR "BIS_initGame" + +// init displays during preStart (moved from BIS_fnc_initDisplays) +if (_this isEqualTo []) exitWith +{ + { + { + if (getNumber (_x >> "scriptIsInternal") isEqualTo 0) then //--- Ignore internal scripts, they're recompiled first time they're opened + { + _scriptName = getText (_x >> "scriptName"); + _scriptPath = getText (_x >> "scriptPath"); + + if (_scriptName isEqualTo "" || _scriptPath isEqualTo "") exitWith + { + [ + 'Undefined param(s) [scriptPath: "%2", scriptName: "%3"] while trying to init display "%1"', + configName _x, + _scriptPath, + _scriptName + ] + call BIS_fnc_logFormat; + }; + + _script = _scriptName + "_script"; + + if (uiNamespace getVariable [_script, 0] isEqualType {}) exitWith {}; //--- already compiled + + uiNamespace setVariable + [ + _script, + compileScript [ + format ["%1%2.sqf", getText (configFile >> "CfgScriptPaths" >> _scriptPath), _scriptName], + true, // final + format ["scriptName '%1'; _fnc_scriptName = '%1'; ", _scriptName] // prefix + ] + ]; + }; + } + forEach ("isText (_x >> 'scriptPath')" configClasses _x); + } + forEach + [ + configFile, + configFile >> "RscTitles", + configFile >> "RscInGameUI", + configFile >> "Cfg3DEN" >> "Attributes" + ]; + + nil +}; + +//--- Register/unregister display +with uiNamespace do +{ + params + [ + ["_mode", "", [""]], + ["_params", []], + ["_class", "", [""]], + ["_path", "default", [""]], + ["_register", true, [true, 0]] + ]; + + _display = _params param [0, displayNull]; + if (isNull _display) exitWith {nil}; + + if (_register isEqualType true) then {_register = parseNumber _register}; + if (_register > 0) then + { + _varDisplays = _path + "_displays"; + _displays = (uiNamespace getVariable [_varDisplays, []]) - [displayNull]; + + if (_mode == "onLoad") exitWith + { + //--- Register current display + _display setVariable [CONFIG_CLASS_VAR, _class]; + uiNamespace setVariable [_class, _display]; + + _displays pushBackUnique _display; + uiNamespace setVariable [_varDisplays, _displays]; + + if !(uiNamespace getVariable [INIT_GAME_VAR, false]) then + { + //--- tell loading screen it can stop using ARMA 3 logo which is shown only before main menu + //--- and start using the classic terrain picture + uiNamespace setVariable [INIT_GAME_VAR, _path == "GUI" && {ctrlIdd _x >= 0} count _displays > 1]; + }; + + [missionNamespace, "OnDisplayRegistered", [_display, _class]] call BIS_fnc_callScriptedEventHandler; + }; + + if (_mode == "onUnload") exitWith + { + //--- Unregister current display + _displays = _displays - [_display]; + uiNamespace setVariable [_varDisplays, _displays]; + + [missionNamespace, "OnDisplayUnregistered", [_display, _class]] call BIS_fnc_callScriptedEventHandler; + }; + + }; + + //--- Call script in public version + if (!cheatsEnabled) exitWith + { + [_mode, _params, _class] call (uiNamespace getVariable (_class + "_script")); + nil + }; + + //--- Recompile in the internal version + uinamespace setvariable + [ + _class + "_script", + compileScript [ + format ["%1%2.sqf", getText (configFile >> "CfgScriptPaths" >> _path), _class], + true, // final + format ["scriptName '%1'; _fnc_scriptName = '%1'; ", _class] // prefix + ] + ]; + + //--- Call script in internal version + if !(uiNamespace getVariable ["BIS_disableUIscripts", false]) then + { + [_mode, _params, _class] call (uiNamespace getVariable (_class + "_script")); + nil + }; +}; \ No newline at end of file diff --git a/include/a3/functions_f/misc/fn_endLoadingScreen.sqf b/include/a3/functions_f/misc/fn_endLoadingScreen.sqf new file mode 100644 index 0000000000..52c88dd1c2 --- /dev/null +++ b/include/a3/functions_f/misc/fn_endLoadingScreen.sqf @@ -0,0 +1,33 @@ +/* + Author: Karel Moricky + + Description: + Unregister a loading screen. When none other remains, end the loading. + + Parameter(s): + 0: STRING - screen ID, used in BIS_fnc_endLoadingScreen + + Returns: + BOOL - true when unregistered +*/ + +with uinamespace do { + private ["_id","_ids"]; + + _id = _this param [0,"",[""]]; + _ids = missionnamespace getvariable ["BIS_fnc_startLoadingScreen_ids",[]]; + + if (_id in _ids) then { + _ids = _ids - [_id]; + missionnamespace setvariable ["BIS_fnc_startLoadingScreen_ids",_ids]; + if (count _ids == 0) then { + endloadingscreen; + -1 call bis_fnc_progressloadingscreen; + }; + //["End '%1' loading screen for %2",_id,profilename] call bis_fnc_logFormat; + true + } else { + ["Loading screen '%1' did not start yet.",_id] call bis_fnc_error; + false + }; +}; \ No newline at end of file diff --git a/include/a3/functions_f/misc/fn_startLoadingScreen.sqf b/include/a3/functions_f/misc/fn_startLoadingScreen.sqf new file mode 100644 index 0000000000..a8fe080670 --- /dev/null +++ b/include/a3/functions_f/misc/fn_startLoadingScreen.sqf @@ -0,0 +1,34 @@ +/* + Author: Karel Moricky + + Description: + Register a loading screen. Start the loading when it's the first one registered. + + Parameter(s): + 0: STRING - screen ID, will be used in BIS_fnc_endLoadingScreen + 1 (Optional): STRING - loading screen layout + + Returns: + BOOL - true when registered +*/ +disableserialization; +with uinamespace do { + private ["_id","_rsc","_ids"]; + _id = _this param [0,"",[""]]; + _text = _this param [1,"",[""]]; + _rsc = _this param [2,"",[""]]; + _ids = missionnamespace getvariable ["BIS_fnc_startLoadingScreen_ids",[]]; + + if !(_id in _ids) then { + //--- Array has to be adjusted before loading screen starts, otherwise the rest of the script can be delayed + _ids set [count _ids,_id]; + missionnamespace setvariable ["BIS_fnc_startLoadingScreen_ids",_ids]; + startloadingscreen [_text,_rsc]; + progressloadingscreen (uinamespace getvariable ["BIS_fnc_progressloadingscreen_progress",0]); + //["Start '%1' loading screen for %2",_id,profilename] call bis_fnc_logFormat; + true + } else { + //["Loading screen '%1' already started.",_id] call bis_fnc_error; + false + }; +}; From e964c35ada8be318603b6789e1e31ca873fd97d9 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 16 May 2023 16:43:46 +0200 Subject: [PATCH 10/21] Reenable ASC --- .hemtt/project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.hemtt/project.toml b/.hemtt/project.toml index 238b9d4ca6..5aa1460c01 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -16,7 +16,7 @@ include = [ git_hash = 0 [asc] -enabled = false +enabled = true exclude = [ "/initsettings.sqf", "/initkeybinds.sqf", From 57622af9a50597c01ad940b2a17666c17038729c Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 16 May 2023 16:46:31 +0200 Subject: [PATCH 11/21] Fix LOG macros --- addons/common/fnc_switchPlayer.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/common/fnc_switchPlayer.sqf b/addons/common/fnc_switchPlayer.sqf index a99336c983..c9c857ffa5 100644 --- a/addons/common/fnc_switchPlayer.sqf +++ b/addons/common/fnc_switchPlayer.sqf @@ -43,13 +43,13 @@ _dummyUnit = (_ar select 4) createUnit [_type, [0, 0, 0], [], 0, "NONE"]; // Joi if (isNull _dummyUnit) exitWith { hint "Sorry, something went wrong, dummyUnit is null" }; [_oldUnit] join _dummyGroup; -// LOG(format["1.Dummy created, State saved and put oldUnit in new group: %1", _dummyGroup]); +LOG_1("1.Dummy created, State saved and put oldUnit in new group: %1",_dummyGroup); private _newUnit = _dummyGroup createUnit [_type, _ar select 5, [], 0, "NONE"]; if (isNull _newUnit) exitWith { hint "Sorry, something went wrong, newUnit is null" }; -// LOG(format["2.New unit created, local: %1", local _newUnit]); +LOG_1("2.New unit created, local: %1",local _newUnit); sleep 1; addSwitchableUnit _newUnit; @@ -58,7 +58,7 @@ selectPlayer _newUnit; _newUnit setRank (_ar select 2); _newUnit addScore (_ar select 3); -// LOG(format["3.State transfered, switched player control to new unit, local: %1", local _newUnit]); +LOG_1("3.State transfered, switched player control to new unit, local: %1",local _newUnit); sleep 1; if (_ar select 7 != "") then { From d2a10fb3c74150b6a390b2535c026a6d4d59fc01 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 16 May 2023 16:50:58 +0200 Subject: [PATCH 12/21] JR - Remove private/protected/public/Read defines --- addons/jr/config.cpp | 9 --------- addons/jr/jr_classes.hpp | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/addons/jr/config.cpp b/addons/jr/config.cpp index b569af19ae..8264595a9c 100644 --- a/addons/jr/config.cpp +++ b/addons/jr/config.cpp @@ -1,14 +1,5 @@ #include "script_component.hpp" -#define private 0 -#define protected 1 -#define public 2 - -#define ReadAndWrite 0 -#define ReadAndCreate 1 -#define ReadOnly 2 -#define ReadOnlyVerified 3 - class CfgPatches { class ADDON { name = CSTRING(component); diff --git a/addons/jr/jr_classes.hpp b/addons/jr/jr_classes.hpp index a1f503b551..484cb36f49 100644 --- a/addons/jr/jr_classes.hpp +++ b/addons/jr/jr_classes.hpp @@ -1,7 +1,7 @@ //ASDG prefixed original classes preserved to ensure compatibility class asdg_SlotInfo { // Base class - scope = private; + scope = 0; linkProxy = "defaultProxy"; iconPosition[] = {0.0, 0.0}; iconScale = 0.0; From 6736af62525c9a2ccb2c0e7d4b95a0c8d9621a95 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 16 May 2023 17:07:55 +0200 Subject: [PATCH 13/21] Adapt flexiMenu to HEMTT v1 --- addons/ui/config.cpp | 10 +- addons/ui/flexiMenu/data/menu_arma2.hpp | 124 +++++++++---------- addons/ui/flexiMenu/data/menu_buttonList.hpp | 54 ++++---- addons/ui/flexiMenu/data/menu_iconRow.hpp | 54 ++++---- addons/ui/flexiMenu/data/menu_popup.hpp | 46 +++---- addons/ui/flexiMenu/data/menu_rose.hpp | 68 +++++----- 6 files changed, 178 insertions(+), 178 deletions(-) diff --git a/addons/ui/config.cpp b/addons/ui/config.cpp index bc692fcd4e..b36fbcb9e8 100644 --- a/addons/ui/config.cpp +++ b/addons/ui/config.cpp @@ -70,8 +70,8 @@ class _flexiMenu_RscShortcutButton: RscShortcutButton { }; }; //----------------------------------------------------------------------------- -// #include "flexiMenu\data\menu_rose.hpp" -// #include "flexiMenu\data\menu_arma2.hpp" -// #include "flexiMenu\data\menu_buttonList.hpp" -// #include "flexiMenu\data\menu_iconRow.hpp" -// #include "flexiMenu\data\menu_popup.hpp" +#include "flexiMenu\data\menu_rose.hpp" +#include "flexiMenu\data\menu_arma2.hpp" +#include "flexiMenu\data\menu_buttonList.hpp" +#include "flexiMenu\data\menu_iconRow.hpp" +#include "flexiMenu\data\menu_popup.hpp" diff --git a/addons/ui/flexiMenu/data/menu_arma2.hpp b/addons/ui/flexiMenu/data/menu_arma2.hpp index ade44fbde9..006b9bc295 100644 --- a/addons/ui/flexiMenu/data/menu_arma2.hpp +++ b/addons/ui/flexiMenu/data/menu_arma2.hpp @@ -13,7 +13,7 @@ #define _LBH_overlap 0.0375 * safeZoneH // button height with 1 pixel overlap for type "popup" menu #define _listButtonsPerRow 10 //#define _captionColorBG 58 / 256, 80 / 256, 55 / 256 // BIS mid green (button over colour) -#define _captionColorFG 138 / 256, 146 / 256, 105 / 256 // BIS greenish text +#define _captionColorFG "138 / 256", "146 / 256", "105 / 256" // BIS greenish text #define _captionHgt 0.85 #define _gapW 0.01 * safeZoneW // Horizontal gap "width" between circle button and side buttons #define _gapH ((_CH / 2 - 2 * _BH) * 2 / 3) // Button "height" vertical spacing @@ -38,8 +38,8 @@ class CBA_flexiMenu_rscArma2 { class objects {}; // custom flexiMenu properties - flexiMenu_primaryMenuControlWidth = _BW; - flexiMenu_subMenuControlWidth = _SMW; + flexiMenu_primaryMenuControlWidth = QUOTE(_BW); + flexiMenu_subMenuControlWidth = QUOTE(_SMW); flexiMenu_subMenuCaptionWidth = 0.40; //#include "common_listClass.hpp" @@ -50,9 +50,9 @@ class CBA_flexiMenu_rscArma2 { y = 0.5; w = 0; //_SMW; // hide initially //w = _SMW; - h = _LBH_overlap; - sizeEx = _LBH; - size = _LBH * 0.75; + h = QUOTE(_LBH_overlap); + sizeEx = QUOTE(_LBH); + size = QUOTE(_LBH * 0.75); color[] = {_captionColorFG, 1}; color2[] = {1, 1, 1, 0.8}; // {1, 1, 1, 0.4}; @@ -81,10 +81,10 @@ class CBA_flexiMenu_rscArma2 { }; class button: _flexiMenu_RscShortcutButton { - w = 0; //_BW; // hide initially - h = _BH * 1.52; // paa's only use 66% of hgt - sizeEx = _BH; - size = _BH * 0.85; + w = 0; //QUOTE(_BW); // hide initially + h = QUOTE(_BH * 1.52); // paa's only use 66% of hgt + sizeEx = QUOTE(_BH); + size = QUOTE(_BH * 0.85); color[] = {_captionColorFG, 1}; color2[] = {1, 1, 1, 0.8}; // {1, 1, 1, 0.4}; @@ -110,28 +110,28 @@ class CBA_flexiMenu_rscArma2 { class controls { class caption: rscText { idc = _flexiMenu_IDC_menuDesc; - //x = _SX - _BW; - x = _leftButtonLevel1X; - //y = _SY - _buttonsBeforeCenter * _BH - _gapH - _BH * _captionHgt; - y = _SY - (_CH / 2 + _gapH) - _BH - _gapH - _BH * _captionHgt; - w = 0.50 * safeZoneW; - h = _BH * _captionHgt; - sizeEx = _BH * _captionHgt; + //x = QUOTE(_SX - _BW); + x = QUOTE(_leftButtonLevel1X); + //y = QUOTE(_SY - _buttonsBeforeCenter * _BH - _gapH - _BH * _captionHgt); + y = QUOTE(_SY - (_CH / 2 + _gapH) - _BH - _gapH - _BH * _captionHgt); + w = QUOTE(0.50 * safeZoneW); + h = QUOTE(_BH * _captionHgt); + sizeEx = QUOTE(_BH * _captionHgt); colorText[] = {_captionColorFG, 1}; text = ""; }; class button01: button { - idc = _flexiMenu_baseIDC_button + 0; - x = _SX - _CW / 2 + _CX_correction; - y = _SY - _CH / 2; - w = _CW; - h = _CH; - sizeEx = _CH; - //size = _BH * 0.8; + idc = QUOTE(_flexiMenu_baseIDC_button + 0); + x = QUOTE(_SX - _CW / 2 + _CX_correction); + y = QUOTE(_SY - _CH / 2); + w = QUOTE(_CW); + h = QUOTE(_CH); + sizeEx = QUOTE(_CH); + //size = QUOTE(_BH * 0.8); class TextPos { - left = -_CX_correction * 2; // not sure if logic is correct, but seems close enough - top = _CH / 2 - _BH / 2; + left = QUOTE(-_CX_correction * 2); // not sure if logic is correct, but seems close enough + top = QUOTE(_CH / 2 - _BH / 2); right = 0; //0.002; bottom = 0.0; }; @@ -152,9 +152,9 @@ class CBA_flexiMenu_rscArma2 { animTextureNoShortcut = _imagePath(mid_button_normal); // used? }; class button02: button { - idc = _flexiMenu_baseIDC_button + 1; - x = _SX - _BW / 2; - y = _SY - (_CH / 2 + _gapH) - _BH; + idc = QUOTE(_flexiMenu_baseIDC_button + 1); + x = QUOTE(_SX - _BW / 2); + y = QUOTE(_SY - (_CH / 2 + _gapH) - _BH); animTextureNormal = _imagePathUI(normal_ca); animTextureDisabled = _imagePathUI(disabled_ca); animTextureOver = _imagePathUI(over_ca); @@ -164,57 +164,57 @@ class CBA_flexiMenu_rscArma2 { animTextureNoShortcut = _imagePathUI(normal_ca); }; class button03: button02 { - idc = _flexiMenu_baseIDC_button + 2; - x = _SX - _BW / 2; - y = _SY + (_CH / 2 + _gapH); + idc = QUOTE(_flexiMenu_baseIDC_button + 2); + x = QUOTE(_SX - _BW / 2); + y = QUOTE(_SY + (_CH / 2 + _gapH)); }; //--------------------------------- class button04: button02 { - idc = _flexiMenu_baseIDC_button + 3; - x = _leftButtonLevel1X; - y = _SY - _gapH / 2 - _BH - _gapH - _BH; + idc = QUOTE(_flexiMenu_baseIDC_button + 3); + x = QUOTE(_leftButtonLevel1X); + y = QUOTE(_SY - _gapH / 2 - _BH - _gapH - _BH); }; class button05: button02 { - idc = _flexiMenu_baseIDC_button + 4; - x = _leftButtonLevel2X; - y = _SY - _gapH / 2 - _BH; + idc = QUOTE(_flexiMenu_baseIDC_button + 4); + x = QUOTE(_leftButtonLevel2X); + y = QUOTE(_SY - _gapH / 2 - _BH); }; class button06: button02 { - idc = _flexiMenu_baseIDC_button + 5; - x = _leftButtonLevel2X; - y = _SY + _gapH / 2; + idc = QUOTE(_flexiMenu_baseIDC_button + 5); + x = QUOTE(_leftButtonLevel2X); + y = QUOTE(_SY + _gapH / 2); }; class button07: button02 { - idc = _flexiMenu_baseIDC_button + 6; - x = _leftButtonLevel1X; - y = _SY + _gapH / 2 + _BH + _gapH; + idc = QUOTE(_flexiMenu_baseIDC_button + 6); + x = QUOTE(_leftButtonLevel1X); + y = QUOTE(_SY + _gapH / 2 + _BH + _gapH); }; //--------------------------------- class button08: button02 { - idc = _flexiMenu_baseIDC_button + 7; - x = _rightButtonLevel1X; - y = _SY - _gapH / 2 - _BH - _gapH - _BH; + idc = QUOTE(_flexiMenu_baseIDC_button + 7); + x = QUOTE(_rightButtonLevel1X); + y = QUOTE(_SY - _gapH / 2 - _BH - _gapH - _BH); }; class button09: button02 { - idc = _flexiMenu_baseIDC_button + 8; - x = _rightButtonLevel2X; - y = _SY - _gapH / 2 - _BH; + idc = QUOTE(_flexiMenu_baseIDC_button + 8); + x = QUOTE(_rightButtonLevel2X); + y = QUOTE(_SY - _gapH / 2 - _BH); }; class button10: button02 { - idc = _flexiMenu_baseIDC_button + 9; - x = _rightButtonLevel2X; - y = _SY + _gapH / 2; + idc = QUOTE(_flexiMenu_baseIDC_button + 9); + x = QUOTE(_rightButtonLevel2X); + y = QUOTE(_SY + _gapH / 2); }; class button11: button02 { - idc = _flexiMenu_baseIDC_button + 10; - x = _rightButtonLevel1X; - y = _SY + _gapH / 2 + _BH + _gapH; + idc = QUOTE(_flexiMenu_baseIDC_button + 10); + x = QUOTE(_rightButtonLevel1X); + y = QUOTE(_SY + _gapH / 2 + _BH + _gapH); }; //----------------------- class caption2: caption { - idc = _flexiMenu_IDC_listMenuDesc; - x = _SX-(_SMW/2); - y = _SY + (_CH/2 + _gapH) + _BH + _gapH + 0*_LBH; + idc = QUOTE(_flexiMenu_IDC_listMenuDesc); + x = QUOTE(_SX-(_SMW/2)); + y = QUOTE(_SY + (_CH/2 + _gapH) + _BH + _gapH + 0*_LBH); w = 0; // flexiMenu_subMenuCaptionWidth; // hide initially }; @@ -222,9 +222,9 @@ class CBA_flexiMenu_rscArma2 { // Note: x pos will be 3 columns, with first column centred, 2nd on right, 3rd on left. #define ExpandMacro_ListControls(ID)\ class listButton##ID: listButton {\ - idc = _flexiMenu_baseIDC_listButton+ID;\ - x = _SX - ((_SMW+_gapW) * 1.5) + floor (((##ID + _listButtonsPerRow) / _listButtonsPerRow) mod 3) * (_SMW + _gapW);\ - y = _SY + (_CH / 2 + _gapH) + _BH + _gapH + (1 + (##ID mod _listButtonsPerRow)) * _LBH;\ + idc = QUOTE(_flexiMenu_baseIDC_listButton+ID);\ + x = QUOTE(_SX - ((_SMW+_gapW) * 1.5) + floor (((##ID + _listButtonsPerRow) / _listButtonsPerRow) mod 3) * (_SMW + _gapW));\ + y = QUOTE(_SY + (_CH / 2 + _gapH) + _BH + _gapH + (1 + (##ID mod _listButtonsPerRow)) * _LBH);\ } ExpandMacro_ListControls(00); diff --git a/addons/ui/flexiMenu/data/menu_buttonList.hpp b/addons/ui/flexiMenu/data/menu_buttonList.hpp index 51a649aed6..89520bfbfa 100644 --- a/addons/ui/flexiMenu/data/menu_buttonList.hpp +++ b/addons/ui/flexiMenu/data/menu_buttonList.hpp @@ -9,8 +9,8 @@ #define _LBH 0.033 * safeZoneH // list button height #define _gapH 0.01 * safeZoneH #define _buttonsBeforeCenter 7 // buttons above screen centre, allowing menu to appear centred. -#define _captionColorBG 58 / 256, 80 / 256, 55 / 256 // BIS mid green (button over colour) -#define _captionColorFG 138 / 256, 146 / 256, 105 / 256 // BIS greenish text +#define _captionColorBG "58 / 256", "80 / 256", "55 / 256" // BIS mid green (button over colour) +#define _captionColorFG "138 / 256", "146 / 256", "105 / 256" // BIS greenish text #define _captionHgt 0.75 class CBA_flexiMenu_rscButtonList { //: _flexiMenu_rscRose @@ -22,8 +22,8 @@ class CBA_flexiMenu_rscButtonList { //: _flexiMenu_rscRose class objects {}; // custom flexiMenu properties - flexiMenu_primaryMenuControlWidth = _BW; - flexiMenu_subMenuControlWidth = _SMW; + flexiMenu_primaryMenuControlWidth = QUOTE(_BW); + flexiMenu_subMenuControlWidth = QUOTE(_SMW); flexiMenu_subMenuCaptionWidth = 0.40; //#include "common_listClass.hpp" @@ -32,11 +32,11 @@ class CBA_flexiMenu_rscButtonList { //: _flexiMenu_rscRose class listButton: _flexiMenu_RscShortcutButton { x = 0.5; y = 0.5; - w = 0; //_SMW; // hide initially - //w = _SMW; - h = _LBH; - sizeEx = _LBH; - size = _LBH * 0.75; + w = 0; //QUOTE(_SMW); // hide initially + //w = QUOTE(_SMW); + h = QUOTE(_LBH); + sizeEx = QUOTE(_LBH); + size = QUOTE(_LBH * 0.75); color[] = {_captionColorFG, 1}; color2[] = {1, 1, 1, 0.8}; // {1, 1, 1, 0.4}; @@ -65,12 +65,12 @@ class CBA_flexiMenu_rscButtonList { //: _flexiMenu_rscRose }; class button: _flexiMenu_RscShortcutButton { - x = _SX-_BW; - y = _SY; - w = 0; //_BW; // hide initially - h = _BH; - sizeEx = _BH; - size = _BH * 0.75; + x = QUOTE(_SX-_BW); + y = QUOTE(_SY); + w = 0; //QUOTE(_BW); // hide initially + h = QUOTE(_BH); + sizeEx = QUOTE(_BH); + size = QUOTE(_BH * 0.75); color[] = {_captionColorFG, 1}; color2[] = {1, 1, 1, 0.8}; // {1, 1, 1, 0.4}; @@ -102,19 +102,19 @@ class CBA_flexiMenu_rscButtonList { //: _flexiMenu_rscRose class controls { class caption: rscText { idc = _flexiMenu_IDC_menuDesc; - x = _SX - _BW; - y = _SY - _buttonsBeforeCenter * _BH - _gapH - _BH * _captionHgt; - w = 0.50 * safeZoneW; - h = _BH * _captionHgt; - sizeEx = _BH * _captionHgt; + x = QUOTE(_SX - _BW); + y = QUOTE(_SY - _buttonsBeforeCenter * _BH - _gapH - _BH * _captionHgt); + w = QUOTE(0.50 * safeZoneW); + h = QUOTE(_BH * _captionHgt); + sizeEx = QUOTE(_BH * _captionHgt); colorText[] = {_captionColorFG, 1}; text = ""; }; #define ExpandMacro_RowControls(ID) \ class button##ID: button {\ - idc = _flexiMenu_baseIDC_button + ID;\ - y = _SY-_buttonsBeforeCenter * _BH + ID * _BH;\ + idc = QUOTE(_flexiMenu_baseIDC_button + ID);\ + y = QUOTE(_SY-_buttonsBeforeCenter * _BH + ID * _BH);\ } ExpandMacro_RowControls(00); @@ -138,17 +138,17 @@ class CBA_flexiMenu_rscButtonList { //: _flexiMenu_rscRose //----------------------- class caption2: caption { idc = _flexiMenu_IDC_listMenuDesc; - x = _SX; - y = _SY-_buttonsBeforeCenter * _BH + (-1 * _LBH); + x = QUOTE(_SX); + y = QUOTE(_SY-_buttonsBeforeCenter * _BH + (-1 * _LBH)); w = 0; // flexiMenu_subMenuCaptionWidth; // hide initially }; //#include "common_listControls.hpp" #define ExpandMacro_ListControls(ID)\ class listButton##ID: listButton {\ - idc = _flexiMenu_baseIDC_listButton + ID;\ - x = _SX;\ - y = _SY - _buttonsBeforeCenter * _BH + ID * _LBH;\ + idc = QUOTE(_flexiMenu_baseIDC_listButton + ID);\ + x = QUOTE(_SX);\ + y = QUOTE(_SY - _buttonsBeforeCenter * _BH + ID * _LBH);\ } ExpandMacro_ListControls(00); diff --git a/addons/ui/flexiMenu/data/menu_iconRow.hpp b/addons/ui/flexiMenu/data/menu_iconRow.hpp index 7e4518d920..3f41d8425c 100644 --- a/addons/ui/flexiMenu/data/menu_iconRow.hpp +++ b/addons/ui/flexiMenu/data/menu_iconRow.hpp @@ -13,8 +13,8 @@ #define _gapH 0.01 * safeZoneH #define _buttonsBeforeCenter 6 // buttons before screen centre, allowing menu to appear centred. #define _buttonsPerRow 5 -#define _captionColorBG 58 / 256, 80 / 256, 55 / 256 // BIS mid green (button over colour) -#define _captionColorFG 138 / 256, 146 / 256, 105 / 256 // BIS greenish text +#define _captionColorBG "58 / 256", "80 / 256", "55 / 256" // BIS mid green (button over colour) +#define _captionColorFG "138 / 256", "146 / 256", "105 / 256" // BIS greenish text #define _captionHgt 0.75 class CBA_flexiMenu_rscIconRow { //: _flexiMenu_rscRose @@ -26,8 +26,8 @@ class CBA_flexiMenu_rscIconRow { //: _flexiMenu_rscRose class objects {}; // custom flexiMenu properties - flexiMenu_primaryMenuControlWidth = _BW; - flexiMenu_subMenuControlWidth = _SMW; + flexiMenu_primaryMenuControlWidth = QUOTE(_BW); + flexiMenu_subMenuControlWidth = QUOTE(_SMW); flexiMenu_subMenuCaptionWidth = 0.40; //#include "common_listClass.hpp" @@ -36,10 +36,10 @@ class CBA_flexiMenu_rscIconRow { //: _flexiMenu_rscRose class listButton: _flexiMenu_RscShortcutButton { x = 0.5; y = 0.5; - w = 0; //_SMW; // hide initially - h = _LBH; - sizeEx = _LBH; - size = _LBH * 0.75; + w = 0; //QUOTE(_SMW); // hide initially + h = QUOTE(_LBH); + sizeEx = QUOTE(_LBH); + size = QUOTE(_LBH * 0.75); color[] = {_captionColorFG, 1}; color2[] = {1, 1, 1, 0.8}; // {1, 1, 1, 0.4}; @@ -68,12 +68,12 @@ class CBA_flexiMenu_rscIconRow { //: _flexiMenu_rscRose }; class button: _flexiMenu_RscShortcutButton { - x = _SX - _BW; - y = _SY; - w = 0; //_BW; // hide initially - h = _BH2; - sizeEx = _BH; - size = _BH; // * 0.85; + x = QUOTE(_SX - _BW); + y = QUOTE(_SY); + w = 0; //QUOTE(_BW); // hide initially + h = QUOTE(_BH2); + sizeEx = QUOTE(_BH); + size = QUOTE(_BH); // * 0.85; color[] = {_captionColorFG, 1}; color2[] = {1, 1, 1, 0.8}; // {1, 1, 1, 0.4}; @@ -105,20 +105,20 @@ class CBA_flexiMenu_rscIconRow { //: _flexiMenu_rscRose class controls { class caption: rscText { idc = _flexiMenu_IDC_menuDesc; - x = _SX - _buttonsBeforeCenter * _BW; - y = _SY - _gapH-_StandardBH * _captionHgt; - w = 0.50 * safeZoneW; - h = _StandardBH * _captionHgt; - sizeEx = _StandardBH * _captionHgt; + x = QUOTE(_SX - _buttonsBeforeCenter * _BW); + y = QUOTE(_SY - _gapH-_StandardBH * _captionHgt); + w = QUOTE(0.50 * safeZoneW); + h = QUOTE(_StandardBH * _captionHgt); + sizeEx = QUOTE(_StandardBH * _captionHgt); colorText[] = {_captionColorFG, 1}; text = ""; }; #define ExpandMacro_RowControls(ID)\ class button##ID: button {\ - idc = _flexiMenu_baseIDC_button + ID;\ - x = _SX-_buttonsBeforeCenter * _BW + (##ID mod _buttonsPerRow) * _BW;\ - y = _SY + floor (##ID / _buttonsPerRow) * (_gapH + _BH2);\ + idc = QUOTE(_flexiMenu_baseIDC_button + ID);\ + x = QUOTE(_SX-_buttonsBeforeCenter * _BW + (##ID mod _buttonsPerRow) * _BW);\ + y = QUOTE(_SY + floor (##ID / _buttonsPerRow) * (_gapH + _BH2));\ } ExpandMacro_RowControls(00); @@ -144,17 +144,17 @@ class CBA_flexiMenu_rscIconRow { //: _flexiMenu_rscRose //----------------------- class caption2: caption { idc = _flexiMenu_IDC_listMenuDesc; - x = _SX - _buttonsBeforeCenter * _BW + (_buttonsPerRow + 1) * _BW; - y = _SY; + x = QUOTE(_SX - _buttonsBeforeCenter * _BW + (_buttonsPerRow + 1) * _BW); + y = QUOTE(_SY); w = 0; //flexiMenu_subMenuCaptionWidth; // hide initially }; //#include "common_listControls.hpp" #define ExpandMacro_ListControls(ID)\ class listButton##ID: listButton {\ - idc = _flexiMenu_baseIDC_listButton + ID;\ - x = _SX - _buttonsBeforeCenter * _BW + (_buttonsPerRow + 1) * _BW;\ - y = _SY + ##ID * _LBH;\ + idc = QUOTE(_flexiMenu_baseIDC_listButton + ID);\ + x = QUOTE(_SX - _buttonsBeforeCenter * _BW + (_buttonsPerRow + 1) * _BW);\ + y = QUOTE(_SY + ##ID * _LBH);\ } ExpandMacro_ListControls(00); diff --git a/addons/ui/flexiMenu/data/menu_popup.hpp b/addons/ui/flexiMenu/data/menu_popup.hpp index 64a94aa2bd..ef296deadf 100644 --- a/addons/ui/flexiMenu/data/menu_popup.hpp +++ b/addons/ui/flexiMenu/data/menu_popup.hpp @@ -8,8 +8,8 @@ #define _BH_overlap 0.0375 * safeZoneH //button height with 1 pixel overlap for type "popup" menu #define _gapH 0.01 * safeZoneH #define _buttonsBeforeCenter 7 //buttons above screen centre, allowing menu to appear centred. -#define _captionColorBG 58 / 256, 80 / 256, 55 / 256 //BIS mid green (button over colour) -#define _captionColorFG 138 / 256, 146 / 256, 105 / 256 //BIS greenish text +#define _captionColorBG "58 / 256", "80 / 256", "55 / 256" //BIS mid green (button over colour) +#define _captionColorFG "138 / 256", "146 / 256", "105 / 256" //BIS greenish text #define _captionHgt 1 // 0.75 class CBA_flexiMenu_rscPopup { // : _flexiMenu_rscRose @@ -20,19 +20,19 @@ class CBA_flexiMenu_rscPopup { // : _flexiMenu_rscRose class controlsBackground {}; class objects {}; - flexiMenu_primaryMenuControlWidth = _BW; - flexiMenu_subMenuControlWidth = _BW; - flexiMenu_subMenuCaptionWidth = _BW; + flexiMenu_primaryMenuControlWidth = QUOTE(_BW); + flexiMenu_subMenuControlWidth = QUOTE(_BW); + flexiMenu_subMenuCaptionWidth = QUOTE(_BW); // #include "common_listClass.hpp" class listButton: _flexiMenu_RscShortcutButton { - x = _SX - _BW; - y = safeZoneY + 0.30 * safeZoneH; - w = 0; // _BW; // hide initially - h = _BH_overlap; - sizeEx = _BH; - size = _BH * 0.75; + x = QUOTE(_SX - _BW); + y = QUOTE(safeZoneY + 0.30 * safeZoneH); + w = 0; // QUOTE(_BW); // hide initially + h = QUOTE(_BH_overlap); + sizeEx = QUOTE(_BH); + size = QUOTE(_BH * 0.75); color[] = {_captionColorFG, 1}; color2[] = {1, 1, 1, 0.8}; // {1, 1, 1, 0.4}; @@ -63,11 +63,11 @@ class CBA_flexiMenu_rscPopup { // : _flexiMenu_rscRose class controls { class caption: rscText { idc = _flexiMenu_IDC_menuDesc; - x = _SX - _BW; - y = safeZoneY + 0.30 * safeZoneH-_BH * _captionHgt; - w = _BW; - h = _BH * _captionHgt; - sizeEx = _BH * _captionHgt; + x = QUOTE(_SX - _BW); + y = QUOTE(safeZoneY + 0.30 * safeZoneH-_BH * _captionHgt); + w = QUOTE(_BW); + h = QUOTE(_BH * _captionHgt); + sizeEx = QUOTE(_BH * _captionHgt); colorText[] = {_captionColorFG, 1}; colorBackground[] = {_captionColorBG, 1}; text = ""; @@ -75,8 +75,8 @@ class CBA_flexiMenu_rscPopup { // : _flexiMenu_rscRose #define ExpandMacro_RowControls(ID) \ class button##ID: listButton {\ - idc = _flexiMenu_baseIDC_button + ID;\ - y = safeZoneY + 0.30 * safeZoneH + ##ID * _BH;\ + idc = QUOTE(_flexiMenu_baseIDC_button + ID);\ + y = QUOTE(safeZoneY + 0.30 * safeZoneH + ##ID * _BH);\ } ExpandMacro_RowControls(00); @@ -102,17 +102,17 @@ class CBA_flexiMenu_rscPopup { // : _flexiMenu_rscRose // ----------------------- class caption2: caption { idc = _flexiMenu_IDC_listMenuDesc; - x = _SX; - y = safeZoneY + 0.30 * safeZoneH + _BH - _BH * _captionHgt; + x = QUOTE(_SX); + y = QUOTE(safeZoneY + 0.30 * safeZoneH + _BH - _BH * _captionHgt); w = 0; // flexiMenu_subMenuCaptionWidth; //hide initially }; // #include "common_listControls.hpp" #define ExpandMacro_ListControls(ID)\ class listButton##ID: listButton {\ - idc = _flexiMenu_baseIDC_listButton + ID;\ - x = _SX;\ - y = safeZoneY + 0.30 * safeZoneH + _BH + ##ID * _BH;\ + idc = QUOTE(_flexiMenu_baseIDC_listButton + ID);\ + x = QUOTE(_SX);\ + y = QUOTE(safeZoneY + 0.30 * safeZoneH + _BH + ##ID * _BH);\ } ExpandMacro_ListControls(00); diff --git a/addons/ui/flexiMenu/data/menu_rose.hpp b/addons/ui/flexiMenu/data/menu_rose.hpp index d94c9b820d..cba610256d 100644 --- a/addons/ui/flexiMenu/data/menu_rose.hpp +++ b/addons/ui/flexiMenu/data/menu_rose.hpp @@ -14,7 +14,7 @@ #define _LBH_overlap 0.0375 * safeZoneH //button height with 1 pixel overlap for type "popup" menu #define _listButtonsPerRow 10 //#define _captionColorBG 58 / 256, 80 / 256, 55 / 256 //BIS mid green (button over colour) -#define _captionColorFG 138 / 256, 146 / 256, 105 / 256 //BIS greenish text +#define _captionColorFG "138 / 256", "146 / 256", "105 / 256" //BIS greenish text #define _captionHgt 0.85 #define _gapW 0.01 * safeZoneW //Horizontal gap "width" between circle button and side buttons #define _gapH ((_CH / 2-2 * _BH) * 2 / 3) //Button "height" vertical spacing @@ -39,8 +39,8 @@ class CBA_flexiMenu_rscRose { class objects {}; // custom flexiMenu properties - flexiMenu_primaryMenuControlWidth = _BW; - flexiMenu_subMenuControlWidth = _SMW; + flexiMenu_primaryMenuControlWidth = QUOTE(_BW); + flexiMenu_subMenuControlWidth = QUOTE(_SMW); flexiMenu_subMenuCaptionWidth = 0.40; flexiMenu_hotKeyColor = "#f07EB27E"; @@ -50,9 +50,9 @@ class CBA_flexiMenu_rscRose { y = 0.5; w = 0; //_SMW; //hide initially // w = _SMW; - h = _LBH_overlap; - sizeEx = _LBH; - size = _LBH * 0.75; + h = QUOTE(_LBH_overlap); + sizeEx = QUOTE(_LBH); + size = QUOTE(_LBH * 0.75); color[] = {_captionColorFG, 1}; color2[] = {1, 1, 1, 0.8}; // {1, 1, 1, 0.4}; @@ -81,10 +81,10 @@ class CBA_flexiMenu_rscRose { }; class button: _flexiMenu_RscShortcutButton { - w = 0; //_BW; //hide initially - h = _BH; - sizeEx = _BH; - size = _BH * 0.85; + w = 0; //QUOTE(_BW); //hide initially + h = QUOTE(_BH); + sizeEx = QUOTE(_BH); + size = QUOTE(_BH * 0.85); color[] = {_captionColorFG, 1}; color2[] = {1, 1, 1, 0.8}; // {1, 1, 1, 0.4}; @@ -104,28 +104,28 @@ class CBA_flexiMenu_rscRose { class controls { class caption: rscText { idc = _flexiMenu_IDC_menuDesc; - //x = _SX - _BW; - x = _leftButtonLevel1X; - //y = _SY - _buttonsBeforeCenter * _BH -_ gapH - _BH * _captionHgt; - y = _SY - (_CH / 2 + _gapH) - _BH - _gapH - _BH * _captionHgt; - w = 0.50 * safeZoneW; - h = _BH * _captionHgt; - sizeEx = _BH * _captionHgt; + //x = QUOTE(_SX - _BW); + x = QUOTE(_leftButtonLevel1X); + //y = QUOTE(_SY - _buttonsBeforeCenter * _BH -_ gapH - _BH * _captionHgt); + y = QUOTE(_SY - (_CH / 2 + _gapH) - _BH - _gapH - _BH * _captionHgt); + w = QUOTE(0.50 * safeZoneW); + h = QUOTE(_BH * _captionHgt); + sizeEx = QUOTE(_BH * _captionHgt); colorText[] = {_captionColorFG, 1}; text = ""; }; class button01: button { - idc = _flexiMenu_baseIDC_button + 0; - x = _SX-_CW / 2 + _CX_correction; - y = _SY-_CH / 2; - w = _CW; - h = _CH; - sizeEx = _CH; - //size = _BH * 0.8; + idc = QUOTE(_flexiMenu_baseIDC_button + 0); + x = QUOTE(_SX-_CW / 2 + _CX_correction); + y = QUOTE(_SY-_CH / 2); + w = QUOTE(_CW); + h = QUOTE(_CH); + sizeEx = QUOTE(_CH); + //size = QUOTE(_BH * 0.8); class TextPos { - left = -_CX_correction * 2; //not sure if logic is correct, but seems close enough //0.008 - top = _CH / 2 - _BH / 2; + left = QUOTE(-_CX_correction * 2); //not sure if logic is correct, but seems close enough //0.008 + top = QUOTE(_CH / 2 - _BH / 2); right = 0; // 0.002; bottom = 0.0; }; @@ -140,9 +140,9 @@ class CBA_flexiMenu_rscRose { #define ExpandMacro_RowControls(ID,newX,newY,imageTag)\ class button##ID: button {\ - idc = _flexiMenu_baseIDC_button + (ID-1);\ - x = ##newX;\ - y = ##newY;\ + idc = QUOTE(_flexiMenu_baseIDC_button + (ID-1));\ + x = QUOTE(newX);\ + y = QUOTE(newY);\ text = "";\ action = "";\ animTextureNormal = _imagePath(DOUBLES(normal,imageTag));\ @@ -167,8 +167,8 @@ class CBA_flexiMenu_rscRose { //----------------------- class caption2: caption { idc = _flexiMenu_IDC_listMenuDesc; - x = _SX - (_SMW / 2); - y = _SY + (_CH / 2 + _gapH) + _BH + _gapH + 0 * _LBH; + x = QUOTE(_SX - (_SMW / 2)); + y = QUOTE(_SY + (_CH / 2 + _gapH) + _BH + _gapH + 0 * _LBH); w = 0; //flexiMenu_subMenuCaptionWidth; //hide initially }; @@ -176,9 +176,9 @@ class CBA_flexiMenu_rscRose { //Note: x pos will be 3 columns, with first column centred, 2nd on right, 3rd on left. #define ExpandMacro_ListControls(ID)\ class listButton##ID: listButton {\ - idc = _flexiMenu_baseIDC_listButton + ID;\ - x = _SX - ((_SMW + _gapW) * 1.5) + floor(((##ID + _listButtonsPerRow) / _listButtonsPerRow) mod 3) * (_SMW + _gapW);\ - y = _SY + (_CH / 2 + _gapH) + _BH + _gapH + (1 + (##ID mod _listButtonsPerRow)) * _LBH;\ + idc = QUOTE(_flexiMenu_baseIDC_listButton + ID);\ + x = QUOTE(_SX - ((_SMW + _gapW) * 1.5) + floor(((##ID + _listButtonsPerRow) / _listButtonsPerRow) mod 3) * (_SMW + _gapW));\ + y = QUOTE(_SY + (_CH / 2 + _gapH) + _BH + _gapH + (1 + (##ID mod _listButtonsPerRow)) * _LBH);\ } ExpandMacro_ListControls(00); From 051812bab22feaa1ad5ce1fdfb50ce797127fdd8 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 20 May 2023 23:30:26 +0200 Subject: [PATCH 14/21] Set build to date in HEMTT hook --- .hemtt/hooks/pre_build/01_set_version.rhai | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.hemtt/hooks/pre_build/01_set_version.rhai b/.hemtt/hooks/pre_build/01_set_version.rhai index 28bc30a643..9954e74ff5 100644 --- a/.hemtt/hooks/pre_build/01_set_version.rhai +++ b/.hemtt/hooks/pre_build/01_set_version.rhai @@ -9,6 +9,7 @@ HEMTT_VFS.join("addons").join("main_a3").join("CfgMods.hpp").create_file().write print("addons/main_a3/CfgMods.hpp version set"); let scriptversion = HEMTT_VFS.join("addons").join("main").join("script_version.hpp").open_file().read(); -scriptversion.replace("000000", HEMTT.project().version().build().to_string()); // TODO date %y%m%d (eg. 220912) +let scriptversion_date = date("[year repr:last_two][month][day]"); +scriptversion.replace("000000", scriptversion_date); HEMTT_VFS.join("addons").join("main").join("script_version.hpp").create_file().write(scriptversion); -print("addons/main/script_version.hpp build set"); +print("addons/main/script_version.hpp build set to " + scriptversion_date); From 88bce47eacedfb1b316a75c520dcb6f924a366de Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 26 Jun 2023 20:11:45 +0200 Subject: [PATCH 15/21] Fix multi-line config quote issues --- addons/common/Cfg3DEN.hpp | 16 ++++++++-------- addons/settings/gui.hpp | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/addons/common/Cfg3DEN.hpp b/addons/common/Cfg3DEN.hpp index 8d0071f993..e82a7b55b3 100644 --- a/addons/common/Cfg3DEN.hpp +++ b/addons/common/Cfg3DEN.hpp @@ -10,13 +10,13 @@ class Cfg3DEN { class Date: Title { class Controls: Controls { class ValueYear: ctrlCombo { - onLoad = "\ - params ['_ctrlYear'];\ + onLoad = QUOTE(\ + params [ARR_1('_ctrlYear')];\ for '_y' from 1900 to 2050 do {\ - _ctrlYear lbSetValue [_ctrlYear lbAdd str _y, _y];\ + _ctrlYear lbSetValue [ARR_2(_ctrlYear lbAdd str _y,_y)];\ };\ _ctrlYear lbSetCurSel 53;\ - "; + ); }; }; }; @@ -27,13 +27,13 @@ class Cfg3DEN { class Init { class Attributes { class Callsign { - expression = "\ + expression = QUOTE(\ if (isNil 'CBA_fnc_setCallsign') then {\ - _this setGroupID [_value];\ + _this setGroupID [ARR_1(_value)];\ } else {\ - [_this, _value] call CBA_fnc_setCallsign;\ + [ARR_2(_this,_value)] call CBA_fnc_setCallsign;\ };\ - "; + ); }; }; }; diff --git a/addons/settings/gui.hpp b/addons/settings/gui.hpp index a017affcf5..7e9e99ad48 100644 --- a/addons/settings/gui.hpp +++ b/addons/settings/gui.hpp @@ -644,7 +644,8 @@ class RscDisplayEmpty; class GVAR(MainMenuHelper): RscDisplayEmpty { onLoad = QUOTE(\ (_this select 0) call FUNC(openSettingsMenu);\ - (_this select 0) closeDisplay 0;); + (_this select 0) closeDisplay 0;\ + ); }; class GVAR(export) { From 5dff99b351ea6e357684bdb697c77c4a94cfad51 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 26 Jun 2023 13:48:13 -0500 Subject: [PATCH 16/21] Keep old hemtt.toml for backward compatibility --- hemtt.toml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 hemtt.toml diff --git a/hemtt.toml b/hemtt.toml new file mode 100644 index 0000000000..2a792dc319 --- /dev/null +++ b/hemtt.toml @@ -0,0 +1,13 @@ +# HEMTT pre v1 +name = "CBA_A3" +prefix = "cba" +author = "CBATeam" +mainprefix = "x" +files = [ + "mod.cpp", + "README.md", + "LICENSE.md", + "logo_cba_ca.paa", + "meta.cpp", + "userconfig" +] From 571e197437ef4d11578cb345887ca25ee384ba9b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 26 Jul 2023 21:02:13 -0500 Subject: [PATCH 17/21] fix semi-colon usage after #include --- addons/diagnostic/XEH_preInit.sqf | 2 +- addons/diagnostic/fnc_isDebugConsoleAllowed.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/diagnostic/XEH_preInit.sqf b/addons/diagnostic/XEH_preInit.sqf index 64ee54f46d..8bd5965d8e 100644 --- a/addons/diagnostic/XEH_preInit.sqf +++ b/addons/diagnostic/XEH_preInit.sqf @@ -6,7 +6,7 @@ LOG(MSG_INIT); ADDON = false; #include "XEH_PREP.sqf" -#include "initSettings.sqf"; +#include "initSettings.sqf" [QGVAR(debug), {_this call CBA_fnc_debug}] call CBA_fnc_addEventHandler; diff --git a/addons/diagnostic/fnc_isDebugConsoleAllowed.sqf b/addons/diagnostic/fnc_isDebugConsoleAllowed.sqf index 01bc31afab..aa00923190 100644 --- a/addons/diagnostic/fnc_isDebugConsoleAllowed.sqf +++ b/addons/diagnostic/fnc_isDebugConsoleAllowed.sqf @@ -5,5 +5,5 @@ if (str missionConfigFile == "A3\Missions_F_Bootcamp\Scenarios\Arsenal.VR\descri if (!isMultiplayer && {getNumber (missionConfigFile >> "enableDebugConsoleSP") == 1}) exitWith {true}; call { - #include "\a3\functions_f\debug\fn_isDebugConsoleAllowed.sqf"; + #include "\a3\functions_f\debug\fn_isDebugConsoleAllowed.sqf" }; From afbf9d879a311d72912c214de73119dc7028506a Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 30 Jul 2023 17:52:47 -0500 Subject: [PATCH 18/21] hemtt 1.8 RC2 math update --- addons/settings/gui.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/settings/gui.hpp b/addons/settings/gui.hpp index 7e9e99ad48..a5c5e30311 100644 --- a/addons/settings/gui.hpp +++ b/addons/settings/gui.hpp @@ -73,7 +73,7 @@ class RscDisplayGameOptions { // Disable multiline text to make in unselectable. onLoad = QUOTE((_this select 0) ctrlSetText localize QUOTE(LSTRING(overwrite_clients)); (_this select 0) ctrlEnable false;); idc = IDC_TXT_OVERWRITE_CLIENT; - style = QUOTE(ST_MULTI + ST_CENTER); + style = ST_MULTI + ST_CENTER; x = QUOTE(POS_W(30)); y = QUOTE(POS_H(2)); w = QUOTE(POS_W(4)); @@ -510,7 +510,7 @@ class GVAR(Row_Time): GVAR(Row_Base) { }; class Hours: RscEdit { idc = IDC_SETTING_TIME_HOURS; - style = QUOTE(ST_CENTER + ST_NO_RECT); + style = ST_CENTER + ST_NO_RECT; tooltip = "$STR_3DEN_Attributes_SliderTime_Hour_tooltip"; font = "EtelkaMonospaceProBold"; x = QUOTE(POS_W(18.25)); @@ -694,7 +694,7 @@ class GVAR(export) { class controls { class Value: RscEdit { idc = IDC_EXPORT_VALUE; - style = QUOTE(ST_MULTI + ST_NO_RECT); + style = ST_MULTI + ST_NO_RECT; colorDisabled[] = {0.95,0.95,0.95,1}; colorBackground[] = {1,1,1,0.2}; x = QUOTE(POS_W(0)); From 7b3bb3f1beac339644471aa1a1682bf38747ccc7 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 17 Aug 2023 16:17:15 -0500 Subject: [PATCH 19/21] Update test_position.sqf --- addons/common/test_position.sqf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/common/test_position.sqf b/addons/common/test_position.sqf index f1fdab49f7..fabe0af65f 100644 --- a/addons/common/test_position.sqf +++ b/addons/common/test_position.sqf @@ -38,7 +38,7 @@ _result = _value call CBA_fnc_getPos; TEST_TRUE(_result isEqualTo EXPECTED,_funcName); //////////////////////////////////////////////////////////////////////////////////////////////////// - +#undef EXPECTED #define EXPECTED [1,2,0] // Pos 3D _value = EXPECTED; @@ -50,7 +50,7 @@ _value set [0,-1]; TEST_TRUE(_result isEqualTo EXPECTED,_funcName); //////////////////////////////////////////////////////////////////////////////////////////////////// - +#undef EXPECTED #define EXPECTED [1,2] // Pos 2D _value = EXPECTED; @@ -62,7 +62,7 @@ _value set [0,-1]; TEST_TRUE(_result isEqualTo EXPECTED,_funcName); //////////////////////////////////////////////////////////////////////////////////////////////////// - +#undef EXPECTED #define EXPECTED [1,1,0] //Pos nearest to [0,0,0] _value = [[0,0,0], [[10,10,0],[1,1,0], [5,5,0]]]; @@ -71,7 +71,7 @@ _result = _value call CBA_fnc_getNearest; TEST_TRUE(_result isEqualTo EXPECTED,_funcName); //////////////////////////////////////////////////////////////////////////////////////////////////// - +#undef EXPECTED #define EXPECTED [[1,1,0], [5,5,0]] //Pos within distance 10 _value = [[0,0,0], [[30,30,0],[1,1,0], [5,5,0]], 10]; From 3e2852b7be99b469ee15e683111e26e947b4a29d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 17 Aug 2023 16:20:23 -0500 Subject: [PATCH 20/21] Create settings.json --- tools/.vscode/settings.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tools/.vscode/settings.json diff --git a/tools/.vscode/settings.json b/tools/.vscode/settings.json new file mode 100644 index 0000000000..57fcac4d62 --- /dev/null +++ b/tools/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.exclude": { + "**/.hemttout": true, + "**/include": true + } +} \ No newline at end of file From f52a33a5835249a9af327583e0a4f881fb6dee8f Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 17 Aug 2023 16:22:19 -0500 Subject: [PATCH 21/21] update includes for 2.12 --- include/a3/ui_f/hpp/defineResincl.inc | 3 +++ tools/updateIncludes.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/a3/ui_f/hpp/defineResincl.inc b/include/a3/ui_f/hpp/defineResincl.inc index 818fd438ce..12b897259a 100644 --- a/include/a3/ui_f/hpp/defineResincl.inc +++ b/include/a3/ui_f/hpp/defineResincl.inc @@ -1448,6 +1448,9 @@ enum #define IDC_OPTIONS_MAPDUCKING_VALUE 119 #define IDC_OPTIONS_MAPDUCKING_SLIDER 120 +#define IDC_OPTIONS_UI_VALUE 121 +#define IDC_OPTIONS_UI_SLIDER 122 + // microphone adjustment #define IDC_OPTIONS_MIC_PROGRESS_BAR 1001 #define IDC_OPTIONS_MIC_PROGRESS 1002 diff --git a/tools/updateIncludes.py b/tools/updateIncludes.py index 721b6b363d..a3fd82ea28 100644 --- a/tools/updateIncludes.py +++ b/tools/updateIncludes.py @@ -3,7 +3,7 @@ import os import shutil -include_base_path = os.path.join(os.path.dirname(os.getcwd()), "include") +include_base_path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "include") p_drive_path = "P:\\" if not os.path.exists(p_drive_path): @@ -19,3 +19,4 @@ if not os.path.isfile(file_v_path): raise Exception("Missing p-drive file {}".format(file_v_path)) shutil.copyfile(file_v_path, file_r_path) + print(f"copying {file_v_path}")