Interact Menu - Add blocking while editing CT_EDIT (#8796)

* Interact Menu - Add blocking while editing CT_EDIT

* use findIf

* Use A3 defines
This commit is contained in:
GhostIsSpooky 2022-03-07 15:29:02 -03:00 committed by GitHub
parent 9209fedcf7
commit 5a72b61a50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,13 +15,21 @@
* Public: No * Public: No
*/ */
#include "\a3\ui_f\hpp\defineResincl.inc"
params ["_menuType"]; params ["_menuType"];
if (GVAR(openedMenuType) == _menuType) exitWith {true}; if (GVAR(openedMenuType) == _menuType) exitWith {true};
// Conditions: Don't open when editing a text box
private _isTextEditing = (allDisplays findIf {(ctrlType (focusedCtrl _x)) == CT_EDIT}) != -1;
// Conditions: canInteract (these don't apply to zeus) // Conditions: canInteract (these don't apply to zeus)
if ((isNull curatorCamera) && { if (
!([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith)) _isTextEditing ||
{(isNull curatorCamera) && {
!([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith))
}
}) exitWith {false}; }) exitWith {false};
while {dialog} do { while {dialog} do {