diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-05-23 15:56:23 +0200 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-05-23 15:56:23 +0200 |
commit | beeed210c904d4cb57df8b72417f004a37ce3b6b (patch) | |
tree | d3b0977d40b6b38e91d4cc1fadfa2647dcf7feb8 | |
parent | 8a6933afb1c8a5e70fbc580a5d06b1f798f760a9 (diff) | |
parent | 9e1ee568a6683fcd9a0f97d00da892d47eb5e8ec (diff) |
Merge pull request #4779 from volzhs/issue-4723
use node name as filename when save scene
-rw-r--r-- | tools/editor/editor_node.cpp | 3 | ||||
-rw-r--r-- | 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 eef148b405..d8a4be5e6d 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -2151,7 +2151,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 7c64ed60b1..803ae59466 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -583,7 +583,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); |