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 bea14c6d6b..4c265bfe61 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,9 @@ release/* releases/* keys/* +.hemttout hemtt hemtt.exe -tools/hemtt*.tar.gz* -tools/hemtt*.zip* -.hemtt/local *.cache *.pbo texHeaders.bin @@ -18,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..9954e74ff5 --- /dev/null +++ b/.hemtt/hooks/pre_build/01_set_version.rhai @@ -0,0 +1,15 @@ +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(); +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 to " + scriptversion_date); diff --git a/.hemtt/project.toml b/.hemtt/project.toml new file mode 100644 index 0000000000..5aa1460c01 --- /dev/null +++ b/.hemtt/project.toml @@ -0,0 +1,36 @@ +name = "CBA_A3" +prefix = "cba" +author = "CBATeam" + +[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", +] + +[hemtt.config] +preset = "Hemtt" + +[hemtt.release] +folder = "CBA_A3" 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/common/fnc_switchPlayer.sqf b/addons/common/fnc_switchPlayer.sqf index 854d1cfbf8..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_1("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_1("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_1("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 { 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]; 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/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 76601b29f8..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" }; 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..8264595a9c 100644 --- a/addons/jr/config.cpp +++ b/addons/jr/config.cpp @@ -1,14 +1,5 @@ #include "script_component.hpp" -#define private 0 // hidden -#define protected 1 // hidden but usable -#define public 2 // visible - -#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 - 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; diff --git a/addons/keybinding/gui.hpp b/addons/keybinding/gui.hpp index 4f071c6fef..1a93e520c4 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(POS_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..a5c5e30311 100644 --- a/addons/settings/gui.hpp +++ b/addons/settings/gui.hpp @@ -11,62 +11,62 @@ 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. @@ -74,16 +74,16 @@ class RscDisplayGameOptions { 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); + 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,34 +478,34 @@ 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 { @@ -513,34 +513,34 @@ class GVAR(Row_Time): GVAR(Row_Base) { style = 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)); }; }; }; @@ -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) { @@ -655,10 +656,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,25 +671,25 @@ 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 { @@ -696,45 +697,45 @@ class GVAR(export) { style = 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..1c2bee2f75 100644 --- a/addons/strings/fnc_decodeURL.sqf +++ b/addons/strings/fnc_decodeURL.sqf @@ -28,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/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..436c70ef89 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; }; 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/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..b36fbcb9e8 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 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); 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/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/hemtt.toml b/hemtt.toml index 40efd4274a..2a792dc319 100644 --- a/hemtt.toml +++ b/hemtt.toml @@ -1,4 +1,4 @@ -# HEMTT: https://github.com/synixebrett/HEMTT/commit/d828af84613f6725732a4c42c8b4611ae2a0cf81 +# HEMTT pre v1 name = "CBA_A3" prefix = "cba" author = "CBATeam" @@ -11,68 +11,3 @@ files = [ "meta.cpp", "userconfig" ] - -version = "3.15.1" - -modname = "{{name}}" -key_name = "{{prefix}}_{{version}}" -authority = "{{prefix}}_{{version}}-{{git \"id 8\"}}" - -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 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 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 + }; +}; 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/.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 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!" 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}")