You've already forked godot
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:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user