From 69dd7ec7b6de08d3dc95a1272361a83e2acee414 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 6 Oct 2019 19:46:22 +0300 Subject: [PATCH] Resolved #1157 - Added popup for entering Golden Age --- core/src/com/unciv/logic/civilization/GoldenAgeManager.kt | 1 + core/src/com/unciv/logic/civilization/PopupAlert.kt | 1 + core/src/com/unciv/ui/worldscreen/AlertPopup.kt | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/core/src/com/unciv/logic/civilization/GoldenAgeManager.kt b/core/src/com/unciv/logic/civilization/GoldenAgeManager.kt index d714361d3a..cc674a70f6 100644 --- a/core/src/com/unciv/logic/civilization/GoldenAgeManager.kt +++ b/core/src/com/unciv/logic/civilization/GoldenAgeManager.kt @@ -33,6 +33,7 @@ class GoldenAgeManager{ turnsToGoldenAge *= civInfo.gameInfo.gameParameters.gameSpeed.getModifier() turnsLeftForCurrentGoldenAge += turnsToGoldenAge.toInt() civInfo.addNotification("You have entered a golden age!", null, Color.GOLD) + civInfo.popupAlerts.add(PopupAlert(AlertType.GoldenAge,"")) } fun endTurn(happiness: Int) { diff --git a/core/src/com/unciv/logic/civilization/PopupAlert.kt b/core/src/com/unciv/logic/civilization/PopupAlert.kt index 339c9e1b55..a6045a343b 100644 --- a/core/src/com/unciv/logic/civilization/PopupAlert.kt +++ b/core/src/com/unciv/logic/civilization/PopupAlert.kt @@ -12,6 +12,7 @@ enum class AlertType{ CitiesSettledNearOtherCiv, DemandToStopSettlingCitiesNear, CitySettledNearOtherCivDespiteOurPromise, + GoldenAge, } class PopupAlert { diff --git a/core/src/com/unciv/ui/worldscreen/AlertPopup.kt b/core/src/com/unciv/ui/worldscreen/AlertPopup.kt index 55c4f26dc1..f16fa67a8c 100644 --- a/core/src/com/unciv/ui/worldscreen/AlertPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/AlertPopup.kt @@ -139,6 +139,12 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu add(centerTable).row() add(getCloseButton("Close")) } + AlertType.GoldenAge -> { + addGoodSizedLabel("GOLDEN AGE") + addSeparator() + addGoodSizedLabel("Your citizens have been happy with your rule for so long that the empire enters a Golden Age!").row() + add(getCloseButton("Close")) + } } open() worldScreen.alertPopupIsOpen = true