Improve editor state persistence

This commit is contained in:
Hendrik Brucker
2023-05-11 04:17:03 +02:00
parent 74c34aed38
commit dc46163b12
20 changed files with 557 additions and 259 deletions

View File

@ -300,7 +300,7 @@ void EditorData::get_editor_breakpoints(List<String> *p_breakpoints) {
}
}
Dictionary EditorData::get_editor_states() const {
Dictionary EditorData::get_editor_plugin_states() const {
Dictionary metadata;
for (int i = 0; i < editor_plugins.size(); i++) {
Dictionary state = editor_plugins[i]->get_state();
@ -319,7 +319,7 @@ Dictionary EditorData::get_scene_editor_states(int p_idx) const {
return es.editor_states;
}
void EditorData::set_editor_states(const Dictionary &p_states) {
void EditorData::set_editor_plugin_states(const Dictionary &p_states) {
if (p_states.is_empty()) {
for (EditorPlugin *ep : editor_plugins) {
ep->clear();
@ -891,7 +891,7 @@ void EditorData::save_edited_scene_state(EditorSelection *p_selection, EditorSel
es.selection = p_selection->get_full_selected_node_list();
es.history_current = p_history->current_elem_idx;
es.history_stored = p_history->history;
es.editor_states = get_editor_states();
es.editor_states = get_editor_plugin_states();
es.custom_state = p_custom;
}
@ -907,7 +907,7 @@ Dictionary EditorData::restore_edited_scene_state(EditorSelection *p_selection,
for (Node *E : es.selection) {
p_selection->add_node(E);
}
set_editor_states(es.editor_states);
set_editor_plugin_states(es.editor_states);
return es.custom_state;
}