Resolved #2503 - Resizing the game no longer returns you to the main menu

This commit is contained in:
Yair Morgenstern 2020-04-24 11:04:11 +03:00
parent 289bf62e99
commit 5a8b6fdb19
3 changed files with 13 additions and 8 deletions

View File

@ -152,7 +152,7 @@ class UncivGame(
// Maybe this will solve the resume error on chrome OS, issue 322? Worth a shot // Maybe this will solve the resume error on chrome OS, issue 322? Worth a shot
override fun resize(width: Int, height: Int) { override fun resize(width: Int, height: Int) {
resume() screen.resize(width, height)
} }
override fun dispose() { override fun dispose() {

View File

@ -141,6 +141,12 @@ class MapEditorScreen(): CameraStageBaseScreen() {
} }
}) })
} }
override fun resize(width: Int, height: Int) {
if (stage.viewport.screenWidth != width || stage.viewport.screenHeight != height) {
game.setScreen(MapEditorScreen(mapHolder.tileMap))
}
}
} }

View File

@ -572,7 +572,6 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
override fun resize(width: Int, height: Int) { override fun resize(width: Int, height: Int) {
if (stage.viewport.screenWidth != width || stage.viewport.screenHeight != height) { if (stage.viewport.screenWidth != width || stage.viewport.screenHeight != height) {
super.resize(width, height)
game.worldScreen = WorldScreen(viewingCiv) // start over. game.worldScreen = WorldScreen(viewingCiv) // start over.
game.setWorldScreen() game.setWorldScreen()
} }