From adfa7a733e8593de06d54aede4d671e192dd9743 Mon Sep 17 00:00:00 2001 From: shahriarlabib000 Date: Sun, 9 Feb 2025 23:14:57 +0600 Subject: [PATCH] update scene name on save as --- editor/editor_node.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index c8b6227d134..cc4cc1fbf42 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2877,9 +2877,12 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { if (!scene->get_scene_file_path().is_empty()) { String path = scene->get_scene_file_path(); + String root_name = EditorNode::adjust_scene_name_casing(scene->get_name()); + String ext = path.get_extension().to_lower(); + path = path.get_base_dir().path_join(root_name + "." + ext); + file->set_current_path(path); if (extensions.size()) { - String ext = path.get_extension().to_lower(); if (extensions.find(ext) == nullptr) { file->set_current_path(path.replacen("." + ext, "." + extensions.front()->get())); }