mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-28 00:20:49 +07:00
Fix "religions to be founded" expanders accumulating (#9214)
* Fix my own dumb blunder re "Religions to be founded" expander * Faith required for next Prophet should be visible
This commit is contained in:
parent
4da4d35a28
commit
2b1f2513fc
@ -155,11 +155,11 @@ class ReligionManager : IsPartOfGameInfoSerialization {
|
||||
return faithCost.toInt()
|
||||
}
|
||||
|
||||
fun canGenerateProphet(): Boolean {
|
||||
fun canGenerateProphet(ignoreFaithAmount: Boolean = false): Boolean {
|
||||
if (!civInfo.gameInfo.isReligionEnabled()) return false // No religion, no prophets
|
||||
if (religion == null || religionState == ReligionState.None) return false // First get a pantheon, then we'll talk about a real religion
|
||||
if (getGreatProphetEquivalent() == null) return false
|
||||
if (storedFaith < faithForNextGreatProphet()) return false
|
||||
if (!ignoreFaithAmount && storedFaith < faithForNextGreatProphet()) return false
|
||||
if (!civInfo.isMajorCiv()) return false
|
||||
if (civInfo.hasUnique(UniqueType.MayNotGenerateGreatProphet)) return false
|
||||
if (religionState == ReligionState.Pantheon && remainingFoundableReligions() == 0) return false // too many have been founded
|
||||
|
@ -41,20 +41,23 @@ class ReligionOverviewTab(
|
||||
private val religionButtonLabel = "Click an icon to see the stats of this religion".toLabel()
|
||||
private val statsTable = Table()
|
||||
private val beliefsTable = Table()
|
||||
private val headerTable = Table()
|
||||
|
||||
override fun getFixedContent() = Table().apply {
|
||||
override fun getFixedContent() = headerTable
|
||||
|
||||
init {
|
||||
civStatsTable.defaults().left().pad(5f)
|
||||
civStatsTable.addCivSpecificStats()
|
||||
|
||||
headerTable.apply {
|
||||
defaults().pad(5f)
|
||||
align(Align.top)
|
||||
|
||||
civStatsTable.defaults().left().pad(5f)
|
||||
civStatsTable.addCivSpecificStats()
|
||||
add(civStatsTable).row()
|
||||
add(religionButtons).row()
|
||||
add(religionButtonLabel)
|
||||
addSeparator()
|
||||
}
|
||||
|
||||
init {
|
||||
defaults().pad(5f)
|
||||
align(Align.top)
|
||||
loadReligionButtons()
|
||||
@ -86,7 +89,7 @@ class ReligionOverviewTab(
|
||||
}
|
||||
add(religionCountExpander).colspan(2).growX().row()
|
||||
|
||||
if (manager.canGenerateProphet()) {
|
||||
if (manager.canGenerateProphet(ignoreFaithAmount = true)) {
|
||||
add("Minimal Faith required for\nthe next [great prophet equivalent]:"
|
||||
.fillPlaceholders(manager.getGreatProphetEquivalent()!!)
|
||||
.toLabel()
|
||||
|
Loading…
Reference in New Issue
Block a user