From 46a0fc56316ec1b513863474d8221157b3ac647d Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 13 Jan 2015 22:32:56 +0100 Subject: [PATCH] more macros for common --- addons/common/CfgVehicles.hpp | 4 ++-- addons/common/ProgressScreen.hpp | 8 ++++---- addons/common/config.cpp | 2 +- .../common/scripts/KeyInput/initCanInteractFunction.sqf | 2 +- addons/common/scripts/KeyInput/initKeys.sqf | 2 +- addons/common/scripts/KeyInput/initScrollWheel.sqf | 2 +- addons/common/scripts/KeyInput/script_component.hpp | 1 + addons/common/scripts/Version/checkVersionNumber.sqf | 4 ++-- addons/common/scripts/Version/script_component.hpp | 1 + addons/common/scripts/assignedItemFix.sqf | 2 +- addons/common/scripts/closeMenu.sqf | 2 +- addons/common/scripts/editKey.sqf | 2 +- addons/common/scripts/keyInput.sqf | 2 +- addons/common/scripts/keyRelease.sqf | 2 +- addons/common/scripts/nextKeys.sqf | 2 +- addons/common/scripts/openMenu.sqf | 2 +- addons/common/scripts/readParameters.sqf | 2 +- addons/common/scripts/script_component.hpp | 1 + addons/common/scripts/toggleState.sqf | 2 +- 19 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 addons/common/scripts/KeyInput/script_component.hpp create mode 100644 addons/common/scripts/Version/script_component.hpp create mode 100644 addons/common/scripts/script_component.hpp diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp index 94bc6f057f..d54dec7150 100644 --- a/addons/common/CfgVehicles.hpp +++ b/addons/common/CfgVehicles.hpp @@ -15,8 +15,8 @@ class CfgVehicles { showIn3D = 0; onlyForPlayer = 1; shortcut = "DefaultAction"; - condition = "call ACE_Common_UserActionFireCondition"; - statement = "call ACE_Common_UserActionFire"; + condition = QUOTE(call GVAR(UserActionFireCondition)); + statement = QUOTE(call GVAR(UserActionFire)); userActionID = 100; }; }; diff --git a/addons/common/ProgressScreen.hpp b/addons/common/ProgressScreen.hpp index 873aeac73c..95133bec0f 100644 --- a/addons/common/ProgressScreen.hpp +++ b/addons/common/ProgressScreen.hpp @@ -1,8 +1,8 @@ -class ACE_Common_ProgressBar_Dialog { +class GVAR(ProgressBar_Dialog) { idd = -1; movingEnable = false; - onLoad = "uiNamespace setVariable ['ACE_Common_ctrlProgressBar', (_this select 0) displayCtrl 1]; uiNamespace setVariable ['ACE_Common_ctrlProgressBarTitle', (_this select 0) displayCtrl 2];"; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBar)),(_this select 0) displayCtrl 1)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBarTitle)),(_this select 0) displayCtrl 2)];); objects[] = {}; class controlsBackground { @@ -66,10 +66,10 @@ class ACE_Common_ProgressBar_Dialog { }; }; -class ACE_Common_DisableMouse_Dialog { +class GVAR(DisableMouse_Dialog) { idd = -1; movingEnable = false; - onLoad = "uiNamespace setVariable ['ACE_Common_dlgDisableMouse', _this select 0];"; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),_this select 0)];); objects[] = {}; class controlsBackground { class Background { diff --git a/addons/common/config.cpp b/addons/common/config.cpp index db8b8f532b..a11bbc80b7 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -72,7 +72,7 @@ class ACE_Options { /* class RscControlsGroupNoScrollbars; class RscAttributeInventory: RscControlsGroupNoScrollbars { - onSetFocus = "[_this,""RscAttributeInventory"",'CuratorCommon'] call (uinamespace getvariable ""BIS_fnc_initCuratorAttribute""); _this select 0 call ACE_Common_fnc_addCuratorUnloadEventhandler;"; + onSetFocus = QUOTE([ARR_3(_this,""RscAttributeInventory"",'CuratorCommon')] call (uinamespace getvariable ""BIS_fnc_initCuratorAttribute""); _this select 0 call DFUNC(addCuratorUnloadEventhandler);); }; */ diff --git a/addons/common/scripts/KeyInput/initCanInteractFunction.sqf b/addons/common/scripts/KeyInput/initCanInteractFunction.sqf index ed99ad18c8..d718be04fe 100644 --- a/addons/common/scripts/KeyInput/initCanInteractFunction.sqf +++ b/addons/common/scripts/KeyInput/initCanInteractFunction.sqf @@ -1,5 +1,5 @@ // by commy2 -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" private ["_function", "_configFile", "_count", "_index", "_config", "_configName", "_condition"]; diff --git a/addons/common/scripts/KeyInput/initKeys.sqf b/addons/common/scripts/KeyInput/initKeys.sqf index 7d4283d802..5097cfd89e 100644 --- a/addons/common/scripts/KeyInput/initKeys.sqf +++ b/addons/common/scripts/KeyInput/initKeys.sqf @@ -1,5 +1,5 @@ // by commy2 -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" _config = configFile >> "ACE_Default_Keys"; _count = count _config; diff --git a/addons/common/scripts/KeyInput/initScrollWheel.sqf b/addons/common/scripts/KeyInput/initScrollWheel.sqf index a55ebafa43..5a8bf57d79 100644 --- a/addons/common/scripts/KeyInput/initScrollWheel.sqf +++ b/addons/common/scripts/KeyInput/initScrollWheel.sqf @@ -1,5 +1,5 @@ // by commy2 -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" GVAR(ScrollWheelFrame) = diag_frameno; diff --git a/addons/common/scripts/KeyInput/script_component.hpp b/addons/common/scripts/KeyInput/script_component.hpp new file mode 100644 index 0000000000..23da62b05c --- /dev/null +++ b/addons/common/scripts/KeyInput/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\common\script_component.hpp" \ No newline at end of file diff --git a/addons/common/scripts/Version/checkVersionNumber.sqf b/addons/common/scripts/Version/checkVersionNumber.sqf index d89200c3e1..80527b0954 100644 --- a/addons/common/scripts/Version/checkVersionNumber.sqf +++ b/addons/common/scripts/Version/checkVersionNumber.sqf @@ -1,5 +1,5 @@ // by commy2 -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" sleep 1; //wait for module @@ -19,7 +19,7 @@ if (missionNamespace getVariable ["ACE_Version_CheckAll", false]) then { } forEach activatedAddons; }; -_versionMain = parseNumber getText (configFile >> "CfgPatches" >> "ACE_Common" >> "version"); +_versionMain = parseNumber getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version"); _versions = []; { diff --git a/addons/common/scripts/Version/script_component.hpp b/addons/common/scripts/Version/script_component.hpp new file mode 100644 index 0000000000..23da62b05c --- /dev/null +++ b/addons/common/scripts/Version/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\common\script_component.hpp" \ No newline at end of file diff --git a/addons/common/scripts/assignedItemFix.sqf b/addons/common/scripts/assignedItemFix.sqf index 77a1c410df..bf8dc193ec 100644 --- a/addons/common/scripts/assignedItemFix.sqf +++ b/addons/common/scripts/assignedItemFix.sqf @@ -1,5 +1,5 @@ // by commy2 -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" if (isNil "ACE_itemFix") then { ACE_isMapEnabled = call {_config = missionConfigFile >> "showMap"; !isNumber _config || {getNumber _config == 1}}; diff --git a/addons/common/scripts/closeMenu.sqf b/addons/common/scripts/closeMenu.sqf index 88c8db10a0..86206f2c93 100644 --- a/addons/common/scripts/closeMenu.sqf +++ b/addons/common/scripts/closeMenu.sqf @@ -1,5 +1,5 @@ // by commy2 -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" closeDialog 0; [localize QUOTE(DOUBLES(STR,GVAR(ProfileNotSaved)))] call FUNC(displayTextStructured); diff --git a/addons/common/scripts/editKey.sqf b/addons/common/scripts/editKey.sqf index 0f7518c758..53bdbede56 100644 --- a/addons/common/scripts/editKey.sqf +++ b/addons/common/scripts/editKey.sqf @@ -1,5 +1,5 @@ // by commy2 -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" #define GRAY [0.25, 0.25, 0.25, 1] #define WHITE [1, 1, 1, 1] diff --git a/addons/common/scripts/keyInput.sqf b/addons/common/scripts/keyInput.sqf index eab0e56448..5e06d23bd5 100644 --- a/addons/common/scripts/keyInput.sqf +++ b/addons/common/scripts/keyInput.sqf @@ -1,5 +1,5 @@ // by commy2 -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" #define FORBIDDEN_KEYS [42, 54, 29, 157, 56, 184, 0, 183, 197, 1] diff --git a/addons/common/scripts/keyRelease.sqf b/addons/common/scripts/keyRelease.sqf index 0d5542241d..d0d1b736a0 100644 --- a/addons/common/scripts/keyRelease.sqf +++ b/addons/common/scripts/keyRelease.sqf @@ -1,5 +1,5 @@ // by commy2 -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" _keyIndex = _this select 1; diff --git a/addons/common/scripts/nextKeys.sqf b/addons/common/scripts/nextKeys.sqf index 004c3de992..b2b0079a41 100644 --- a/addons/common/scripts/nextKeys.sqf +++ b/addons/common/scripts/nextKeys.sqf @@ -1,5 +1,5 @@ // by commy2 -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" #define OFFSET_1 100 #define OFFSET_2 200 diff --git a/addons/common/scripts/openMenu.sqf b/addons/common/scripts/openMenu.sqf index 018c9f8ccb..6e68a59482 100644 --- a/addons/common/scripts/openMenu.sqf +++ b/addons/common/scripts/openMenu.sqf @@ -1,5 +1,5 @@ // by commy2 -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" #define OFFSET_1 100 #define OFFSET_2 200 diff --git a/addons/common/scripts/readParameters.sqf b/addons/common/scripts/readParameters.sqf index 505776abd0..3b17ea7f1f 100644 --- a/addons/common/scripts/readParameters.sqf +++ b/addons/common/scripts/readParameters.sqf @@ -1,5 +1,5 @@ // by CAA-Picard -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" // Read ACE_Parameters from config and set them on the mission namespace _config = configFile >> "ACE_Parameters_Numeric"; diff --git a/addons/common/scripts/script_component.hpp b/addons/common/scripts/script_component.hpp new file mode 100644 index 0000000000..23da62b05c --- /dev/null +++ b/addons/common/scripts/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\common\script_component.hpp" \ No newline at end of file diff --git a/addons/common/scripts/toggleState.sqf b/addons/common/scripts/toggleState.sqf index 3643b00c19..58e59e851a 100644 --- a/addons/common/scripts/toggleState.sqf +++ b/addons/common/scripts/toggleState.sqf @@ -1,5 +1,5 @@ // by commy2 -#include "\z\ace\addons\common\script_component.hpp" +#include "script_component.hpp" _index = _this select 0;