Merge pull request #30 from limbonaut/keyboard-shortcuts

Fix shortcuts not working in the module version
This commit is contained in:
Serhii Snitsaruk 2024-02-07 13:21:23 +01:00 committed by GitHub
commit 8260954654
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -357,7 +357,7 @@ void LimboAIEditor::_process_shortcut_input(const Ref<InputEvent> &p_event) {
if (LW_IS_SHORTCUT("limbo_ai/open_debugger", p_event)) { if (LW_IS_SHORTCUT("limbo_ai/open_debugger", p_event)) {
_misc_option_selected(MISC_OPEN_DEBUGGER); _misc_option_selected(MISC_OPEN_DEBUGGER);
accept_event(); get_viewport()->set_input_as_handled();
} }
// * Local shortcuts. // * Local shortcuts.
@ -386,7 +386,7 @@ void LimboAIEditor::_process_shortcut_input(const Ref<InputEvent> &p_event) {
return; return;
} }
accept_event(); get_viewport()->set_input_as_handled();
} }
void LimboAIEditor::_on_tree_rmb(const Vector2 &p_menu_pos) { 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/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))); 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 = memnew(FileDialog);
save_dialog->set_file_mode(FileDialog::FILE_MODE_SAVE_FILE); save_dialog->set_file_mode(FileDialog::FILE_MODE_SAVE_FILE);

View File

@ -217,7 +217,7 @@ public:
void apply_changes(); void apply_changes();
#ifdef LIMBOAI_GDEXTENSION #ifdef LIMBOAI_GDEXTENSION
virtual void _input(const Ref<InputEvent> &p_event) override { _process_shortcut_input(p_event); } virtual void _shortcut_input(const Ref<InputEvent> &p_event) override { _process_shortcut_input(p_event); }
#endif #endif
LimboAIEditor(); LimboAIEditor();