Compare commits

..

No commits in common. "c9825413c003577248a3d037f7ffa7dd324f3666" and "2b299c0007c1623c72d95894a1cf99ccd9f50693" have entirely different histories.

3 changed files with 10 additions and 30 deletions

View File

@ -345,31 +345,26 @@ void LimboAIEditor::_process_shortcut_input(const Ref<InputEvent> &p_event) {
return; return;
} }
bool handled = false;
// * Global shortcuts. // * Global shortcuts.
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);
handled = true; get_viewport()->set_input_as_handled();
} }
// * When editor is on screen. // * When editor is on screen.
if (!handled && is_visible_in_tree()) { if (is_visible_in_tree()) {
if (LW_IS_SHORTCUT("limbo_ai/jump_to_owner", p_event)) { if (LW_IS_SHORTCUT("limbo_ai/jump_to_owner", p_event)) {
_tab_menu_option_selected(TAB_JUMP_TO_OWNER); _tab_menu_option_selected(TAB_JUMP_TO_OWNER);
handled = true; get_viewport()->set_input_as_handled();
} else if (LW_IS_SHORTCUT("limbo_ai/close_tab", p_event)) { return;
_tab_menu_option_selected(TAB_CLOSE);
handled = true;
} }
} }
// * When editor is focused. // * When editor is focused.
if (!handled && (has_focus() || (get_viewport()->gui_get_focus_owner() && is_ancestor_of(get_viewport()->gui_get_focus_owner())))) { if (has_focus() || (get_viewport()->gui_get_focus_owner() && is_ancestor_of(get_viewport()->gui_get_focus_owner()))) {
handled = true;
if (LW_IS_SHORTCUT("limbo_ai/rename_task", p_event)) { if (LW_IS_SHORTCUT("limbo_ai/rename_task", p_event)) {
_action_selected(ACTION_RENAME); _action_selected(ACTION_RENAME);
} else if (LW_IS_SHORTCUT("limbo_ai/cut_task", p_event)) { } else if (LW_IS_SHORTCUT("limbo_ai/cut_task", p_event)) {
@ -395,11 +390,9 @@ void LimboAIEditor::_process_shortcut_input(const Ref<InputEvent> &p_event) {
} else if (LW_IS_SHORTCUT("limbo_ai/load_behavior_tree", p_event)) { } else if (LW_IS_SHORTCUT("limbo_ai/load_behavior_tree", p_event)) {
_popup_file_dialog(load_dialog); _popup_file_dialog(load_dialog);
} else { } else {
handled = false; return;
} }
}
if (handled) {
get_viewport()->set_input_as_handled(); get_viewport()->set_input_as_handled();
} }
} }
@ -1028,10 +1021,10 @@ void LimboAIEditor::_tab_input(const Ref<InputEvent> &p_input) {
void LimboAIEditor::_show_tab_context_menu() { void LimboAIEditor::_show_tab_context_menu() {
tab_menu->clear(); tab_menu->clear();
tab_menu->add_shortcut(LW_GET_SHORTCUT("limbo_ai/jump_to_owner"), TabMenu::TAB_JUMP_TO_OWNER);
tab_menu->add_item(TTR("Show in FileSystem"), TabMenu::TAB_SHOW_IN_FILESYSTEM); tab_menu->add_item(TTR("Show in FileSystem"), TabMenu::TAB_SHOW_IN_FILESYSTEM);
tab_menu->add_shortcut(LW_GET_SHORTCUT("limbo_ai/jump_to_owner"), TabMenu::TAB_JUMP_TO_OWNER);
tab_menu->add_separator(); tab_menu->add_separator();
tab_menu->add_shortcut(LW_GET_SHORTCUT("limbo_ai/close_tab"), TabMenu::TAB_CLOSE); tab_menu->add_item(TTR("Close Tab"), TabMenu::TAB_CLOSE);
tab_menu->add_item(TTR("Close Other Tabs"), TabMenu::TAB_CLOSE_OTHER); tab_menu->add_item(TTR("Close Other Tabs"), TabMenu::TAB_CLOSE_OTHER);
tab_menu->add_item(TTR("Close Tabs to the Right"), TabMenu::TAB_CLOSE_RIGHT); tab_menu->add_item(TTR("Close Tabs to the Right"), TabMenu::TAB_CLOSE_RIGHT);
tab_menu->add_item(TTR("Close All Tabs"), TabMenu::TAB_CLOSE_ALL); tab_menu->add_item(TTR("Close All Tabs"), TabMenu::TAB_CLOSE_ALL);
@ -1041,12 +1034,7 @@ void LimboAIEditor::_show_tab_context_menu() {
} }
void LimboAIEditor::_tab_menu_option_selected(int p_id) { void LimboAIEditor::_tab_menu_option_selected(int p_id) {
if (history.size() == 0) {
// No tabs open, returning.
return;
}
ERR_FAIL_INDEX(idx_history, history.size()); ERR_FAIL_INDEX(idx_history, history.size());
switch (p_id) { switch (p_id) {
case TAB_SHOW_IN_FILESYSTEM: { case TAB_SHOW_IN_FILESYSTEM: {
Ref<BehaviorTree> bt = history[idx_history]; Ref<BehaviorTree> bt = history[idx_history];
@ -1377,7 +1365,6 @@ 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)));
LW_SHORTCUT("limbo_ai/jump_to_owner", TTR("Jump to Owner"), (Key)(LW_KEY_MASK(CMD_OR_CTRL) | LW_KEY(J))); LW_SHORTCUT("limbo_ai/jump_to_owner", TTR("Jump to Owner"), (Key)(LW_KEY_MASK(CMD_OR_CTRL) | LW_KEY(J)));
LW_SHORTCUT("limbo_ai/close_tab", TTR("Close Tab"), (Key)(LW_KEY_MASK(CMD_OR_CTRL) | LW_KEY(W)));
set_process_shortcut_input(true); set_process_shortcut_input(true);

View File

@ -27,16 +27,10 @@
Vector<String> OwnerPicker::_find_owners(const String &p_path) const { Vector<String> OwnerPicker::_find_owners(const String &p_path) const {
Vector<String> owners; Vector<String> owners;
if (RESOURCE_PATH_IS_BUILT_IN(p_path)) {
// For built-in resources we use the path to the containing resource.
String owner_path = p_path.substr(0, p_path.rfind("::"));
owners.append(owner_path);
return owners;
}
List<EditorFileSystemDirectory *> dirs; List<EditorFileSystemDirectory *> dirs;
dirs.push_back(EDITOR_FILE_SYSTEM()->get_filesystem()); dirs.push_back(EDITOR_FILE_SYSTEM()->get_filesystem());
while (dirs.size() > 0) { while (dirs.size() > 0) {
EditorFileSystemDirectory *efd = dirs.front()->get(); EditorFileSystemDirectory *efd = dirs.front()->get();
dirs.pop_front(); dirs.pop_front();

View File

@ -237,7 +237,6 @@ Variant VARIANT_DEFAULT(Variant::Type p_type);
#define IS_RESOURCE_FILE(m_path) (m_path.begins_with("res://") && m_path.find("::") == -1) #define IS_RESOURCE_FILE(m_path) (m_path.begins_with("res://") && m_path.find("::") == -1)
#define RESOURCE_TYPE_HINT(m_type) vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, m_type) #define RESOURCE_TYPE_HINT(m_type) vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, m_type)
#define RESOURCE_IS_BUILT_IN(m_res) (m_res->get_path().is_empty() || m_res->get_path().contains("::")) #define RESOURCE_IS_BUILT_IN(m_res) (m_res->get_path().is_empty() || m_res->get_path().contains("::"))
#define RESOURCE_PATH_IS_BUILT_IN(m_path) (m_path.is_empty() || m_path.contains("::"))
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED