From 3199098ae807b00b60b622139b27ec2132a5f08b Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Tue, 26 Jan 2021 22:20:36 +0200 Subject: [PATCH] Solved ANRs when loading large maps in map editor --- core/src/com/unciv/ui/mapeditor/LoadMapScreen.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/com/unciv/ui/mapeditor/LoadMapScreen.kt b/core/src/com/unciv/ui/mapeditor/LoadMapScreen.kt index d6f9db8dc8..521cdbae0d 100644 --- a/core/src/com/unciv/ui/mapeditor/LoadMapScreen.kt +++ b/core/src/com/unciv/ui/mapeditor/LoadMapScreen.kt @@ -45,8 +45,14 @@ class LoadMapScreen(previousMap: TileMap?) : PickerScreen(){ dispose() } } else { + Gdx.app.postRunnable { + val popup = Popup(this) + popup.addGoodSizedLabel("Loading...") + popup.open() + } val map = MapSaver.loadMap(chosenMap!!) Gdx.app.postRunnable { + Gdx.input.inputProcessor = null // This is to stop ANRs happening here, until the map editor screen sets up. UncivGame.Current.setScreen(MapEditorScreen(map)) dispose() }