Execute statement when hovering over actions that open submenus

This commit is contained in:
Nicolás Badano 2015-03-11 00:21:05 -03:00
parent b33127d3b0
commit 722f49acc4
3 changed files with 7 additions and 4 deletions

View File

@ -23,7 +23,7 @@ if (((_namespace getVariable [_uid, [-99999]]) select 0) < diag_tickTime) then {
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
diag_log format ["Calculated result: %1 %2", _namespace, _uid]; diag_log format ["Calculated result: %1 %2", _namespace, _uid];
} else { } else {
diag_log format ["Cached result : %1 %2", _namespace, _uid]; diag_log format ["Cached result : %1 %2", _namespace, _uid];
#endif #endif
}; };

View File

@ -23,6 +23,7 @@ GVAR(keyDownTime) = 0;
GVAR(lastTime) = diag_tickTime; GVAR(lastTime) = diag_tickTime;
GVAR(rotationAngle) = 0; GVAR(rotationAngle) = 0;
GVAR(selectedAction) = [[],[]];
GVAR(selectedStatement) = {}; GVAR(selectedStatement) = {};
GVAR(actionSelected) = false; GVAR(actionSelected) = false;
GVAR(selectedTarget) = objNull; GVAR(selectedTarget) = objNull;

View File

@ -143,7 +143,9 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then {
_foundTarget = true; _foundTarget = true;
GVAR(actionSelected) = true; GVAR(actionSelected) = true;
GVAR(selectedTarget) = (_closest select 0) select 0; GVAR(selectedTarget) = (_closest select 0) select 0;
GVAR(selectedStatement) = (((_closest select 0) select 1) select 0) select 3; GVAR(selectedAction) = (_closest select 0) select 1;
GVAR(selectedStatement) = ((GVAR(selectedAction)) select 0) select 3;
_misMatch = false; _misMatch = false;
_hoverPath = (_closest select 2); _hoverPath = (_closest select 2);
@ -166,8 +168,8 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then {
GVAR(expanded) = true; GVAR(expanded) = true;
GVAR(menuDepthPath) = +GVAR(lastPath); GVAR(menuDepthPath) = +GVAR(lastPath);
// Execute the menu action when it ex // Execute the current action if it's opening a submenu
if(GVAR(actionSelected)) then { if (count (GVAR(selectedAction) select 1) > 0) then {
this = GVAR(selectedTarget); this = GVAR(selectedTarget);
_player = ACE_Player; _player = ACE_Player;
_target = GVAR(selectedTarget); _target = GVAR(selectedTarget);