Add copy with to modlist

This commit is contained in:
2025-03-16 22:14:50 +01:00
parent d41413dbcd
commit 2a7b3f8345

View File

@@ -501,6 +501,21 @@ class ModList {
}
return generateLoadOrder();
}
ModList copyWith({
String? configPath,
String? modsPath,
Map<String, Mod>? mods,
Map<String, bool>? activeMods,
}) {
final newModlist = ModList(
configPath: configPath ?? this.configPath,
modsPath: modsPath ?? this.modsPath,
);
newModlist.mods = mods ?? this.mods;
newModlist.activeMods = activeMods ?? this.activeMods;
return newModlist;
}
}
String _expansionNameFromId(String id) {