From 006916429372ed06e738239dc17e72bcf8d7660c Mon Sep 17 00:00:00 2001 From: Felix Siebeneicker Date: Tue, 22 Sep 2020 21:37:41 +0200 Subject: [PATCH] Closing right-click menu on mouse down --- .../src/com/interrupt/dungeoneer/editor/EditorInput.java | 2 ++ .../src/com/interrupt/dungeoneer/editor/ui/EditorUi.java | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/DelvEdit/src/com/interrupt/dungeoneer/editor/EditorInput.java b/DelvEdit/src/com/interrupt/dungeoneer/editor/EditorInput.java index dfa3a1df..a757a8b0 100644 --- a/DelvEdit/src/com/interrupt/dungeoneer/editor/EditorInput.java +++ b/DelvEdit/src/com/interrupt/dungeoneer/editor/EditorInput.java @@ -96,6 +96,8 @@ public boolean touchDown(int x, int y, int pointer, int button) { ignoreRightClick = false; + Editor.app.ui.touchDown(x, y, pointer, button); + for (InputProcessor listener : listeners) { boolean results = listener.touchDown(x, y, pointer, button); if (results) { diff --git a/DelvEdit/src/com/interrupt/dungeoneer/editor/ui/EditorUi.java b/DelvEdit/src/com/interrupt/dungeoneer/editor/ui/EditorUi.java index ba8578e3..6752cd21 100644 --- a/DelvEdit/src/com/interrupt/dungeoneer/editor/ui/EditorUi.java +++ b/DelvEdit/src/com/interrupt/dungeoneer/editor/ui/EditorUi.java @@ -611,4 +611,10 @@ public void touchUp(int x, int y, int pointer, int button) { } } } + + public void touchDown(int x, int y, int pointer, int button) { + if (button == Input.Buttons.RIGHT) { + hideContextMenu(); + } + } }