Game now saves save files in external storage on Android when possible.

May the lord have mercy on our souls.
This commit is contained in:
Yair Morgenstern
2020-05-31 19:48:36 +03:00
parent 434ded6070
commit 43f8fa89c0
2 changed files with 14 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import androidx.work.WorkManager
import com.badlogic.gdx.backends.android.AndroidApplication
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration
import com.unciv.UncivGame
import com.unciv.logic.GameSaver
import java.io.File
class AndroidLauncher : AndroidApplication() {
@ -17,6 +18,7 @@ class AndroidLauncher : AndroidApplication() {
// Only allow mods on KK+, to avoid READ_EXTERNAL_STORAGE permission earlier versions need
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
copyMods()
GameSaver.externalFilesDirForAndroid = getExternalFilesDir(null)!!.path
}
val config = AndroidApplicationConfiguration().apply { useImmersiveMode = true }