Fixed Scenario mods being undownloadable and needing to restart game to access Scenario picker

This commit is contained in:
yairm210 2024-09-15 15:52:36 +03:00
parent 96addf305b
commit f2141d3393
2 changed files with 6 additions and 2 deletions

View File

@ -150,7 +150,7 @@ object Github {
}
private fun isValidModFolder(dir: FileHandle): Boolean {
val goodFolders = listOf("Images", "jsons", "maps", "music", "sounds", "Images\\..*")
val goodFolders = listOf("Images", "jsons", "maps", "music", "sounds", "Images\\..*", "scenarios")
.map { Regex(it, RegexOption.IGNORE_CASE) }
val goodFiles = listOf(".*\\.atlas", ".*\\.png", "preview.jpg", ".*\\.md", "Atlases.json", ".nomedia", "license")
.map { Regex(it, RegexOption.IGNORE_CASE) }

View File

@ -139,7 +139,11 @@ class ModManagementScreen private constructor(
if (game.settings.tileSet !in tileSets) {
game.settings.tileSet = tileSets.first()
}
game.popScreen()
val screen = game.popScreen()
// We want to immediately display/hide Scenario button based on changes
if (screen is MainMenuScreen)
screen.game.replaceCurrentScreen(MainMenuScreen())
}
closeButton.keyShortcuts.add(KeyCharAndCode.BACK)