mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-01 02:14:51 +07:00
Game always resume previous screen on resume(), and autosaves on pause (in case the user / Android decides later that it's closing the app completely)
This commit is contained in:
parent
e59776f443
commit
206686a4d4
@ -145,12 +145,13 @@ class UncivGame(
|
||||
override fun resume() {
|
||||
super.resume()
|
||||
if (!isInitialized) return // The stuff from Create() is still happening, so the main screen will load eventually
|
||||
ImageGetter.refreshAtlas()
|
||||
|
||||
setScreen(MainMenuScreen())
|
||||
}
|
||||
|
||||
// Maybe this will solve the resume error on chrome OS, issue 322? Worth a shot
|
||||
override fun pause() {
|
||||
if (this::gameInfo.isInitialized) GameSaver.autoSave(this.gameInfo)
|
||||
super.pause()
|
||||
}
|
||||
|
||||
override fun resize(width: Int, height: Int) {
|
||||
screen.resize(width, height)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user