Hopefully got rid of ANRs when entering a link when the app has been closed for too long? I think that's the problem?

This commit is contained in:
Yair Morgenstern
2022-04-09 23:08:12 +03:00
parent 76284c923e
commit 9169ec1e42

View File

@ -75,6 +75,7 @@ class UncivGame(parameters: UncivGameParameters) : Game() {
val translations = Translations() val translations = Translations()
override fun create() { override fun create() {
isInitialized = false // this could be on reload, therefore we need to keep setting this to false
Gdx.input.setCatchKey(Input.Keys.BACK, true) Gdx.input.setCatchKey(Input.Keys.BACK, true)
if (Gdx.app.type != Application.ApplicationType.Desktop) { if (Gdx.app.type != Application.ApplicationType.Desktop) {
viewEntireMapForDebug = false viewEntireMapForDebug = false
@ -166,7 +167,8 @@ class UncivGame(parameters: UncivGameParameters) : Game() {
fun tryLoadDeepLinkedGame() { fun tryLoadDeepLinkedGame() {
if (deepLinkedMultiplayerGame != null) { if (deepLinkedMultiplayerGame != null) {
try { try {
loadGame(OnlineMultiplayer().tryDownloadGame(deepLinkedMultiplayerGame!!)) val onlineGame = OnlineMultiplayer().tryDownloadGame(deepLinkedMultiplayerGame!!)
loadGame(onlineGame)
} catch (ex: Exception) { } catch (ex: Exception) {
setScreen(MainMenuScreen()) setScreen(MainMenuScreen())
} }