Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move flexiMenu functions to CfgFunctions #1054

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions addons/ui/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,36 @@ class CfgFunctions {
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);
Expand Down
16 changes: 0 additions & 16 deletions addons/ui/flexiMenu/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);

dedmen marked this conversation as resolved.
Show resolved Hide resolved
// 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.
Expand Down