From 78513b87c1ff65d4a4315cc4fcb70ef3aa85bb62 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sat, 19 Dec 2020 21:15:12 +0200 Subject: [PATCH] Resolved #3427 - "player ready" screen appears when loading game in Hotseat multiplayer --- core/src/com/unciv/UncivGame.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/src/com/unciv/UncivGame.kt b/core/src/com/unciv/UncivGame.kt index bd906060e0..7b310dcfcb 100644 --- a/core/src/com/unciv/UncivGame.kt +++ b/core/src/com/unciv/UncivGame.kt @@ -9,6 +9,7 @@ import com.badlogic.gdx.scenes.scene2d.actions.Actions import com.badlogic.gdx.utils.Align import com.unciv.logic.GameInfo import com.unciv.logic.GameSaver +import com.unciv.logic.civilization.PlayerType import com.unciv.models.metadata.GameSettings import com.unciv.models.ruleset.RulesetCache import com.unciv.models.translations.Translations @@ -17,6 +18,7 @@ import com.unciv.ui.utils.CameraStageBaseScreen import com.unciv.ui.utils.CrashController import com.unciv.ui.utils.ImageGetter import com.unciv.ui.utils.center +import com.unciv.ui.worldscreen.PlayerReadyScreen import com.unciv.ui.worldscreen.WorldScreen import java.util.* import kotlin.concurrent.thread @@ -119,9 +121,12 @@ class UncivGame(parameters: UncivGameParameters) : Game() { ImageGetter.ruleset = gameInfo.ruleSet ImageGetter.reload() Gdx.input.inputProcessor = null // Since we will set the world screen when we're ready, - // This is to avoid ANRs when loading. - worldScreen = WorldScreen(gameInfo.getPlayerToViewAs()) - setWorldScreen() + if (gameInfo.civilizations.count { it.playerType == PlayerType.Human } > 1 && !gameInfo.gameParameters.isOnlineMultiplayer) + setScreen(PlayerReadyScreen(gameInfo.getPlayerToViewAs())) + else { + worldScreen = WorldScreen(gameInfo.getPlayerToViewAs()) + setWorldScreen() + } } fun loadGame(gameName: String) {