Mod name defense attempt II (#9645)

* Improve Load game error label readability

* Fix threading on load game screen

* Miscellaneous tweaks

* Compatibility with Mods using trailing dashes on Windows
This commit is contained in:
SomeTroglodyte
2023-06-25 08:38:18 +02:00
committed by GitHub
parent 82ebb01a20
commit abb0dcbaae
5 changed files with 63 additions and 19 deletions

View File

@ -61,7 +61,8 @@ open class AndroidLauncher : AndroidApplication() {
val internalModsDir = File("${filesDir.path}/mods")
// Mod directory in the shared app data (where the user can see and modify)
val externalModsDir = File("${getExternalFilesDir(null)?.path}/mods")
val externalPath = getExternalFilesDir(null)?.path ?: return
val externalModsDir = File("$externalPath/mods")
// Copy external mod directory (with data user put in it) to internal (where it can be read)
if (!externalModsDir.exists()) externalModsDir.mkdirs() // this can fail sometimes, which is why we check if it exists again in the next line