1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Added "Show In FileSystem" right-click option to Scene hierarchy nodes.

-Implemented shared function for focusing FileSystem tab and highlighting the node path.
-Created right-click option that shows up in the Scene-Hierarchy on Nodes that have a file-system source path.
-Created custom icon for this right-click option
-Implemented the shared function and icon for other places that already had this features (Open Node tab, Inspector Resource)

Co-authored-by: MewPurPur <mew.pur.pur@gmail.com>
This commit is contained in:
Invertex
2023-11-14 03:55:36 -08:00
parent c455cb6555
commit 59787683a9
8 changed files with 34 additions and 18 deletions

View File

@@ -237,7 +237,7 @@ void EditorResourcePicker::_update_menu_items() {
if (edited_resource->get_path().is_resource_file()) {
edit_menu->add_separator();
edit_menu->add_item(TTR("Show in FileSystem"), OBJ_MENU_SHOW_IN_FILE_SYSTEM);
edit_menu->add_icon_item(get_editor_theme_icon(SNAME("ShowInFileSystem")), TTR("Show in FileSystem"), OBJ_MENU_SHOW_IN_FILE_SYSTEM);
}
}
@@ -418,16 +418,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
} break;
case OBJ_MENU_SHOW_IN_FILE_SYSTEM: {
FileSystemDock *file_system_dock = FileSystemDock::get_singleton();
file_system_dock->navigate_to_path(edited_resource->get_path());
// Ensure that the FileSystem dock is visible.
if (file_system_dock->get_window() == get_tree()->get_root()) {
TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control();
tab_container->set_current_tab(tab_container->get_tab_idx_from_control(file_system_dock));
} else {
file_system_dock->get_window()->grab_focus();
}
FileSystemDock::get_singleton()->navigate_to_path(edited_resource->get_path());
} break;
default: {