Added UI to show what cities are holy cities to the player (#5039)

This commit is contained in:
Xander Lenstra 2021-08-31 15:55:29 +02:00 committed by GitHub
parent a77e8015e1
commit 9450fac423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 5 deletions

View File

@ -1033,11 +1033,13 @@ Follow [belief] =
Religions and Beliefs =
Majority Religion: [name] =
+ [amount] pressure =
Holy city of: [religionName] =
Pressure =
# Religion overview screen
Religion Name: =
Founding Civ: =
Holy City: =
Cities following this religion: =
Click an icon to see the stats of this religion =

View File

@ -101,6 +101,11 @@ class CityStatsTable(val cityScreen: CityScreen): Table() {
setPosition(stage.width - CityScreen.posFromEdge, stage.height - CityScreen.posFromEdge, Align.topRight)
}
) {
if (cityInfo.religion.religionThisIsTheHolyCityOf != null) {
// I want this to be centered, but `.center()` doesn't seem to do anything,
// regardless of where I place it :(
it.add("Holy city of: [${cityInfo.religion.religionThisIsTheHolyCityOf!!}]".toLabel()).center().colspan(2).pad(5f).row()
}
it.add(getReligionsTable()).colspan(2).pad(5f)
}

View File

@ -71,15 +71,26 @@ class ReligionOverviewTable(
beliefsTable.add(createBeliefDescription(belief)).pad(10f).row()
}
statsTable.add("Religion Name:".tr())
statsTable.add(religion.name.tr()).pad(5f).row()
statsTable.add("Founding Civ:".tr())
statsTable.add("Religion Name:".toLabel())
statsTable.add(religion.name.toLabel()).pad(5f).row()
statsTable.add("Founding Civ:".toLabel())
val foundingCivName =
if (viewingPlayer.knows(religion.foundingCivName) || viewingPlayer.civName == religion.foundingCivName)
religion.foundingCivName
else "???"
statsTable.add(foundingCivName.tr()).pad(5f).row()
statsTable.add("Cities following this religion:".tr())
statsTable.add(foundingCivName.toLabel()).pad(5f).row()
if (religion.isMajorReligion()) {
val holyCity = gameInfo.getCities().firstOrNull { it.religion.religionThisIsTheHolyCityOf == religion.name }
if (holyCity != null) {
statsTable.add("Holy City:".toLabel())
val cityName =
if (viewingPlayer.exploredTiles.contains(holyCity.getCenterTile().position))
holyCity.name
else "???"
statsTable.add(cityName.toLabel()).pad(5f).row()
}
}
statsTable.add("Cities following this religion:".toLabel())
statsTable.add(gameInfo.getCivilization(religion.foundingCivName).religionManager.numberOfCitiesFollowingThisReligion().toString()).pad(5f).row()
val minWidth = min(statsTable.minWidth, beliefsTable.minWidth) + 5f