mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-14 09:48:12 +07:00
3.14.3
This commit is contained in:
@ -22,12 +22,12 @@ open class AndroidLauncher : AndroidApplication() {
|
||||
}
|
||||
MultiplayerTurnCheckWorker.createNotificationChannels(applicationContext)
|
||||
|
||||
// Only allow mods on KK+, to avoid READ_EXTERNAL_STORAGE permission earlier versions need
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
copyMods()
|
||||
// Only allow mods on KK+, to avoid READ_EXTERNAL_STORAGE permission earlier versions need
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
copyMods()
|
||||
val externalfilesDir = getExternalFilesDir(null)
|
||||
if(externalfilesDir!=null) GameSaver.externalFilesDirForAndroid = externalfilesDir.path
|
||||
}
|
||||
if (externalfilesDir != null) GameSaver.externalFilesDirForAndroid = externalfilesDir.path
|
||||
}
|
||||
|
||||
val config = AndroidApplicationConfiguration().apply { useImmersiveMode = true; }
|
||||
val androidParameters = UncivGameParameters(
|
||||
@ -36,16 +36,16 @@ open class AndroidLauncher : AndroidApplication() {
|
||||
fontImplementation = NativeFontAndroid(ORIGINAL_FONT_SIZE.toInt()),
|
||||
customSaveLocationHelper = customSaveLocationHelper
|
||||
)
|
||||
val game = UncivGame ( androidParameters )
|
||||
val game = UncivGame(androidParameters)
|
||||
initialize(game, config)
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies mods from external data directory (where users can access) to the private one (where
|
||||
* libGDX reads from). Note: deletes all files currently in the private mod directory and
|
||||
* replaces them with the ones in the external folder!)
|
||||
*/
|
||||
private fun copyMods() {
|
||||
/**
|
||||
* Copies mods from external data directory (where users can access) to the private one (where
|
||||
* libGDX reads from). Note: deletes all files currently in the private mod directory and
|
||||
* replaces them with the ones in the external folder!)
|
||||
*/
|
||||
private fun copyMods() {
|
||||
// Mod directory in the internal app data (where Gdx.files.local looks)
|
||||
val internalModsDir = File("${filesDir.path}/mods")
|
||||
|
||||
@ -74,8 +74,8 @@ open class AndroidLauncher : AndroidApplication() {
|
||||
cancel(MultiplayerTurnCheckWorker.NOTIFICATION_ID_INFO)
|
||||
cancel(MultiplayerTurnCheckWorker.NOTIFICATION_ID_SERVICE)
|
||||
}
|
||||
} catch (ex: Exception) {
|
||||
}
|
||||
catch (ex:Exception){}
|
||||
super.onResume()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user