Updating happiness happens in a different thread so it doesn't impede the update() function

This commit is contained in:
Yair Morgenstern
2018-07-12 19:17:58 +03:00
parent c05503bb86
commit bfb53a1940
3 changed files with 4 additions and 2 deletions

View File

@ -21,7 +21,7 @@ android {
applicationId "com.unciv.game"
minSdkVersion 14
targetSdkVersion 26
versionCode 98
versionCode 99
versionName "2.6.2"
}
buildTypes {

View File

@ -77,6 +77,8 @@ class WorldScreen : CameraStageBaseScreen() {
fun update() {
kotlin.concurrent.thread { civInfo.happiness = civInfo.getHappinessForNextTurn().values.sum() }
if (game.gameInfo.tutorial.contains("CityEntered")) {
displayTutorials("AfterCityEntered")
}

View File

@ -160,7 +160,7 @@ class WorldScreenTopBar(val screen: WorldScreen) : Table() {
}
private fun getHappinessText(civInfo: CivilizationInfo): String {
var happinessText = civInfo.getHappinessForNextTurn().values.sum().toString()
var happinessText = civInfo.happiness.toString()
if (civInfo.goldenAges.isGoldenAge())
happinessText += " GOLDEN AGE (${civInfo.goldenAges.turnsLeftForCurrentGoldenAge})"
else