diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index ae50b80abc..75230ab237 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -258,6 +258,8 @@ It looks like we can't make a map with the parameters you requested! = Maybe you put too many players into too small a map? = No human players selected! = Mods: = +Base ruleset mods: = +Extension mods: = # Multiplayer diff --git a/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt index cfdda19a5b..3f1c311314 100644 --- a/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt @@ -178,12 +178,14 @@ class GameOptionsTable(val previousScreen: IPreviousScreen, val updatePlayerPick } fun Table.addModCheckboxes() { - val modRulesets = RulesetCache.values.filter { it.name != "" - && (it.name in gameParameters.mods || !it.modOptions.uniques.contains("Scenario only")) } // Don't allow scenario mods for a regular 'new game' - if (modRulesets.isEmpty()) return + val modRulesets = RulesetCache.values.filter { + it.name != "" + && (it.name in gameParameters.mods || !it.modOptions.uniques.contains("Scenario only")) + } // Don't allow scenario mods for a regular 'new game' + + val baseRulesetCheckboxes = ArrayList() + val extentionRulesetModButtons = ArrayList() - add("Mods:".toLabel(fontSize = 24)).padTop(16f).colspan(2).row() - val modCheckboxTable = Table().apply { defaults().pad(5f) } for (mod in modRulesets) { val checkBox = CheckBox(mod.name.tr(), CameraStageBaseScreen.skin) checkBox.isDisabled = locked @@ -199,13 +201,32 @@ class GameOptionsTable(val previousScreen: IPreviousScreen, val updatePlayerPick if (modNations != null && modNations.size > 0) { desiredCiv = modNations.keys.first() } + if (mod.modOptions.isBaseRuleset) + for (oldBaseRuleset in gameParameters.mods) + if (modRulesets.firstOrNull { it.name == oldBaseRuleset }?.modOptions?.isBaseRuleset == true) + gameParameters.mods.remove(oldBaseRuleset) } updatePlayerPickerTable(desiredCiv) } - modCheckboxTable.add(checkBox).row() + if (mod.modOptions.isBaseRuleset) baseRulesetCheckboxes.add(checkBox) + else extentionRulesetModButtons.add(checkBox) + } + + if (baseRulesetCheckboxes.any()) { + add("Base ruleset mods:".toLabel(fontSize = 24)).padTop(16f).colspan(2).row() + val modCheckboxTable = Table().apply { defaults().pad(5f) } + for (checkbox in baseRulesetCheckboxes) modCheckboxTable.add(checkbox).row() + add(modCheckboxTable).colspan(2).row() + } + + + if (extentionRulesetModButtons.any()) { + add("Extension mods:".toLabel(fontSize = 24)).padTop(16f).colspan(2).row() + val modCheckboxTable = Table().apply { defaults().pad(5f) } + for (checkbox in extentionRulesetModButtons) modCheckboxTable.add(checkbox).row() + add(modCheckboxTable).colspan(2).row() } - add(modCheckboxTable).colspan(2).row() } } \ No newline at end of file