mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-10 15:59:33 +07:00
Wonder build screens redux (#4509)
* wonder splash screens * wonder splash screens atlas * removed pyramids file, add portrait code * restore atlas
This commit is contained in:
@ -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)
|
||||
|
@ -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))
|
||||
}
|
||||
|
Reference in New Issue
Block a user