diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-03 14:52:56 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-03 14:52:56 +0200 |
commit | 380fba62720994385408d12da4fc66d91239dc81 (patch) | |
tree | 07b01f533dec459f35f94629a62571b66498d57b /editor | |
parent | 0a2a05052058c4ef5ee3f2fac5b4708408655029 (diff) | |
parent | 7247606f648507d303ceb28e30731c5b2841b5cf (diff) |
Merge pull request #66713 from KoBeWi/remembuh_me
Remember tile source sort between sessions
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/tiles/tile_set_editor.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_editor.h | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index 80a8318bbb..7394288fcd 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -329,6 +329,7 @@ void TileSetEditor::_set_source_sort(int p_sort) { } } _update_sources_list(old_selected); + EditorSettings::get_singleton()->set_project_metadata("editor_metadata", "tile_source_sort", p_sort); } void TileSetEditor::_notification(int p_what) { @@ -648,7 +649,12 @@ void TileSetEditor::edit(Ref<TileSet> p_tile_set) { // Add the listener again. if (tile_set.is_valid()) { tile_set->connect("changed", callable_mp(this, &TileSetEditor::_tile_set_changed)); - _update_sources_list(); + if (first_edit) { + first_edit = false; + _set_source_sort(EditorSettings::get_singleton()->get_project_metadata("editor_metadata", "tile_source_sort", 0)); + } else { + _update_sources_list(); + } _update_patterns_list(); } diff --git a/editor/plugins/tiles/tile_set_editor.h b/editor/plugins/tiles/tile_set_editor.h index 3b9b80dac4..290c53b109 100644 --- a/editor/plugins/tiles/tile_set_editor.h +++ b/editor/plugins/tiles/tile_set_editor.h @@ -83,6 +83,8 @@ private: AtlasMergingDialog *atlas_merging_dialog = nullptr; TileProxiesManagerDialog *tile_proxies_manager_dialog = nullptr; + bool first_edit = true; + // Patterns. ItemList *patterns_item_list = nullptr; Label *patterns_help_label = nullptr; |