Merge pull request #100430 from shahriarlabib000/save

Always update `.tscn` name when "Save Scene As…" is pressed
This commit is contained in:
Rémi Verschelde 2025-03-14 11:02:30 +01:00
commit dca2bb887a
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -2890,9 +2890,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()));
}