Fix up the entire frontend
This commit is contained in:
2193
lib/main.dart
2193
lib/main.dart
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,7 @@ class ModList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<FileSystemEntity> entities = directory.listSync();
|
final List<FileSystemEntity> entities = directory.listSync();
|
||||||
|
// TODO: Count only the latest version of each mod and not all versions
|
||||||
final List<String> modDirectories =
|
final List<String> modDirectories =
|
||||||
entities.whereType<Directory>().map((dir) => dir.path).toList();
|
entities.whereType<Directory>().map((dir) => dir.path).toList();
|
||||||
|
|
||||||
@@ -85,6 +86,7 @@ class ModList {
|
|||||||
logger.info(
|
logger.info(
|
||||||
'Loaded mod from directory: ${mod.name} (ID: ${mod.id}) in $modTime ms',
|
'Loaded mod from directory: ${mod.name} (ID: ${mod.id}) in $modTime ms',
|
||||||
);
|
);
|
||||||
|
yield mod;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error('Error loading mod from directory: $modDir');
|
logger.error('Error loading mod from directory: $modDir');
|
||||||
logger.error('Error: $e');
|
logger.error('Error: $e');
|
||||||
@@ -171,7 +173,7 @@ class ModList {
|
|||||||
logger.warning('Mod $modId already exists in mods list, overwriting');
|
logger.warning('Mod $modId already exists in mods list, overwriting');
|
||||||
}
|
}
|
||||||
mods[modId] = mod;
|
mods[modId] = mod;
|
||||||
setEnabled(modId, mod.enabled);
|
setEnabled(modId, true);
|
||||||
yield mod;
|
yield mod;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -540,7 +542,9 @@ class ModList {
|
|||||||
if (cycleStart >= 0) {
|
if (cycleStart >= 0) {
|
||||||
// Extract the cycle part
|
// Extract the cycle part
|
||||||
List<String> cycleIds = [...cyclePath.sublist(cycleStart), modId];
|
List<String> cycleIds = [...cyclePath.sublist(cycleStart), modId];
|
||||||
loadOrder.errors.add('Cyclic dependency detected: ${cycleIds.join(' -> ')}');
|
loadOrder.errors.add(
|
||||||
|
'Cyclic dependency detected: ${cycleIds.join(' -> ')}',
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
loadOrder.errors.add('Cyclic dependency detected: $modId -> $dep');
|
loadOrder.errors.add('Cyclic dependency detected: $modId -> $dep');
|
||||||
}
|
}
|
||||||
@@ -548,7 +552,13 @@ class ModList {
|
|||||||
}
|
}
|
||||||
seen[dep] = true;
|
seen[dep] = true;
|
||||||
toEnable.add(depMod.id);
|
toEnable.add(depMod.id);
|
||||||
loadDependencies(depMod.id, loadOrder, toEnable, seen, List.from(cyclePath));
|
loadDependencies(
|
||||||
|
depMod.id,
|
||||||
|
loadOrder,
|
||||||
|
toEnable,
|
||||||
|
seen,
|
||||||
|
List.from(cyclePath),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return loadOrder;
|
return loadOrder;
|
||||||
|
Reference in New Issue
Block a user