1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

update scene name on save as

This commit is contained in:
shahriarlabib000
2025-02-09 23:14:57 +06:00
parent 36d90c73a8
commit adfa7a733e

View File

@@ -2877,9 +2877,12 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
if (!scene->get_scene_file_path().is_empty()) { if (!scene->get_scene_file_path().is_empty()) {
String path = scene->get_scene_file_path(); 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); file->set_current_path(path);
if (extensions.size()) { if (extensions.size()) {
String ext = path.get_extension().to_lower();
if (extensions.find(ext) == nullptr) { if (extensions.find(ext) == nullptr) {
file->set_current_path(path.replacen("." + ext, "." + extensions.front()->get())); file->set_current_path(path.replacen("." + ext, "." + extensions.front()->get()));
} }