From dc1181f3fd0aaa419b2598069b1be4a85e1d8748 Mon Sep 17 00:00:00 2001 From: HadeanLake <69697985+HadeanLake@users.noreply.github.com> Date: Sat, 15 Aug 2020 21:20:25 +0300 Subject: [PATCH] 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 --- core/src/com/unciv/logic/map/TileInfo.kt | 8 +++++++- core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index 15a745b400..9733121a2b 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -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])) } diff --git a/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt index 888275e6d7..5bcfa74b07 100644 --- a/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt @@ -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