diff --git a/lib/mod_list.dart b/lib/mod_list.dart index bc6c225..980517f 100644 --- a/lib/mod_list.dart +++ b/lib/mod_list.dart @@ -196,6 +196,18 @@ class ModList { } } + void enableMods(List modIds) { + for (final modId in modIds) { + setEnabled(modId, true); + } + } + + void disableMods(List modIds) { + for (final modId in modIds) { + setEnabled(modId, false); + } + } + List> checkIncompatibilities() { List> conflicts = []; List activeModIds = activeMods.keys.toList(); @@ -512,8 +524,8 @@ class ModList { configPath: configPath ?? this.configPath, modsPath: modsPath ?? this.modsPath, ); - newModlist.mods = mods ?? this.mods; - newModlist.activeMods = activeMods ?? this.activeMods; + newModlist.mods = Map.from(mods ?? this.mods); + newModlist.activeMods = Map.from(activeMods ?? this.activeMods); return newModlist; } }