From f3b4db9d643c938deda6bbc10bb38a18d1af940f Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 13 Oct 2022 21:18:34 +0300 Subject: [PATCH] Hopefully resolved ANRs from WorldScreen updates --- core/src/com/unciv/ui/worldscreen/WorldScreen.kt | 5 ++++- docs/Modders/uniques.md | 5 ----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index e857c65f99..8341086f93 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -10,6 +10,7 @@ import com.badlogic.gdx.scenes.scene2d.actions.Actions import com.badlogic.gdx.scenes.scene2d.actions.RepeatAction import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.scenes.scene2d.ui.TextButton +import com.badlogic.gdx.scenes.scene2d.ui.TextField import com.badlogic.gdx.utils.Align import com.unciv.Constants import com.unciv.MainMenuScreen @@ -75,7 +76,6 @@ import com.unciv.utils.concurrency.withGLContext import com.unciv.utils.debug import kotlinx.coroutines.Job import kotlinx.coroutines.coroutineScope -import com.badlogic.gdx.scenes.scene2d.ui.TextField /** * Do not create this screen without seriously thinking about the implications: this is the single most memory-intensive class in the application. @@ -785,8 +785,11 @@ class WorldScreen( if (shouldUpdate) { shouldUpdate = false + // Since updating the worldscreen can take a long time, *especially* the first time, we disable input processing to avoid ANRs + Gdx.input.inputProcessor = null update() showTutorialsOnNextTurn() + Gdx.input.inputProcessor = stage } // topBar.selectedCivLabel.setText(Gdx.graphics.framesPerSecond) // for framerate testing diff --git a/docs/Modders/uniques.md b/docs/Modders/uniques.md index 302e4ceadd..d99d75b085 100644 --- a/docs/Modders/uniques.md +++ b/docs/Modders/uniques.md @@ -1724,11 +1724,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl Applicable to: Conditional -??? example "<upon discovering [tech]>" - Example: "<upon discovering [Agriculture]>" - - Applicable to: Conditional - ??? example "<after adopting [policy]>" Example: "<after adopting [Oligarchy]>"