Merge pull request #32074 from KoBeWi/ninja_reload

Preserve folding when sub-scene is changed
This commit is contained in:
Rémi Verschelde 2019-09-23 10:32:02 +02:00 committed by GitHub
commit fb12f54721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -3133,7 +3133,14 @@ void EditorNode::_clear_undo_history() {
void EditorNode::set_current_scene(int p_idx) {
//Save the folding in case the scene gets reloaded.
if (editor_data.get_scene_path(p_idx) != "")
editor_folding.save_scene_folding(editor_data.get_edited_scene_root(p_idx), editor_data.get_scene_path(p_idx));
if (editor_data.check_and_update_scene(p_idx)) {
if (editor_data.get_scene_path(p_idx) != "")
editor_folding.load_scene_folding(editor_data.get_edited_scene_root(p_idx), editor_data.get_scene_path(p_idx));
call_deferred("_clear_undo_history");
}