use node name as filename when save scene

fix #4723

(cherry picked from commit 9e1ee568a6)
This commit is contained in:
volzhs 2016-05-23 22:27:58 +09:00 committed by Rémi Verschelde
parent 5ad050be2b
commit 4478f8cfbb
2 changed files with 4 additions and 2 deletions

View File

@ -2125,7 +2125,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
String existing; String existing;
if (extensions.size()) { if (extensions.size()) {
existing="new_scene."+extensions.front()->get().to_lower(); String root_name(get_edited_scene()->get_name());
existing=root_name+"."+extensions.front()->get().to_lower();
} }
file->set_current_path(existing); file->set_current_path(existing);

View File

@ -530,7 +530,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
String existing; String existing;
if (extensions.size()) { if (extensions.size()) {
existing="new_scene."+extensions.front()->get().to_lower(); String root_name(tocopy->get_name());
existing=root_name+"."+extensions.front()->get().to_lower();
} }
new_scene_from_dialog->set_current_path(existing); new_scene_from_dialog->set_current_path(existing);