mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 07:17:50 +07:00
Updating happiness happens in a different thread so it doesn't impede the update() function
This commit is contained in:
@ -21,7 +21,7 @@ android {
|
||||
applicationId "com.unciv.game"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 26
|
||||
versionCode 98
|
||||
versionCode 99
|
||||
versionName "2.6.2"
|
||||
}
|
||||
buildTypes {
|
||||
|
@ -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")
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user