From 4478f8cfbb0b7f182958bb11df3a5f87ca52a3b5 Mon Sep 17 00:00:00 2001 From: volzhs Date: Mon, 23 May 2016 22:27:58 +0900 Subject: [PATCH] use node name as filename when save scene fix #4723 (cherry picked from commit 9e1ee568a6683fcd9a0f97d00da892d47eb5e8ec) --- tools/editor/editor_node.cpp | 3 ++- tools/editor/scene_tree_dock.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 11726512b37..ecb9b30d5f0 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -2125,7 +2125,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { String existing; 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); diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 37a316ae9c8..8b0607429c1 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -530,7 +530,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { String existing; 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);