handle cursor mode

This commit is contained in:
commy2 2015-04-30 21:00:30 +02:00
parent 5ec8b6d36c
commit 8c8e310d66
2 changed files with 9 additions and 3 deletions

View File

@ -16,9 +16,9 @@ EXPLODE_2_PVT(_this,_newUnit,_oldUnit);
// add to new unit
private "_ehid";
_ehid = [_newUnit, "DefaultAction", {GVAR(openedMenuType) >= 0}, {
if !(GVAR(actionOnKeyRelease)) then {
[GVAR(openedMenuType),true] call FUNC(keyUp);
};
if !(GVAR(actionOnKeyRelease)) then {
[GVAR(openedMenuType),true] call FUNC(keyUp);
};
}] call EFUNC(common,addActionEventHandler);
_newUnit setVariable [QGVAR(AAEHID), _ehid];

View File

@ -52,6 +52,12 @@ if (GVAR(useCursorMenu)) then {
GVAR(cursorPos) = [_this select 1, _this select 2, 0];
};
}];
// handles LMB in cursor mode when action on keyrelease is disabled
((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseButtonDown", {
if !(GVAR(actionOnKeyRelease)) then {
[GVAR(openedMenuType),true] call FUNC(keyUp);
};
}];
setMousePosition [0.5, 0.5];
};