Merge pull request #80754 from KoBeWi/TileSetImprovementsCollectionSource

Improve scene tiles workflow
This commit is contained in:
Rémi Verschelde 2023-08-28 15:03:26 +02:00
commit bcbe1fd5e0
No known key found for this signature in database
GPG key ID: C3336907360768E1
6 changed files with 42 additions and 7 deletions

View file

@ -177,7 +177,11 @@ void TileMapEditorTilesPlugin::_update_tile_set_sources_list() {
if (scene_collection_source) {
texture = tiles_bottom_panel->get_theme_icon(SNAME("PackedScene"), SNAME("EditorIcons"));
if (item_text.is_empty()) {
item_text = vformat(TTR("Scene Collection Source (ID: %d)"), source_id);
if (scene_collection_source->get_scene_tiles_count() > 0) {
item_text = vformat(TTR("Scene Collection Source (ID: %d)"), source_id);
} else {
item_text = vformat(TTR("Empty Scene Collection Source (ID: %d)"), source_id);
}
}
}
@ -398,6 +402,10 @@ void TileMapEditorTilesPlugin::_update_scenes_collection_view() {
scene_tiles_list->select(item_index, false);
}
}
if (scene_tiles_list->get_item_count() == 0) {
scene_tiles_list->add_item(TTR("The selected scene collection source has no scenes. Add scenes in the TileSet bottom tab."));
scene_tiles_list->set_item_disabled(-1, true);
}
// Icon size update.
int int_size = int(EDITOR_GET("filesystem/file_dialog/thumbnail_size")) * EDSCALE;