Update dependencies in pubspec.lock and add new mod 'Odyssey' to mod list

This commit is contained in:
2025-07-14 23:33:46 +02:00
parent 753859fd3e
commit a662dffc7c
5 changed files with 63 additions and 50 deletions

View File

@@ -703,11 +703,11 @@ class ModList {
loadOrder ??= LoadOrder();
final toEnable = <String>[];
final logger = Logger.instance;
// First, identify all base game and expansion mods
final baseGameIds = <String>{};
final expansionIds = <String>{};
for (final entry in mods.entries) {
if (entry.value.isBaseGame) {
baseGameIds.add(entry.key);
@@ -715,46 +715,53 @@ class ModList {
expansionIds.add(entry.key);
}
}
logger.info("Base game mods: ${baseGameIds.join(', ')}");
logger.info("Expansion mods: ${expansionIds.join(', ')}");
// Load dependencies for all active mods
for (final modid in activeMods.keys) {
loadDependencies(modid, loadOrder, toEnable);
}
// Enable all required dependencies
for (final modid in toEnable) {
setEnabled(modid, true);
}
// Generate the load order
final newLoadOrder = generateLoadOrder(loadOrder);
// Filter out any error messages related to incompatibilities between base game and expansions
if (newLoadOrder.hasErrors) {
final filteredErrors = <String>[];
for (final error in newLoadOrder.errors) {
// Check if the error is about incompatibility
if (error.contains('Incompatibility detected:')) {
// Extract the mod IDs from the error message
final parts = error.split(' is incompatible with ');
if (parts.length == 2) {
final firstModId = parts[0].replaceAll('Incompatibility detected: ', '');
final firstModId = parts[0].replaceAll(
'Incompatibility detected: ',
'',
);
final secondModId = parts[1];
// Check if either mod is a base game or expansion
final isBaseGameOrExpansion =
baseGameIds.contains(firstModId) || baseGameIds.contains(secondModId) ||
expansionIds.contains(firstModId) || expansionIds.contains(secondModId);
final isBaseGameOrExpansion =
baseGameIds.contains(firstModId) ||
baseGameIds.contains(secondModId) ||
expansionIds.contains(firstModId) ||
expansionIds.contains(secondModId);
// Only keep the error if it's not between base game/expansions
if (!isBaseGameOrExpansion) {
filteredErrors.add(error);
} else {
logger.info("Ignoring incompatibility between base game or expansion mods: $error");
logger.info(
"Ignoring incompatibility between base game or expansion mods: $error",
);
}
} else {
// If we can't parse the error, keep it
@@ -765,12 +772,12 @@ class ModList {
filteredErrors.add(error);
}
}
// Replace the errors with the filtered list
newLoadOrder.errors.clear();
newLoadOrder.errors.addAll(filteredErrors);
}
return newLoadOrder;
}