mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-12 16:59:11 +07:00
Don't draw text on worker threads (#2701)
Drawing text requires OpenGL context if new characters need to be rendered.
This commit is contained in:
@ -55,7 +55,9 @@ class MapEditorMenuPopup(mapEditorScreen: MapEditorScreen): Popup(mapEditorScree
|
|||||||
try {
|
try {
|
||||||
MapSaver.saveMap(mapEditorScreen.mapName, mapEditorScreen.tileMap)
|
MapSaver.saveMap(mapEditorScreen.mapName, mapEditorScreen.tileMap)
|
||||||
close()
|
close()
|
||||||
|
Gdx.app.postRunnable {
|
||||||
ResponsePopup("Map saved", mapEditorScreen) // todo - add this text to translations
|
ResponsePopup("Map saved", mapEditorScreen) // todo - add this text to translations
|
||||||
|
}
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
ex.printStackTrace()
|
ex.printStackTrace()
|
||||||
Gdx.app.postRunnable {
|
Gdx.app.postRunnable {
|
||||||
@ -97,12 +99,15 @@ class MapEditorMenuPopup(mapEditorScreen: MapEditorScreen): Popup(mapEditorScree
|
|||||||
DropBox.uploadFile("/Maps/" + mapEditorScreen.mapName, gzippedMap)
|
DropBox.uploadFile("/Maps/" + mapEditorScreen.mapName, gzippedMap)
|
||||||
|
|
||||||
remove()
|
remove()
|
||||||
|
Gdx.app.postRunnable {
|
||||||
val uploadedSuccessfully = Popup(screen)
|
val uploadedSuccessfully = Popup(screen)
|
||||||
uploadedSuccessfully.addGoodSizedLabel("Map uploaded successfully!").row()
|
uploadedSuccessfully.addGoodSizedLabel("Map uploaded successfully!").row()
|
||||||
uploadedSuccessfully.addCloseButton()
|
uploadedSuccessfully.addCloseButton()
|
||||||
uploadedSuccessfully.open()
|
uploadedSuccessfully.open()
|
||||||
|
}
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
remove()
|
remove()
|
||||||
|
Gdx.app.postRunnable {
|
||||||
val couldNotUpload = Popup(screen)
|
val couldNotUpload = Popup(screen)
|
||||||
couldNotUpload.addGoodSizedLabel("Could not upload map!").row()
|
couldNotUpload.addGoodSizedLabel("Could not upload map!").row()
|
||||||
couldNotUpload.addCloseButton()
|
couldNotUpload.addCloseButton()
|
||||||
@ -110,6 +115,7 @@ class MapEditorMenuPopup(mapEditorScreen: MapEditorScreen): Popup(mapEditorScree
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
add(uploadMapButton).row()
|
add(uploadMapButton).row()
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user