You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-02 16:48:55 +00:00
Merge pull request #109587 from tle-oops/tle/file-explorer
Make FileSystemDock navigate to currently selected scene tab
This commit is contained in:
@@ -1078,6 +1078,9 @@
|
|||||||
<member name="interface/multi_window/restore_windows_on_load" type="bool" setter="" getter="">
|
<member name="interface/multi_window/restore_windows_on_load" type="bool" setter="" getter="">
|
||||||
If [code]true[/code], the floating panel position, size, and screen will be saved on editor exit. On next launch the panels that were floating will be made floating in the saved positions, sizes and screens, if possible.
|
If [code]true[/code], the floating panel position, size, and screen will be saved on editor exit. On next launch the panels that were floating will be made floating in the saved positions, sizes and screens, if possible.
|
||||||
</member>
|
</member>
|
||||||
|
<member name="interface/scene_tabs/auto_select_current_scene_file" type="bool" setter="" getter="">
|
||||||
|
If [code]true[/code], the FileSystem dock will automatically navigate to the currently selected scene tab.
|
||||||
|
</member>
|
||||||
<member name="interface/scene_tabs/display_close_button" type="int" setter="" getter="">
|
<member name="interface/scene_tabs/display_close_button" type="int" setter="" getter="">
|
||||||
Controls when the Close (X) button is displayed on scene tabs at the top of the editor.
|
Controls when the Close (X) button is displayed on scene tabs at the top of the editor.
|
||||||
</member>
|
</member>
|
||||||
|
|||||||
@@ -4513,10 +4513,23 @@ void EditorNode::_set_current_scene_nocheck(int p_idx) {
|
|||||||
callable_mp(this, &EditorNode::_set_main_scene_state).call_deferred(state, get_edited_scene()); // Do after everything else is done setting up.
|
callable_mp(this, &EditorNode::_set_main_scene_state).call_deferred(state, get_edited_scene()); // Do after everything else is done setting up.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!select_current_scene_file_requested && EDITOR_GET("interface/scene_tabs/auto_select_current_scene_file")) {
|
||||||
|
select_current_scene_file_requested = true;
|
||||||
|
callable_mp(this, &EditorNode::_nav_to_selected_scene).call_deferred();
|
||||||
|
}
|
||||||
|
|
||||||
_update_undo_redo_allowed();
|
_update_undo_redo_allowed();
|
||||||
_update_unsaved_cache();
|
_update_unsaved_cache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditorNode::_nav_to_selected_scene() {
|
||||||
|
select_current_scene_file_requested = false;
|
||||||
|
const String scene_path = editor_data.get_scene_path(scene_tabs->get_current_tab());
|
||||||
|
if (!scene_path.is_empty()) {
|
||||||
|
FileSystemDock::get_singleton()->navigate_to_path(scene_path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EditorNode::setup_color_picker(ColorPicker *p_picker) {
|
void EditorNode::setup_color_picker(ColorPicker *p_picker) {
|
||||||
p_picker->set_editor_settings(EditorSettings::get_singleton());
|
p_picker->set_editor_settings(EditorSettings::get_singleton());
|
||||||
int default_color_mode = EditorSettings::get_singleton()->get_project_metadata("color_picker", "color_mode", EDITOR_GET("interface/inspector/default_color_picker_mode"));
|
int default_color_mode = EditorSettings::get_singleton()->get_project_metadata("color_picker", "color_mode", EDITOR_GET("interface/inspector/default_color_picker_mode"));
|
||||||
|
|||||||
@@ -454,6 +454,8 @@ private:
|
|||||||
bool waiting_for_first_scan = true;
|
bool waiting_for_first_scan = true;
|
||||||
bool load_editor_layout_done = false;
|
bool load_editor_layout_done = false;
|
||||||
|
|
||||||
|
bool select_current_scene_file_requested = false;
|
||||||
|
|
||||||
HashSet<Ref<Translation>> tracked_translations;
|
HashSet<Ref<Translation>> tracked_translations;
|
||||||
bool pending_translation_notification = false;
|
bool pending_translation_notification = false;
|
||||||
|
|
||||||
@@ -592,6 +594,7 @@ private:
|
|||||||
|
|
||||||
void _set_current_scene(int p_idx);
|
void _set_current_scene(int p_idx);
|
||||||
void _set_current_scene_nocheck(int p_idx);
|
void _set_current_scene_nocheck(int p_idx);
|
||||||
|
void _nav_to_selected_scene();
|
||||||
bool _validate_scene_recursive(const String &p_filename, Node *p_node);
|
bool _validate_scene_recursive(const String &p_filename, Node *p_node);
|
||||||
void _save_scene(String p_file, int idx = -1);
|
void _save_scene(String p_file, int idx = -1);
|
||||||
void _save_all_scenes();
|
void _save_all_scenes();
|
||||||
|
|||||||
@@ -627,6 +627,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
|||||||
EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_RANGE, "interface/scene_tabs/maximum_width", 350, "0,9999,1", PROPERTY_USAGE_DEFAULT)
|
EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_RANGE, "interface/scene_tabs/maximum_width", 350, "0,9999,1", PROPERTY_USAGE_DEFAULT)
|
||||||
_initial_set("interface/scene_tabs/show_script_button", false, true);
|
_initial_set("interface/scene_tabs/show_script_button", false, true);
|
||||||
_initial_set("interface/scene_tabs/restore_scenes_on_load", true, true);
|
_initial_set("interface/scene_tabs/restore_scenes_on_load", true, true);
|
||||||
|
EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "interface/scene_tabs/auto_select_current_scene_file", false, "");
|
||||||
|
|
||||||
// Multi Window
|
// Multi Window
|
||||||
EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "interface/multi_window/enable", true, "");
|
EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "interface/multi_window/enable", true, "");
|
||||||
|
|||||||
Reference in New Issue
Block a user