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 false
}, },
{ {
if (ACE_time - GVAR(lastOpenedOn) > 0.5) then { if (ACE_time - GVAR(lastOpenedOn) > 0.5) exitWith {
[ObjNull] call FUNC(openMenu); [ObjNull] call FUNC(openMenu);
}; };
false
}, },
[35, [false, false, false]], false, 0] call CBA_fnc_addKeybind; [35, [false, false, false]], false, 0] call CBA_fnc_addKeybind;

View File

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