Resolved #1157 - Added popup for entering Golden Age

This commit is contained in:
Yair Morgenstern 2019-10-06 19:46:22 +03:00
parent 4cde23e7a9
commit 69dd7ec7b6
3 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,7 @@ class GoldenAgeManager{
turnsToGoldenAge *= civInfo.gameInfo.gameParameters.gameSpeed.getModifier() turnsToGoldenAge *= civInfo.gameInfo.gameParameters.gameSpeed.getModifier()
turnsLeftForCurrentGoldenAge += turnsToGoldenAge.toInt() turnsLeftForCurrentGoldenAge += turnsToGoldenAge.toInt()
civInfo.addNotification("You have entered a golden age!", null, Color.GOLD) civInfo.addNotification("You have entered a golden age!", null, Color.GOLD)
civInfo.popupAlerts.add(PopupAlert(AlertType.GoldenAge,""))
} }
fun endTurn(happiness: Int) { fun endTurn(happiness: Int) {

View File

@ -12,6 +12,7 @@ enum class AlertType{
CitiesSettledNearOtherCiv, CitiesSettledNearOtherCiv,
DemandToStopSettlingCitiesNear, DemandToStopSettlingCitiesNear,
CitySettledNearOtherCivDespiteOurPromise, CitySettledNearOtherCivDespiteOurPromise,
GoldenAge,
} }
class PopupAlert { class PopupAlert {

View File

@ -139,6 +139,12 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu
add(centerTable).row() add(centerTable).row()
add(getCloseButton("Close")) 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() open()
worldScreen.alertPopupIsOpen = true worldScreen.alertPopupIsOpen = true