From 6405f9031b1dd3d2b9c65c7eb7babc6b3f38bbf5 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 7 Feb 2024 12:36:59 +0100 Subject: [PATCH] Fix shortcuts not working in the module version Resolves #27 --- editor/limbo_ai_editor_plugin.cpp | 6 +++--- editor/limbo_ai_editor_plugin.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index e68626f..439a03e 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -357,7 +357,7 @@ void LimboAIEditor::_process_shortcut_input(const Ref &p_event) { if (LW_IS_SHORTCUT("limbo_ai/open_debugger", p_event)) { _misc_option_selected(MISC_OPEN_DEBUGGER); - accept_event(); + get_viewport()->set_input_as_handled(); } // * Local shortcuts. @@ -386,7 +386,7 @@ void LimboAIEditor::_process_shortcut_input(const Ref &p_event) { return; } - accept_event(); + get_viewport()->set_input_as_handled(); } void LimboAIEditor::_on_tree_rmb(const Vector2 &p_menu_pos) { @@ -1167,7 +1167,7 @@ LimboAIEditor::LimboAIEditor() { LW_SHORTCUT("limbo_ai/load_behavior_tree", TTR("Load Behavior Tree"), (Key)(LW_KEY_MASK(CMD_OR_CTRL) | LW_KEY_MASK(ALT) | LW_KEY(L))); LW_SHORTCUT("limbo_ai/open_debugger", TTR("Open Debugger"), (Key)(LW_KEY_MASK(CMD_OR_CTRL) | LW_KEY_MASK(ALT) | LW_KEY(D))); - set_process_input(true); + set_process_shortcut_input(true); save_dialog = memnew(FileDialog); save_dialog->set_file_mode(FileDialog::FILE_MODE_SAVE_FILE); diff --git a/editor/limbo_ai_editor_plugin.h b/editor/limbo_ai_editor_plugin.h index be609e6..a080e01 100644 --- a/editor/limbo_ai_editor_plugin.h +++ b/editor/limbo_ai_editor_plugin.h @@ -217,7 +217,7 @@ public: void apply_changes(); #ifdef LIMBOAI_GDEXTENSION - virtual void _input(const Ref &p_event) override { _process_shortcut_input(p_event); } + virtual void _shortcut_input(const Ref &p_event) override { _process_shortcut_input(p_event); } #endif LimboAIEditor();