diff --git a/core/src/com/unciv/Constants.kt b/core/src/com/unciv/Constants.kt index 6037119483..e8a32c047f 100644 --- a/core/src/com/unciv/Constants.kt +++ b/core/src/com/unciv/Constants.kt @@ -64,6 +64,12 @@ object Constants { const val scienceConversionEffect = "Production to science conversion in cities increased by 33%" - const val ancientEra="Ancient era" - const val futureEra="Future era" + const val ancientEra = "Ancient era" + const val classicalEra = "Classical era" + const val medievalEra = "Medieval era" + const val renaissanceEra = "Renaissance era" + const val industrialEra = "Industrial era" + const val modernEra = "Modern era" + const val informationEra = "Information era" + const val futureEra = "Future era" } \ No newline at end of file diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index beaf1d0469..7b0de76d33 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -524,10 +524,10 @@ class CivilizationInfo { fun getResearchAgreementCost(otherCiv: CivilizationInfo): Int { // https://forums.civfanatics.com/resources/research-agreements-bnw.25568/ val basicGoldCostOfSignResearchAgreement = when(getEra()){ - "Medieval era", "Renaissance era" -> 250 - "Industrial era" -> 300 - "Modern era" -> 350 - "Information era", Constants.futureEra -> 400 + Constants.medievalEra, Constants.renaissanceEra -> 250 + Constants.industrialEra -> 300 + Constants.modernEra -> 350 + Constants.informationEra, Constants.futureEra -> 400 else -> 0 } return (basicGoldCostOfSignResearchAgreement * gameInfo.gameParameters.gameSpeed.modifier).toInt() diff --git a/core/src/com/unciv/models/ruleset/tech/Technology.kt b/core/src/com/unciv/models/ruleset/tech/Technology.kt index 596743cc7a..62d15f7631 100644 --- a/core/src/com/unciv/models/ruleset/tech/Technology.kt +++ b/core/src/com/unciv/models/ruleset/tech/Technology.kt @@ -98,5 +98,5 @@ class Technology { return name } - fun era() = column!!.era + fun era(): String = column!!.era } diff --git a/core/src/com/unciv/ui/newgamescreen/NewGameScreenOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/NewGameScreenOptionsTable.kt index 305cba3e69..0cf25ac3d4 100644 --- a/core/src/com/unciv/ui/newgamescreen/NewGameScreenOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/NewGameScreenOptionsTable.kt @@ -158,8 +158,6 @@ class NewGameScreenOptionsTable(val newGameScreen: NewGameScreen, val updatePlay } private fun addEraSelectBox() { - // The eras enum values are "Medieval" etc. but are shown to the player as "Medieval era".tr() - // because in other languages "Medieval era" is one word val eras = ruleset.technologies.values.map { it.era() }.distinct() addSelectBox("{Starting Era}:", eras, newGameParameters.startingEra) { newGameParameters.startingEra = it } diff --git a/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt index d7fa72eac3..bebf4af183 100644 --- a/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/PolicyPickerScreen.kt @@ -98,7 +98,7 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: CivilizationInfo if(policy.requires!!.isNotEmpty()) policyText += "{Requires} ".tr() + policy.requires!!.joinToString { it.tr() } else - policyText += ("{Unlocked at} {"+policy.branch.era.toString()+" era}").tr() + policyText += ("{Unlocked at} {"+ policy.branch.era+"}").tr() } descriptionLabel.setText(policyText) } diff --git a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt index 21a3c25fce..345592bd6a 100644 --- a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt +++ b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt @@ -114,7 +114,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() { } val friendBonusText = when (otherCiv.getCityStateType()) { - CityStateType.Cultured -> ("Provides [" + (3 * (viewingCiv.getEra().ordinal + 1)).toString() + "] culture at 30 Influence").tr() + CityStateType.Cultured -> ("Provides [" + (3 * (viewingCiv.getEraNumber() + 1)).toString() + "] culture at 30 Influence").tr() CityStateType.Maritime -> "Provides 3 food in capital and 1 food in other cities at 30 Influence".tr() CityStateType.Mercantile -> "Provides 3 happiness at 30 Influence".tr() CityStateType.Militaristic -> "Provides land units every 20 turns at 30 Influence".tr() diff --git a/core/src/com/unciv/ui/utils/ImageGetter.kt b/core/src/com/unciv/ui/utils/ImageGetter.kt index 3fa8174534..d1696afcf5 100644 --- a/core/src/com/unciv/ui/utils/ImageGetter.kt +++ b/core/src/com/unciv/ui/utils/ImageGetter.kt @@ -12,6 +12,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.scenes.scene2d.utils.Drawable import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable import com.badlogic.gdx.utils.Align +import com.sun.xml.internal.bind.v2.runtime.reflect.opt.Const import com.unciv.Constants import com.unciv.models.ruleset.Nation import com.unciv.models.ruleset.Ruleset @@ -221,15 +222,16 @@ object ImageGetter { fun getTechIconGroup(techName: String, circleSize: Float): Group { var techIconColor = Color.WHITE - when (ruleset.technologies[techName]!!.era().name) { - "Ancient" -> techIconColor = colorFromRGB(255, 87, 35) - "Classical" -> techIconColor = colorFromRGB(233, 31, 99) - "Medieval" -> techIconColor = colorFromRGB(157, 39, 176) - "Renaissance" -> techIconColor = colorFromRGB(104, 58, 183) - "Industrial" -> techIconColor = colorFromRGB(63, 81, 182) - "Modern" -> techIconColor = colorFromRGB(33, 150, 243) - "Information" -> techIconColor = colorFromRGB(0, 150, 136) - "Future" -> techIconColor = colorFromRGB(76,176,81) + when (ruleset.technologies[techName]!!.era()) { + Constants.ancientEra -> techIconColor = colorFromRGB(255, 87, 35) + Constants.classicalEra -> techIconColor = colorFromRGB(233, 31, 99) + Constants.medievalEra -> techIconColor = colorFromRGB(157, 39, 176) + Constants.renaissanceEra -> techIconColor = colorFromRGB(104, 58, 183) + Constants.industrialEra -> techIconColor = colorFromRGB(63, 81, 182) + Constants.modernEra -> techIconColor = colorFromRGB(33, 150, 243) + Constants.informationEra -> techIconColor = colorFromRGB(0, 150, 136) + Constants.futureEra -> techIconColor = colorFromRGB(76,176,81) + else -> Color.WHITE } return getImage("TechIcons/$techName").apply { color = techIconColor.lerp(Color.BLACK,0.6f) } .surroundWithCircle(circleSize)