diff --git a/core/src/com/unciv/Constants.kt b/core/src/com/unciv/Constants.kt index 5ece4d7594..b8b4ef21b2 100644 --- a/core/src/com/unciv/Constants.kt +++ b/core/src/com/unciv/Constants.kt @@ -9,7 +9,12 @@ object Constants { const val impassable = "Impassable" const val ocean = "Ocean" + + /** The "Coast" _terrain_ */ const val coast = "Coast" + /** The "Coastal" terrain _filter_ */ + const val coastal = "Coastal" + const val mountain = "Mountain" const val hill = "Hill" const val plains = "Plains" @@ -24,8 +29,12 @@ object Constants { const val ice = "Ice" val vegetation = arrayOf(forest, jungle) val sea = arrayOf(ocean, coast) - + + // Note the difference in case. **Not** interchangeable! + /** The "Fresh water" terrain _unique_ */ const val freshWater = "Fresh water" + /** The "Fresh Water" terrain _filter_ */ + const val freshWaterFilter = "Fresh Water" const val barbarianEncampment = "Barbarian encampment" @@ -41,7 +50,7 @@ object Constants { const val futureTech = "Future Tech" // Easter egg name. Hopefully is to hopefully avoid conflicts when later players can name their own religions. // This religion name should never be displayed. - const val noReligionName = "The religion of TheLegend27" + const val noReligionName = "The religion of TheLegend27" const val cancelImprovementOrder = "Cancel improvement order" const val tutorialPopupNamePrefix = "Tutorial: " @@ -53,7 +62,6 @@ object Constants { const val barbarians = "Barbarians" const val spectator = "Spectator" - const val custom = "Custom" const val rising = "Rising" const val lowering = "Lowering" diff --git a/core/src/com/unciv/logic/BackwardCompatibility.kt b/core/src/com/unciv/logic/BackwardCompatibility.kt index 8d6afc0286..fe07f8c13a 100644 --- a/core/src/com/unciv/logic/BackwardCompatibility.kt +++ b/core/src/com/unciv/logic/BackwardCompatibility.kt @@ -5,6 +5,7 @@ import com.unciv.logic.city.PerpetualConstruction import com.unciv.logic.civilization.TechManager import com.unciv.logic.civilization.diplomacy.DiplomacyFlags import com.unciv.logic.civilization.diplomacy.DiplomacyManager +import com.unciv.models.ruleset.ModOptions import com.unciv.models.ruleset.Ruleset /** @@ -141,4 +142,11 @@ object BackwardCompatibility { } } + /** Move max XP from barbarians to new home */ + fun ModOptions.updateDeprecations() { + if (maxXPfromBarbarians != 30) { + constants.maxXPfromBarbarians = maxXPfromBarbarians + maxXPfromBarbarians = 30 + } + } } diff --git a/core/src/com/unciv/logic/GameStarter.kt b/core/src/com/unciv/logic/GameStarter.kt index 12e196d42b..a5c2e64f08 100644 --- a/core/src/com/unciv/logic/GameStarter.kt +++ b/core/src/com/unciv/logic/GameStarter.kt @@ -33,7 +33,7 @@ object GameStarter { // In the case where we used to have an extension mod, and now we don't, we cannot "unselect" it in the UI. // We need to remove the dead mods so there aren't problems later. gameSetupInfo.gameParameters.mods.removeAll { !RulesetCache.containsKey(it) } - + // [TEMPORARY] If we have a base ruleset in the mod list, we make that our base ruleset val baseRulesetInMods = gameSetupInfo.gameParameters.mods.firstOrNull { RulesetCache[it]!!.modOptions.isBaseRuleset } if (baseRulesetInMods != null) @@ -41,7 +41,7 @@ object GameStarter { if (!RulesetCache.containsKey(gameSetupInfo.gameParameters.baseRuleset)) gameSetupInfo.gameParameters.baseRuleset = RulesetCache.getVanillaRuleset().name - + gameInfo.gameParameters = gameSetupInfo.gameParameters val ruleset = RulesetCache.getComplexRuleset(gameInfo.gameParameters.mods, gameInfo.gameParameters.baseRuleset) val mapGen = MapGenerator(ruleset) @@ -226,10 +226,12 @@ object GameStarter { val presetMajors = Stack() presetMajors.addAll(availableCivNames.filter { it in civNamesWithStartingLocations }) - for (player in newGameParameters.players.sortedBy { it.chosenCiv == "Random" }) { - val nationName = if (player.chosenCiv != "Random") player.chosenCiv - else if (presetMajors.isNotEmpty()) presetMajors.pop() - else availableCivNames.pop() + for (player in newGameParameters.players.sortedBy { it.chosenCiv == Constants.random }) { + val nationName = when { + player.chosenCiv != Constants.random -> player.chosenCiv + presetMajors.isNotEmpty() -> presetMajors.pop() + else -> availableCivNames.pop() + } availableCivNames.remove(nationName) // In case we got it from a map preset val playerCiv = CivilizationInfo(nationName) @@ -315,7 +317,7 @@ object GameStarter { civ.placeUnitNearTile(startingLocation.position, unitName) } - // Determine starting units based on starting era + // Determine starting units based on starting era startingUnits = ruleSet.eras[startingEra]!!.getStartingUnits().toMutableList() eraUnitReplacement = ruleSet.eras[startingEra]!!.startingMilitaryUnit @@ -409,7 +411,7 @@ object GameStarter { when { civ.civName in tileMap.startingLocationsByNation -> 1 // harshest requirements civ.nation.startBias.any { it in tileMap.naturalWonders } -> 2 - civ.nation.startBias.contains("Tundra") -> 3 // Tundra starts are hard to find, so let's do them first + civ.nation.startBias.contains(Constants.tundra) -> 3 // Tundra starts are hard to find, so let's do them first civ.nation.startBias.isNotEmpty() -> 4 // less harsh else -> 5 // no requirements } diff --git a/core/src/com/unciv/logic/map/MapParameters.kt b/core/src/com/unciv/logic/map/MapParameters.kt index dc91db1a28..ef52d98a45 100644 --- a/core/src/com/unciv/logic/map/MapParameters.kt +++ b/core/src/com/unciv/logic/map/MapParameters.kt @@ -1,11 +1,9 @@ package com.unciv.logic.map -import com.unciv.Constants import com.unciv.logic.HexMath.getEquivalentHexagonalRadius import com.unciv.logic.HexMath.getEquivalentRectangularSize import com.unciv.logic.HexMath.getNumberOfTilesInHexagon import com.unciv.models.metadata.BaseRuleset -import com.unciv.models.ruleset.RulesetCache /* Predefined Map Sizes - ours are a little lighter than the original values. For reference those are: @@ -21,7 +19,14 @@ enum class MapSize(val radius: Int, val width: Int, val height: Int) { Small(15, 33, 21), Medium(20, 44, 29), Large(30, 66, 43), - Huge(40, 87, 57) + Huge(40, 87, 57); + + companion object { + /** Not a predefined [MapSize] enum value, but a String + * used in [MapParameters.mapSize] to indicate user-defined dimensions. + * Do not mistake for [MapType.custom]. */ + const val custom = "Custom" + } } class MapSizeNew { @@ -54,12 +59,12 @@ class MapSizeNew { } constructor(radius: Int) { - name = Constants.custom + name = MapSize.custom setNewRadius(radius) } constructor(width: Int, height: Int) { - name = Constants.custom + name = MapSize.custom this.width = width this.height = height this.radius = getEquivalentHexagonalRadius(width, height) @@ -77,7 +82,7 @@ class MapSizeNew { * @return null if size was acceptable, otherwise untranslated reason message */ fun fixUndesiredSizes(worldWrap: Boolean): String? { - if (name != Constants.custom) return null // predefined sizes are OK + if (name != MapSize.custom) return null // predefined sizes are OK // world-wrap mas must always have an even width, so round down silently if (worldWrap && width % 2 != 0 ) width-- // check for any bad condition and bail if none of them @@ -113,7 +118,7 @@ class MapSizeNew { } // For debugging and MapGenerator console output - override fun toString() = if (name == Constants.custom) "${width}x${height}" else name + override fun toString() = if (name == MapSize.custom) "${width}x${height}" else name } object MapShape { @@ -159,7 +164,7 @@ class MapParameters { /** This is used mainly for the map editor, so you can continue editing a map under the same ruleset you started with */ var mods = LinkedHashSet() - var baseRuleset = BaseRuleset.Civ_V_GnK.fullName // Hardcoded as the Rulesetcache is not yet initialized when starting up + var baseRuleset = BaseRuleset.Civ_V_GnK.fullName // Hardcoded as the Rulesetcache is not yet initialized when starting up /** Unciv Version of creation for support cases */ var createdWithVersion = "" @@ -227,7 +232,7 @@ class MapParameters { override fun toString() = sequence { if (name.isNotEmpty()) yield("\"$name\" ") yield("(") - if (mapSize.name != Constants.custom) yield(mapSize.name + " ") + if (mapSize.name != MapSize.custom) yield(mapSize.name + " ") if (worldWrap) yield("wrapped ") yield(shape) yield(" " + displayMapDimensions()) @@ -237,7 +242,7 @@ class MapParameters { yield("$elevationExponent/$temperatureExtremeness/$resourceRichness/$vegetationRichness/") yield("$rareFeaturesRichness/$maxCoastExtension/$tilesPerBiomeArea/$waterThreshold") }.joinToString("", postfix = ")") - + fun numberOfTiles() = if (shape == MapShape.hexagonal) { 1 + 3 * mapSize.radius * (mapSize.radius - 1) diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index bd1d4c3265..e6a3a95959 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -1085,7 +1085,7 @@ class MapUnit { // todo: unit filters should be adjectives, fitting "[filterType] units" // This means converting "wounded units" to "Wounded", "Barbarians" to "Barbarian" "Wounded", "wounded units" -> health < 100 - "Barbarians", "Barbarian" -> civInfo.isBarbarian() + Constants.barbarians, "Barbarian" -> civInfo.isBarbarian() "City-State" -> civInfo.isCityState() "Embarked" -> isEmbarked() "Non-City" -> true diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index 292d03ffa1..08e724cff6 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -59,7 +59,7 @@ open class TileInfo { lateinit var baseTerrain: String var terrainFeatures: List = listOf() private set - + @Transient var terrainFeatureObjects: List = listOf() private set @@ -227,7 +227,7 @@ open class TileInfo { else -> tileOwner.getDiplomacyManager(civInfo).isConsideredFriendlyTerritory() } } - + fun isEnemyTerritory(civInfo: CivilizationInfo): Boolean { val tileOwner = getOwner() ?: return false return civInfo.isAtWarWith(tileOwner) @@ -438,7 +438,7 @@ open class TileInfo { stats.add(unique.stats) } } - + for (unique in city.getMatchingUniques(UniqueType.AllStatsPercentFromObject, conditionalState)) { if (improvement.matchesFilter(unique.params[1])) stats.timesInPlace(unique.params[0].toPercent()) @@ -556,7 +556,7 @@ open class TileInfo { baseTerrain -> true "Water" -> isWater "Land" -> isLand - "Coastal" -> isCoastalTile() + Constants.coastal -> isCoastalTile() "River" -> isAdjacentToRiver() naturalWonder -> true "Open terrain" -> !isRoughTerrain() @@ -568,7 +568,7 @@ open class TileInfo { "Water resource" -> isWater && observingCiv != null && hasViewableResource(observingCiv) "Natural Wonder" -> naturalWonder != null "Featureless" -> terrainFeatures.isEmpty() - "Fresh Water" -> isAdjacentTo(Constants.freshWater) + Constants.freshWaterFilter -> isAdjacentTo(Constants.freshWater) else -> { if (terrainFeatures.contains(filter)) return true if (getAllTerrains().any { it.hasUnique(filter) }) return true @@ -845,7 +845,7 @@ open class TileInfo { fun stripUnits() { for (unit in this.getUnits()) removeUnit(unit) } - + fun setTileResource(newResource: TileResource, majorDeposit: Boolean = false) { resource = newResource.name @@ -873,15 +873,15 @@ open class TileInfo { } } } - + fun setTerrainFeatures(terrainFeatureList:List){ terrainFeatures = terrainFeatureList terrainFeatureObjects = terrainFeatureList.mapNotNull { ruleset.terrains[it] } } - + fun addTerrainFeature(terrainFeature:String) = setTerrainFeatures(ArrayList(terrainFeatures).apply { add(terrainFeature) }) - + fun removeTerrainFeature(terrainFeature: String) = setTerrainFeatures(ArrayList(terrainFeatures).apply { remove(terrainFeature) }) diff --git a/core/src/com/unciv/logic/map/mapgenerator/NaturalWonderGenerator.kt b/core/src/com/unciv/logic/map/mapgenerator/NaturalWonderGenerator.kt index b95514dd87..7a299470a6 100644 --- a/core/src/com/unciv/logic/map/mapgenerator/NaturalWonderGenerator.kt +++ b/core/src/com/unciv/logic/map/mapgenerator/NaturalWonderGenerator.kt @@ -180,7 +180,7 @@ class NaturalWonderGenerator(val ruleset: Ruleset, val randomness: MapGeneration "Elevated" -> baseTerrain == Constants.mountain || isHill() "Water" -> isWater "Land" -> isLand - "Hill" -> isHill() + Constants.hill -> isHill() naturalWonder -> true in allTerrainFeatures -> getLastTerrain().name == filter else -> baseTerrain == filter diff --git a/core/src/com/unciv/models/ruleset/Ruleset.kt b/core/src/com/unciv/models/ruleset/Ruleset.kt index 457ab00360..4c6140d694 100644 --- a/core/src/com/unciv/models/ruleset/Ruleset.kt +++ b/core/src/com/unciv/models/ruleset/Ruleset.kt @@ -5,6 +5,7 @@ import com.badlogic.gdx.files.FileHandle import com.badlogic.gdx.graphics.Color import com.unciv.Constants import com.unciv.JsonParser +import com.unciv.logic.BackwardCompatibility.updateDeprecations import com.unciv.logic.UncivShowableException import com.unciv.models.Counter import com.unciv.models.ModConstants @@ -52,7 +53,7 @@ class ModOptions : IHasUniques { var modSize = 0 @Deprecated("As of 3.18.15") - val maxXPfromBarbarians = 30 + var maxXPfromBarbarians = 30 override var uniques = ArrayList() @@ -166,8 +167,7 @@ class Ruleset { if (modOptionsFile.exists()) { try { modOptions = jsonParser.getFromJson(ModOptions::class.java, modOptionsFile) - if (modOptions.maxXPfromBarbarians != 30) - modOptions.constants.maxXPfromBarbarians = modOptions.constants.maxXPfromBarbarians + modOptions.updateDeprecations() } catch (ex: Exception) {} modOptions.uniqueObjects = modOptions.uniques.map { Unique(it, UniqueTarget.ModOptions) } modOptions.uniqueMap = modOptions.uniqueObjects.groupBy { it.placeholderText } diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt index c0561dd27a..09f5a42a4a 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt @@ -33,7 +33,7 @@ enum class UniqueParameterType(var parameterName:String) { }, MapUnitFilter("mapUnitFilter") { - private val knownValues = setOf("Wounded", "Barbarians", "City-State", "Embarked", "Non-City") + private val knownValues = setOf("Wounded", Constants.barbarians, "City-State", "Embarked", "Non-City") override fun getErrorSeverity(parameterText: String, ruleset: Ruleset): UniqueType.UniqueComplianceErrorSeverity? { if ('{' in parameterText) // "{filter} {filter}" for and logic @@ -138,9 +138,9 @@ enum class UniqueParameterType(var parameterName:String) { // TerrainFilter("terrainFilter") { private val knownValues = setOf("All", - "Coastal", "River", "Open terrain", "Rough terrain", "Water resource", + Constants.coastal, "River", "Open terrain", "Rough terrain", "Water resource", "Foreign Land", "Foreign", "Friendly Land", "Friendly", "Enemy Land", "Enemy", - "Featureless", "Fresh Water", "Natural Wonder") + "Featureless", Constants.freshWaterFilter, "Natural Wonder") override fun getErrorSeverity(parameterText: String, ruleset: Ruleset): UniqueType.UniqueComplianceErrorSeverity? { if (parameterText in knownValues) return null diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index 65508c4d61..86fa8ca3bb 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -1,5 +1,6 @@ package com.unciv.models.ruleset.unique +import com.unciv.Constants import com.unciv.models.ruleset.Ruleset import com.unciv.models.translations.getPlaceholderParameters import com.unciv.models.translations.getPlaceholderText @@ -253,7 +254,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: TriggersCulturalVictory("Triggers a Cultural Victory upon completion", UniqueTarget.Global), BetterDefensiveBuildings("[amount]% City Strength from defensive buildings", UniqueTarget.Global), - TileImprovementTime("[amount]% tile improvement construction time", UniqueTarget.Global, UniqueTarget.Unit), PercentGoldFromTradeMissions("[amount]% Gold from Great Merchant trade missions", UniqueTarget.Global), // Todo: Lowercase the 'U' of 'Units' in this unique @@ -275,6 +275,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: EmbarkAndEnterOcean("Can embark and move over Coasts and Oceans immediately", UniqueTarget.Global), PopulationLossFromNukes("Population loss from nuclear attacks [amount]% [cityFilter]", UniqueTarget.Global), + NaturalReligionSpreadStrength("[amount]% Natural religion spread [cityFilter]", UniqueTarget.FollowerBelief, UniqueTarget.Global), ReligionSpreadDistance("Religion naturally spreads to cities [amount] tiles away", UniqueTarget.Global, UniqueTarget.FollowerBelief), @@ -360,7 +361,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: // Todo nuclear weapon and spaceship enabling requires a rethink. // This doesn't actually directly affect anything, the "Only available " of the nuclear weapons does that. EnablesNuclearWeapons("Enables nuclear weapon", UniqueTarget.Building), - MustBeOn("Must be on [terrainFilter]", UniqueTarget.Building), MustNotBeOn("Must not be on [terrainFilter]", UniqueTarget.Building), @@ -542,7 +542,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: ResistsNukes("Resistant to nukes", UniqueTarget.Terrain), DestroyableByNukes("Can be destroyed by nukes", UniqueTarget.Terrain), - FreshWater("Fresh water", UniqueTarget.Terrain), + FreshWater(Constants.freshWater, UniqueTarget.Terrain), RoughTerrain("Rough terrain", UniqueTarget.Terrain), /////// Resource uniques diff --git a/core/src/com/unciv/ui/mapeditor/MapEditorOptionsTable.kt b/core/src/com/unciv/ui/mapeditor/MapEditorOptionsTable.kt index 80cf912291..89c25164bb 100644 --- a/core/src/com/unciv/ui/mapeditor/MapEditorOptionsTable.kt +++ b/core/src/com/unciv/ui/mapeditor/MapEditorOptionsTable.kt @@ -325,7 +325,7 @@ class MapEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(BaseScr if (terrain.type == TerrainType.TerrainFeature) { tileInfo.baseTerrain = when { terrain.occursOn.isNotEmpty() -> terrain.occursOn.first() - else -> "Grassland" + else -> Constants.grassland } tileInfo.addTerrainFeature(terrain.name) } else tileInfo.baseTerrain = terrain.name diff --git a/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt b/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt index f9ae7f7151..9cb72a1918 100644 --- a/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt @@ -5,7 +5,6 @@ import com.badlogic.gdx.scenes.scene2d.ui.CheckBox import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.scenes.scene2d.ui.TextField import com.badlogic.gdx.scenes.scene2d.ui.TextField.TextFieldFilter.DigitsOnlyFilter -import com.unciv.Constants import com.unciv.UncivGame import com.unciv.logic.map.* import com.unciv.ui.utils.* @@ -39,7 +38,7 @@ class MapParametersTable( // Keep references (in the key) and settings value getters (in the value) of the 'advanced' sliders // in a HashMap for reuse later - in the reset to defaults button. Better here as field than as closure. // A HashMap indexed on a Widget is problematic, as it does not define its own hashCode and equals - // overrides nor is a Widget a data class. Seems to work anyway. + // overrides nor is a Widget a data class. Seems to work anyway. private val advancedSliders = HashMapFloat>() init { @@ -97,7 +96,7 @@ class MapParametersTable( } private fun addWorldSizeTable() { - val mapSizes = MapSize.values().map { it.name } + listOf(Constants.custom) + val mapSizes = MapSize.values().map { it.name } + listOf(MapSize.custom) worldSizeSelectBox = TranslatedSelectBox(mapSizes, mapParameters.mapSize.name, skin) worldSizeSelectBox.onChange { updateWorldSizeTable() } @@ -155,9 +154,9 @@ class MapParametersTable( private fun updateWorldSizeTable() { customWorldSizeTable.clear() - if (mapParameters.shape == MapShape.hexagonal && worldSizeSelectBox.selected.value == Constants.custom) + if (mapParameters.shape == MapShape.hexagonal && worldSizeSelectBox.selected.value == MapSize.custom) customWorldSizeTable.add(hexagonalSizeTable).grow().row() - else if (mapParameters.shape == MapShape.rectangular && worldSizeSelectBox.selected.value == Constants.custom) + else if (mapParameters.shape == MapShape.rectangular && worldSizeSelectBox.selected.value == MapSize.custom) customWorldSizeTable.add(rectangularSizeTable).grow().row() else mapParameters.mapSize = MapSizeNew(worldSizeSelectBox.selected.value) diff --git a/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt b/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt index 4f087faea9..4056a82a96 100644 --- a/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt @@ -128,7 +128,7 @@ class PlayerPickerTable( * @param player for which [Table] is generated * @return [Table] containing the all the elements */ - fun getPlayerTable(player: Player): Table { + private fun getPlayerTable(player: Player): Table { val playerTable = Table() playerTable.pad(5f) playerTable.background = ImageGetter.getBackground(ImageGetter.getBlue().darken(0.8f)) @@ -274,7 +274,7 @@ private class NationPickerPopup( add(nationDetailsScroll).size(civBlocksWidth + 10f, partHeight) // Same here, see above val randomNation = Nation().apply { - name = "Random" + name = Constants.random innerColor = listOf(255, 255, 255) outerColor = listOf(0, 0, 0) setTransients() @@ -285,7 +285,7 @@ private class NationPickerPopup( if (spectator != null) nations += spectator nations += playerPicker.getAvailablePlayerCivs(player.chosenCiv) - .sortedWith(compareBy(UncivGame.Current.settings.getCollatorFromLocale(), { it.name.tr() })) + .sortedWith(compareBy(UncivGame.Current.settings.getCollatorFromLocale()) { it.name.tr() }) var nationListScrollY = 0f var currentY = 0f diff --git a/core/src/com/unciv/ui/pickerscreens/ModManagementScreen.kt b/core/src/com/unciv/ui/pickerscreens/ModManagementScreen.kt index 95943d2963..5ef72982c1 100644 --- a/core/src/com/unciv/ui/pickerscreens/ModManagementScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/ModManagementScreen.kt @@ -10,6 +10,7 @@ import com.badlogic.gdx.utils.Align import com.badlogic.gdx.utils.Json import com.unciv.JsonParser import com.unciv.MainMenuScreen +import com.unciv.logic.BackwardCompatibility.updateDeprecations import com.unciv.models.ruleset.ModOptions import com.unciv.models.ruleset.Ruleset import com.unciv.models.ruleset.RulesetCache @@ -422,6 +423,7 @@ class ModManagementScreen( modOptions.lastUpdated = repo.pushed_at modOptions.author = repo.owner.login modOptions.modSize = repo.size + modOptions.updateDeprecations() Json().toJson(modOptions, modOptionsFile) } diff --git a/core/src/com/unciv/ui/worldscreen/AlertPopup.kt b/core/src/com/unciv/ui/worldscreen/AlertPopup.kt index 3aa9b72eb2..7df4039a45 100644 --- a/core/src/com/unciv/ui/worldscreen/AlertPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/AlertPopup.kt @@ -306,7 +306,7 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu val responseTable = Table() responseTable.defaults() .pad(0f, 30f) // Small buttons, plenty of pad so we don't fat-finger it - responseTable.add(getCloseButton("Yes", 'y') { + responseTable.add(getCloseButton(Constants.yes, 'y') { // Return it to original owner val unitName = capturedUnit.baseUnit.name capturedUnit.destroy() @@ -325,7 +325,7 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu .setModifier(DiplomaticModifiers.ReturnedCapturedUnits, 20f) } }) - responseTable.add(getCloseButton("No", 'n') { + responseTable.add(getCloseButton(Constants.no, 'n') { // Take it for ourselves // Settlers become workers at this point if (capturedUnit.hasUnique(UniqueType.FoundCity)) {