Search the Community
Showing results for tags 'macro'.
Found 1 result
-
combining two macros together to create a path
igneous01 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have a build script where I'm trying to generate some UI classes and attaching some handlers to them using macros. #include "BIS_Defaults.hpp" #include "Font_Definitions.hpp" #include "Color_Definitions.hpp" #include "Template_Default_Definitions.hpp" // ************* MACROS ************************************************************************ // Directory macro //#define IGN_DLG_DIR 'scripted\\IGN_DLG\\IGN_DLG_raiseEvent.sqf' //scripted\IGN_DLG\IGN_DLG_raiseEvent.sqf // CONTROL EVENTS #define ctrlOnButtonClick \ onButtonClick = "['IGN_Event_onButtonClick', [ctrlParent (_this select 0), _this select 0]] execVM 'scripted\IGN_DLG\IGN_DLG_raiseEvent.sqf'" #define ctrlOnButtonDown \ onButtonDown = "['IGN_Event_onButtonDown', [ctrlParent (_this select 0), _this select 0]] execVM 'scripted\IGN_DLG\IGN_DLG_raiseEvent.sqf'" Everything works as long as my script folder is inside a 'scripted' folder, but if I want to add flexibility of relocating my scripts to a different path, this breaks. I want to be able to define the parent path like so: #define LIB_PATH = "AnotherFolder\IGN_DLG" Then on the #define ctrlOnButtonClick replace only a part of the definition with part of the LIB_PATH macro like so: #define ctrlOnButtonClick \ onButtonClick = "['IGN_Event_onButtonClick', [ctrlParent (_this select 0), _this select 0]] execVM 'LIB_PATH\IGN_DLG_raiseEvent.sqf'" But this doesn't work. I've read you can combine macros together like so: ##LIB_PATH##\IGN_fnc_raiseEvent.sqf but I also have problems getting this to work (I'm assuming if you #define "MyPath\IGN_DLG" it also inserts the quotes, which screws up the original string. Anyone know a way around this?