diff --git a/core/src/com/unciv/ui/utils/ImageGetter.kt b/core/src/com/unciv/ui/utils/ImageGetter.kt index 4945094e39..3834dfe443 100644 --- a/core/src/com/unciv/ui/utils/ImageGetter.kt +++ b/core/src/com/unciv/ui/utils/ImageGetter.kt @@ -204,6 +204,8 @@ object ImageGetter { return getImage("UnitIcons/$unitName").apply { this.color = color } } + + fun getNationIndicator(nation: Nation, size: Float): IconCircleGroup { val civIconName = if (nation.isCityState()) "CityState" else nation.name return if (nationIconExists(civIconName)) { @@ -217,6 +219,9 @@ object ImageGetter { private fun nationIconExists(nation: String) = imageExists("NationIcons/$nation") fun getNationIcon(nation: String) = getImage("NationIcons/$nation") + + fun wonderImageExists(wonderName: String) = imageExists("WonderImages/$wonderName") + fun getWonderImage(wonderName: String) = getImage("WonderImages/$wonderName") val foodCircleColor = colorFromRGB(129, 199, 132) private val productionCircleColor = Color.BROWN.cpy().lerp(Color.WHITE, 0.5f) diff --git a/core/src/com/unciv/ui/worldscreen/AlertPopup.kt b/core/src/com/unciv/ui/worldscreen/AlertPopup.kt index 5edd9bbcec..1f8b34804e 100644 --- a/core/src/com/unciv/ui/worldscreen/AlertPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/AlertPopup.kt @@ -184,11 +184,27 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu val wonder = worldScreen.gameInfo.ruleSet.buildings[popupAlert.value]!! addGoodSizedLabel(wonder.name) addSeparator() + if(ImageGetter.wonderImageExists(wonder.name)) { // Wonder Graphic exists + if(worldScreen.stage.height * 3 > worldScreen.stage.width * 4) { // Portrait + add(ImageGetter.getWonderImage(wonder.name)) + .width(worldScreen.stage.width / 1.5f) + .height(worldScreen.stage.width / 3) + .row() + } + else { // Landscape (or squareish) + add(ImageGetter.getWonderImage(wonder.name)) + .width(worldScreen.stage.width / 2.5f) + .height(worldScreen.stage.width / 5) + .row() + } + } else { // Fallback + add(ImageGetter.getConstructionImage(wonder.name).surroundWithCircle(100f)).pad(20f).row() + } + val centerTable = Table() - centerTable.add(wonder.quote.toLabel().apply { wrap = true }).width(worldScreen.stage.width / 3) - centerTable.add(ImageGetter.getConstructionImage(wonder.name).surroundWithCircle(100f)).pad(20f) + centerTable.add(wonder.quote.toLabel().apply { wrap = true }).width(worldScreen.stage.width / 3).pad(10f) centerTable.add(wonder.getShortDescription(worldScreen.gameInfo.ruleSet) - .toLabel().apply { wrap = true }).width(worldScreen.stage.width / 3) + .toLabel().apply { wrap = true }).width(worldScreen.stage.width / 3).pad(10f) add(centerTable).row() add(getCloseButton(Constants.close)) }