Merge pull request #1415 from GitHawk/master

runOnHover can now be CODE & SurgicalKits
This commit is contained in:
Nicolás Badano 2015-06-02 18:07:36 -03:00
commit 8f15856084
3 changed files with 23 additions and 3 deletions

View File

@ -69,7 +69,12 @@ _recurseFnc = {
_showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0;
_enableInside = (getNumber (_entryCfg >> "enableInside")) > 0;
_canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0;
_runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0;
_runOnHover = false;
if (isText (_entryCfg >> "runOnHover")) then {
_runOnHover = compile getText (_entryCfg >> "runOnHover");
} else {
_runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0;
};
_condition = compile _condition;
_children = [_entryCfg] call _recurseFnc;

View File

@ -53,7 +53,12 @@ _recurseFnc = {
_showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0;
_enableInside = (getNumber (_entryCfg >> "enableInside")) > 0;
_canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0;
_runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0;
_runOnHover = true;
if (isText (_entryCfg >> "runOnHover")) then {
_runOnHover = compile getText (_entryCfg >> "runOnHover");
} else {
_runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0;
};
_condition = compile _condition;
_children = [_entryCfg] call _recurseFnc;

View File

@ -89,7 +89,17 @@ if (GVAR(openedMenuType) >= 0) then {
// Execute the current action if it's run on hover
private "_runOnHover";
_runOnHover = ((GVAR(selectedAction) select 0) select 9) select 3;
_tmp = ((GVAR(selectedAction) select 0) select 9) select 3;
_runOnHover = true;
if ((typeName _tmp) == "CODE" ) then {
_runOnHover = call _tmp;
} else {
if ((typeName _tmp) == "BOOL" ) then {
_runOnHover = _tmp;
} else {
_runOnHover = _tmp > 0;
};
};
if (_runOnHover) then {
this = GVAR(selectedTarget);
_player = ACE_Player;