diff options
author | kobewi <kobewi4e@gmail.com> | 2022-10-01 17:32:36 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2022-10-02 22:41:12 +0200 |
commit | 7247606f648507d303ceb28e30731c5b2841b5cf (patch) | |
tree | fbf00dc695909d3502cad6dc3fa2d13caea9412c | |
parent | abf473e2d022accdd5b7aa21d3e0b934b6ec0523 (diff) |
Remember tile source sort between sessions
-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; |