summaryrefslogtreecommitdiff
path: root/tools/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r--tools/editor/editor_node.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 81f9927b92..dee521beb3 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -704,7 +704,7 @@ void EditorNode::_get_scene_metadata(const String& p_file) {
cf.instance();
Error err = cf->load(path);
- if (err!=OK)
+ if (err!=OK || !cf->has_section("editor_states"))
return; //must not exist
List<String> esl;
@@ -740,7 +740,14 @@ void EditorNode::_set_scene_metadata(const String& p_file, int p_idx) {
Ref<ConfigFile> cf;
cf.instance();
- Dictionary md = editor_data.get_edited_scene()==p_idx?editor_data.get_editor_states():editor_data.get_scene_editor_states(p_idx);
+ Dictionary md;
+
+ if (p_idx<0 || editor_data.get_edited_scene()==p_idx) {
+ md = editor_data.get_editor_states();
+ } else {
+ md = editor_data.get_scene_editor_states(p_idx);
+ }
+
List<Variant> keys;
md.get_key_list(&keys);
@@ -2154,7 +2161,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
String existing;
if (extensions.size()) {
String root_name(get_edited_scene()->get_name());
- existing=root_name+".tscn";//+extensions.front()->get().to_lower();
+ existing=root_name+"."+extensions.front()->get().to_lower();
}
file->set_current_path(existing);