From ec6e13c01f61ebba9b590cc5db232f31f2185164 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Fri, 1 Nov 2024 12:19:39 +0200 Subject: [PATCH] Resolved #12389 - multiturn autoplay worldscreen. nextTurn tuns on main GDX thread, since it interacts with UI element (progress bar) --- .../com/unciv/ui/screens/worldscreen/status/NextTurnButton.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/ui/screens/worldscreen/status/NextTurnButton.kt b/core/src/com/unciv/ui/screens/worldscreen/status/NextTurnButton.kt index 900c668935..55805f949a 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/status/NextTurnButton.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/status/NextTurnButton.kt @@ -13,6 +13,7 @@ import com.unciv.ui.images.IconTextButton import com.unciv.ui.images.ImageGetter import com.unciv.ui.popups.hasOpenPopups import com.unciv.ui.screens.worldscreen.WorldScreen +import com.unciv.utils.Concurrency class NextTurnButton( private val worldScreen: WorldScreen @@ -36,7 +37,7 @@ class NextTurnButton( && !worldScreen.waitingForAutosave && !worldScreen.isNextTurnUpdateRunning()) { autoPlay.runAutoPlayJobInNewThread("MultiturnAutoPlay", worldScreen, false) { TurnManager(worldScreen.viewingCiv).automateTurn() - worldScreen.nextTurn() + Concurrency.runOnGLThread { worldScreen.nextTurn() } autoPlay.endTurnMultiturnAutoPlay() } }