diff --git a/android/assets/jsons/Translations.json b/android/assets/jsons/Translations.json index ddec66bb6d..3c70bb169e 100644 --- a/android/assets/jsons/Translations.json +++ b/android/assets/jsons/Translations.json @@ -1601,4 +1601,9 @@ "Can speed up construction of a wonder, or construct a Manufactory (+4 production)":{ German:"Kann die Bauzeit eines Wunders verkürzen oder eine Fabrik (+4 Produktion) bauen" } + + // Policy picker screen + "You have entered the [newEra] era!":{} + "[policyBranch] policy branch unlocked!":{} // EG Rationalism policy branch unlocked! + } diff --git a/core/src/com/unciv/logic/civilization/TechManager.kt b/core/src/com/unciv/logic/civilization/TechManager.kt index 51d129019e..87d87d1b41 100644 --- a/core/src/com/unciv/logic/civilization/TechManager.kt +++ b/core/src/com/unciv/logic/civilization/TechManager.kt @@ -5,6 +5,7 @@ import com.badlogic.gdx.graphics.Color import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.Technology import com.unciv.models.gamebasics.unit.Unit +import com.unciv.ui.utils.tr import java.util.* class TechManager { @@ -52,12 +53,21 @@ class TechManager { if (techsInProgress[currentTechnology]!! < getCurrentTechnology().cost) return + val previousEra = civInfo.getEra() + // We finished it! techsInProgress.remove(currentTechnology) techsToResearch.remove(currentTechnology) techsResearched.add(currentTechnology) civInfo.addNotification("Research of [$currentTechnology] has completed!", null, Color.BLUE) + val currentEra = civInfo.getEra() + if(previousEra < currentEra){ + civInfo.addNotification("You have entered the [$currentEra] era!".tr(),null,Color.GOLD) + GameBasics.PolicyBranches.values.filter { it.era==currentEra } + .forEach{civInfo.addNotification("["+it.name+"] policy branch unlocked!".tr(),null,Color.PURPLE)} + } + val revealedResource = GameBasics.TileResources.values.firstOrNull { currentTechnology == it.revealedBy } if (revealedResource != null) { diff --git a/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt index eff2d42870..85b106ffa6 100644 --- a/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt @@ -1,6 +1,7 @@ package com.unciv.ui.pickerscreens import com.badlogic.gdx.graphics.Color +import com.badlogic.gdx.scenes.scene2d.ui.Label import com.badlogic.gdx.scenes.scene2d.ui.TextButton import com.unciv.logic.civilization.CivilizationInfo import com.unciv.logic.civilization.TechManager @@ -33,12 +34,17 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen() init { techsToResearch = ArrayList(civTech.techsToResearch) - val techMatrix = Array>(18) { arrayOfNulls(10) } // Divided into columns, then rows + val columns = 17 + val techMatrix = Array>(columns) { arrayOfNulls(10) } // Divided into columns, then rows for (technology in GameBasics.Technologies.values) { techMatrix[technology.column!!.columnNumber][technology.row - 1] = technology } + val eras = ArrayList