Return true / false if event was handled so that CBA keybinding doesn't have a reason to complain.

Converted tabs to spaces
This commit is contained in:
nsgundy 2015-08-19 15:32:46 -03:00
parent 4acdfcbd24
commit 3aab62fa7c
2 changed files with 15 additions and 8 deletions

View File

@ -26,9 +26,10 @@ if (!hasInterface) exitwith {};
false
},
{
if (ACE_time - GVAR(lastOpenedOn) > 0.5) then {
if (ACE_time - GVAR(lastOpenedOn) > 0.5) exitWith {
[ObjNull] call FUNC(openMenu);
};
false
},
[35, [false, false, false]], false, 0] call CBA_fnc_addKeybind;

View File

@ -6,7 +6,7 @@
* 0: Target <OBJECT>
*
* Return Value:
* None
* If action was taken <BOOL>
*
* Example:
* [some_player] call ace_medical_menu_openMenu
@ -18,16 +18,22 @@
params ["_interactionTarget"];
if (dialog || isNull _interactionTarget) exitwith {
disableSerialization;
disableSerialization;
private "_display";
_display = uiNamespace getVariable QGVAR(medicalMenu);
if (!isNil "_display") then {
closeDialog 314412;
};
private ["_display", "_handled"];
_handled = false;
_display = uiNamespace getVariable QGVAR(medicalMenu);
if (!isNil "_display") then {
closeDialog 314412;
_handled = true;
};
_handled
};
GVAR(INTERACTION_TARGET) = _interactionTarget;
createDialog QGVAR(medicalMenu);
GVAR(lastOpenedOn) = ACE_time;
true