Accept Ctrl-J when LimboAI editor is visible and fix shortcuts not working sometimes
This commit is contained in:
parent
88e468c526
commit
2b299c0007
|
@ -352,12 +352,19 @@ void LimboAIEditor::_process_shortcut_input(const Ref<InputEvent> &p_event) {
|
|||
get_viewport()->set_input_as_handled();
|
||||
}
|
||||
|
||||
// * Local shortcuts.
|
||||
// * When editor is on screen.
|
||||
|
||||
if (!(has_focus() || get_viewport()->gui_get_focus_owner() == nullptr || is_ancestor_of(get_viewport()->gui_get_focus_owner()))) {
|
||||
if (is_visible_in_tree()) {
|
||||
if (LW_IS_SHORTCUT("limbo_ai/jump_to_owner", p_event)) {
|
||||
_tab_menu_option_selected(TAB_JUMP_TO_OWNER);
|
||||
get_viewport()->set_input_as_handled();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// * When editor is focused.
|
||||
|
||||
if (has_focus() || (get_viewport()->gui_get_focus_owner() && is_ancestor_of(get_viewport()->gui_get_focus_owner()))) {
|
||||
if (LW_IS_SHORTCUT("limbo_ai/rename_task", p_event)) {
|
||||
_action_selected(ACTION_RENAME);
|
||||
} else if (LW_IS_SHORTCUT("limbo_ai/cut_task", p_event)) {
|
||||
|
@ -382,14 +389,13 @@ void LimboAIEditor::_process_shortcut_input(const Ref<InputEvent> &p_event) {
|
|||
_on_save_pressed();
|
||||
} else if (LW_IS_SHORTCUT("limbo_ai/load_behavior_tree", p_event)) {
|
||||
_popup_file_dialog(load_dialog);
|
||||
} else if (LW_IS_SHORTCUT("limbo_ai/jump_to_owner", p_event)) {
|
||||
_tab_menu_option_selected(TAB_JUMP_TO_OWNER);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
get_viewport()->set_input_as_handled();
|
||||
}
|
||||
}
|
||||
|
||||
void LimboAIEditor::_on_tree_rmb(const Vector2 &p_menu_pos) {
|
||||
menu->clear();
|
||||
|
|
Loading…
Reference in New Issue