mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-23 22:30:18 +07:00
Resolved some ANRs in Multiplayer
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
package com.unciv.ui.worldscreen
|
package com.unciv.ui.worldscreen
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx
|
||||||
import com.badlogic.gdx.scenes.scene2d.Touchable
|
import com.badlogic.gdx.scenes.scene2d.Touchable
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||||
import com.unciv.UncivGame
|
import com.unciv.UncivGame
|
||||||
@ -18,8 +19,10 @@ class PlayerReadyScreen(currentPlayerCiv: CivilizationInfo) : CameraStageBaseScr
|
|||||||
table.add("[$currentPlayerCiv] ready?".toLabel(currentPlayerCiv.nation.getInnerColor(),24))
|
table.add("[$currentPlayerCiv] ready?".toLabel(currentPlayerCiv.nation.getInnerColor(),24))
|
||||||
|
|
||||||
table.onClick {
|
table.onClick {
|
||||||
UncivGame.Current.worldScreen = WorldScreen(currentPlayerCiv)
|
Gdx.app.postRunnable { // To avoid ANRs on Android when the creation of the worldscreen takes more than 500ms
|
||||||
UncivGame.Current.setWorldScreen()
|
UncivGame.Current.worldScreen = WorldScreen(currentPlayerCiv)
|
||||||
|
UncivGame.Current.setWorldScreen()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
table.setFillParent(true)
|
table.setFillParent(true)
|
||||||
stage.addActor(table)
|
stage.addActor(table)
|
||||||
|
Reference in New Issue
Block a user