diff --git a/addons/ui/CfgFunctions.hpp b/addons/ui/CfgFunctions.hpp index 4a0e678d7..1354ae310 100644 --- a/addons/ui/CfgFunctions.hpp +++ b/addons/ui/CfgFunctions.hpp @@ -2,21 +2,48 @@ class CfgFunctions { class CBA { class UI { class flexiMenu_Add { - description = "Add a type-based menu source. Result: TBA (WIP)"; file = QUOTE(PATHTOF(flexiMenu\fnc_add.sqf)); }; class flexiMenu_Remove { - description = "Remove a type-based menu source. Result: TBA (WIP)"; file = QUOTE(PATHTOF(flexiMenu\fnc_remove.sqf)); }; class flexiMenu_setObjectMenuSource { - description = "Set an object's menu source (variable). Result: TBA (WIP)"; file = QUOTE(PATHTOF(flexiMenu\fnc_setObjectMenuSource.sqf)); }; class flexiMenu_openMenuByDef { - description = "Open a previously defined menu by passing the exact parameters used with cba_fnc_fleximenu_add. Result: TBA (WIP)"; file = QUOTE(PATHTOF(flexiMenu\fnc_openMenuByDef.sqf)); }; + class flexiMenu_keyDown { + file = QUOTE(PATHTOF(flexiMenu\fnc_keyDown.sqf)); + }; + class flexiMenu_keyUp { + file = QUOTE(PATHTOF(flexiMenu\fnc_keyUp.sqf)); + }; + class flexiMenu_menu { + file = QUOTE(PATHTOF(flexiMenu\fnc_menu.sqf)); + }; + class flexiMenu_list { + file = QUOTE(PATHTOF(flexiMenu\fnc_list.sqf)); + }; + class flexiMenu_getMenuDef { + file = QUOTE(PATHTOF(flexiMenu\fnc_getMenuDef.sqf)); + }; + class flexiMenu_getMenuOption { + file = QUOTE(PATHTOF(flexiMenu\fnc_getMenuOption.sqf)); + }; + class flexiMenu_menuShortcut { + file = QUOTE(PATHTOF(flexiMenu\fnc_menuShortcut.sqf)); + }; + class flexiMenu_mouseButtonDown { + file = QUOTE(PATHTOF(flexiMenu\fnc_mouseButtonDown.sqf)); + }; + class flexiMenu_highlightCaretKey { + file = QUOTE(PATHTOF(flexiMenu\fnc_highlightCaretKey.sqf)); + }; + class flexiMenu_execute { + file = QUOTE(PATHTOF(flexiMenu\fnc_execute.sqf)); + }; + PATHTO_FNC(addPauseMenuOption); PATHTO_FNC(progressBar); PATHTO_FNC(getFov); diff --git a/addons/ui/flexiMenu/init.sqf b/addons/ui/flexiMenu/init.sqf index c9f12c533..6c421e745 100644 --- a/addons/ui/flexiMenu/init.sqf +++ b/addons/ui/flexiMenu/init.sqf @@ -8,22 +8,6 @@ GVAR(target) = objNull; // current object for interaction GVAR(holdKeyDown) = false; // default global behaviour of requiring holding key down. Can be overriden by menus. GVAR(hotKeyColor) = ""; // override colour of hotkey. It is set from rsc menu file, upon opening either the "menu" or "list". If not present, a default will be used. -PREP_SUB(flexiMenu,keyDown); -PREP_SUB(flexiMenu,keyUp); -PREP_SUB(flexiMenu,menu); -PREP_SUB(flexiMenu,list); -PREP_SUB(flexiMenu,getMenuDef); -PREP_SUB(flexiMenu,getMenuOption); -PREP_SUB(flexiMenu,menuShortcut); -PREP_SUB(flexiMenu,mouseButtonDown); -PREP_SUB(flexiMenu,highlightCaretKey); -PREP_SUB(flexiMenu,execute); - -// TODO: move these to public CfgFunctions soon. -PREP_SUB(flexiMenu,add); -PREP_SUB(flexiMenu,remove); -PREP_SUB(flexiMenu,setObjectMenuSource); - // prevent instant reactivation of menu after selection was made, while key still held down. Value is reset upon key release. GVAR(optionSelected) = false; // prevent multiple activations of menu due to key press via keyDown. onLoad can sometimes take a few milliseconds to init. diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index 9f0cd2275..7c6bed8f5 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -85,11 +85,5 @@ #define __SMW_default 0.15 * safeZoneW // common sub-menu width, used in script #define __defaultHotkeyColor "#f07EB27E" -// additional "_SUB" macros to handle sub folders -#define PATHTO_SUB(var1,var2,var3,var4) MAINPREFIX\##var1\SUBPREFIX\##var2\##var3\##var4.sqf -#define COMPILE_FILE_SUB(var1,var2,var3,var4) COMPILE_FILE2(PATHTO_SUB(var1,var2,var3,var4)) -#define PREP_SYS_SUB(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_SUB(var1,var2,var3,DOUBLES(fnc,var4)) -#define PREP_SUB(var1,var2) PREP_SYS_SUB(PREFIX,COMPONENT_F,var1,var2) - // array select with bounds check (for optional parameters) #define IfCountDefault(var1,array2,index3,default4) ##var1 = if (count ##array2 > ##index3) then {##array2 select ##index3} else {##default4};