Skip to content

Commit

Permalink
Resolved #12389 - multiturn autoplay worldscreen. nextTurn tuns on ma…
Browse files Browse the repository at this point in the history
…in GDX thread, since it interacts with UI element (progress bar)
  • Loading branch information
yairm210 committed Nov 1, 2024
1 parent e08d94b commit ec6e13c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
}
}
Expand Down

0 comments on commit ec6e13c

Please sign in to comment.