Don't display empty civilopedia categories in mods that don't have them

This commit is contained in:
Yair Morgenstern 2022-02-07 10:43:01 +02:00
parent a495e5c8fe
commit efd576e195

View File

@ -221,7 +221,8 @@ class CivilopediaScreen(
buttonTable.defaults().pad(10f) buttonTable.defaults().pad(10f)
var currentX = 10f // = padLeft var currentX = 10f // = padLeft
for (categoryKey in categoryToEntries.keys) { for ((categoryKey, entries) in categoryToEntries) {
if (entries.isEmpty()) continue
val icon = if (categoryKey.headerIcon.isNotEmpty()) ImageGetter.getImage(categoryKey.headerIcon) else null val icon = if (categoryKey.headerIcon.isNotEmpty()) ImageGetter.getImage(categoryKey.headerIcon) else null
val button = IconTextButton(categoryKey.label, icon) val button = IconTextButton(categoryKey.label, icon)
button.addTooltip(categoryKey.key) button.addTooltip(categoryKey.key)