Skip to content

Commit 76837db

Browse files
committed
Remove show_scene_tree_root_selection from EditorSettings
1 parent 1aaea38 commit 76837db

File tree

4 files changed

+17
-24
lines changed

4 files changed

+17
-24
lines changed

doc/classes/EditorSettings.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,9 +1088,6 @@
10881088
<member name="interface/editors/derive_script_globals_by_name" type="bool" setter="" getter="">
10891089
If [code]true[/code], when extending a script, the global class name of the script is inserted in the script creation dialog, if it exists. If [code]false[/code], the script's file path is always inserted.
10901090
</member>
1091-
<member name="interface/editors/show_scene_tree_root_selection" type="bool" setter="" getter="">
1092-
If [code]true[/code], the Scene dock will display buttons to quickly add a root node to a newly created scene.
1093-
</member>
10941091
<member name="interface/inspector/auto_unfold_foreign_scenes" type="bool" setter="" getter="">
10951092
If [code]true[/code], automatically unfolds Inspector property groups containing modified values when opening a scene for the first time. Only affects scenes without saved folding preferences and only unfolds groups with properties that have been changed from their default values.
10961093
[b]Note:[/b] This setting only works in specific scenarios: when opening a scene brought in from another project, or when opening a new scene that already has modified properties (e.g., from version control). Duplicated scenes are not considered foreign, so this setting will not affect them.

editor/docks/scene_tree_dock.cpp

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,7 @@ void SceneTreeDock::_notification(int p_what) {
17491749
button_clipboard->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_PASTE, false));
17501750

17511751
_update_create_root_dialog(true);
1752+
_update_create_root_dialog_visibility();
17521753
} break;
17531754

17541755
case NOTIFICATION_ENTER_TREE: {
@@ -1803,22 +1804,6 @@ void SceneTreeDock::_notification(int p_what) {
18031804
menu_subresources->add_theme_constant_override("icon_max_width", get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor)));
18041805
} break;
18051806

1806-
case NOTIFICATION_PROCESS: {
1807-
bool show_create_root = bool(EDITOR_GET("interface/editors/show_scene_tree_root_selection")) && get_tree()->get_edited_scene_root() == nullptr;
1808-
1809-
if (show_create_root != create_root_dialog->is_visible_in_tree() && !remote_tree->is_visible()) {
1810-
if (show_create_root) {
1811-
main_mc->set_theme_type_variation("");
1812-
create_root_dialog->show();
1813-
scene_tree->hide();
1814-
} else {
1815-
main_mc->set_theme_type_variation("NoBorderHorizontalBottom");
1816-
create_root_dialog->hide();
1817-
scene_tree->show();
1818-
}
1819-
}
1820-
} break;
1821-
18221807
case NOTIFICATION_DRAG_END: {
18231808
_reset_hovering_timer();
18241809
if (tree_item_inspected) {
@@ -3427,6 +3412,7 @@ bool SceneTreeDock::_check_node_recursive(Variant &r_variant, Node *p_node, Node
34273412

34283413
void SceneTreeDock::set_edited_scene(Node *p_scene) {
34293414
edited_scene = p_scene;
3415+
_update_create_root_dialog_visibility();
34303416
}
34313417

34323418
static bool _is_same_selection(const Vector<Node *> &p_first, const HashMap<ObjectID, Object *> &p_second) {
@@ -4637,16 +4623,26 @@ void SceneTreeDock::_remote_tree_selected() {
46374623
}
46384624

46394625
void SceneTreeDock::_local_tree_selected() {
4640-
if (!bool(EDITOR_GET("interface/editors/show_scene_tree_root_selection")) || get_tree()->get_edited_scene_root() != nullptr) {
4641-
scene_tree->show();
4642-
}
46434626
if (remote_tree) {
46444627
remote_tree->hide();
46454628
}
4629+
_update_create_root_dialog_visibility();
46464630
edit_remote->set_pressed(false);
46474631
edit_local->set_pressed(true);
46484632
}
46494633

4634+
void SceneTreeDock::_update_create_root_dialog_visibility() {
4635+
if (edited_scene == nullptr) {
4636+
main_mc->set_theme_type_variation("");
4637+
create_root_dialog->show();
4638+
scene_tree->hide();
4639+
} else {
4640+
main_mc->set_theme_type_variation("NoBorderHorizontalBottom");
4641+
create_root_dialog->hide();
4642+
scene_tree->show();
4643+
}
4644+
}
4645+
46504646
void SceneTreeDock::_update_create_root_dialog(bool p_initializing) {
46514647
if (!p_initializing) {
46524648
EditorSettings::get_singleton()->set_setting("_use_favorites_root_selection", node_shortcuts_toggle->is_pressed());
@@ -5161,7 +5157,6 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec
51615157
add_child(clear_inherit_confirm);
51625158

51635159
set_process_input(true);
5164-
set_process(true);
51655160

51665161
EDITOR_DEF("_use_favorites_root_selection", false);
51675162

editor/docks/scene_tree_dock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ class SceneTreeDock : public EditorDock {
284284
void _local_tree_selected();
285285

286286
void _update_create_root_dialog(bool p_initializing = false);
287+
void _update_create_root_dialog_visibility();
287288
void _favorite_root_selected(const String &p_class);
288289

289290
void _feature_profile_changed();

editor/settings/editor_settings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
562562
#endif
563563
EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/appearance/collapse_main_menu", is_android_editor, "")
564564

565-
_initial_set("interface/editors/show_scene_tree_root_selection", true);
566565
_initial_set("interface/editors/derive_script_globals_by_name", true);
567566
_initial_set("docks/scene_tree/ask_before_revoking_unique_name", true);
568567

@@ -1255,6 +1254,7 @@ void EditorSettings::_handle_setting_compatibility() {
12551254
erase("run/output/always_open_output_on_play");
12561255
erase("run/output/always_close_output_on_stop");
12571256
erase("text_editor/theme/line_spacing"); // See GH-106137.
1257+
erase("interface/editors/show_scene_tree_root_selection");
12581258

12591259
// Handle renamed settings.
12601260
_rename_setting("interface/editor/editor_language", "interface/editor/localization/editor_language");

0 commit comments

Comments
 (0)