Update TileInfo.kt and GameOptionsTable.kt (#2990)

* check if Improvement in question isGreatImprovement before applying buff that only Great Improvements are supposed to have

* update() GameOptionsTable when player selects or unselects mod

some mods might change list of difficulties or eras

* run onChange() when SelectBox is added

so if user select modded difficulty and unselect mod that added it  gameParameters.difficulty will be updated

* add [+stats] from every [baseTerrain or terrainFeature] Nation unique
This commit is contained in:
HadeanLake 2020-08-15 21:20:25 +03:00 committed by GitHub
parent 7efbe6feb2
commit dc1181f3fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -184,6 +184,12 @@ open class TileInfo {
stats.add(Stats.parse(unique.params[0]))
}
if(city!=null) for(unique in city.civInfo.getMatchingUniques("[] from every []")) {
val tileType = unique.params[1]
if (baseTerrain == tileType || terrainFeature == tileType)
stats.add(Stats.parse(unique.params[0]))
}
if (naturalWonder != null) {
val wonder = getNaturalWonder()
stats.add(wonder)
@ -243,7 +249,7 @@ open class TileInfo {
if(city!=null)
for(unique in city.civInfo.getMatchingUniques("[] from every []")) {
if (improvement.name == unique.params[1] || (unique.params[1]=="Great Improvement"))
if (improvement.name == unique.params[1] || (unique.params[1]=="Great Improvement" && improvement.isGreatImprovement()))
stats.add(Stats.parse(unique.params[0]))
}

View File

@ -109,6 +109,7 @@ class GameOptionsTable(val previousScreen: IPreviousScreen, val updatePlayerPick
val selectBox = TranslatedSelectBox(values, initialState, CameraStageBaseScreen.skin)
selectBox.isDisabled = locked
selectBox.onChange { onChange(selectBox.selected.value) }
onChange(selectBox.selected.value)
add(selectBox).fillX().row()
}
@ -190,6 +191,7 @@ class GameOptionsTable(val previousScreen: IPreviousScreen, val updatePlayerPick
if (checkBox.isChecked) gameParameters.mods.add(mod.name)
else gameParameters.mods.remove(mod.name)
reloadRuleset()
update()
var desiredCiv = ""
if (checkBox.isChecked) {
val modNations = RulesetCache[mod.name]?.nations