diff options
author | Franklin Sobrinho <franklin_gs@hotmail.com> | 2016-07-17 16:59:15 -0300 |
---|---|---|
committer | Franklin Sobrinho <franklin_gs@hotmail.com> | 2016-07-17 16:59:15 -0300 |
commit | 7767aa272262d2fdfdb5b8ae50cb3470e993ce74 (patch) | |
tree | 79b61e1cb61f6b37839015fbc2855ab4d2973a99 /tools | |
parent | 4c4ab140b4569f2700517a13b20127eb7542b3ec (diff) |
Fix editor states saving, and remove related error messages
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/editor_node.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 81f9927b92..b56a41eb8f 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); |