Rework shit again
This commit is contained in:
38
lib/mod.dart
38
lib/mod.dart
@@ -26,8 +26,7 @@ class Mod {
|
||||
final List<String> loadAfter; // ModMetaData.loadAfter
|
||||
final List<String> loadBefore; // ModMetaData.loadBefore
|
||||
final List<String> incompatabilities; // ModMetaData.incompatibleWith
|
||||
final bool
|
||||
enabled; // ConfigFile.mods.firstWhere((mod) => mod.id == id).enabled
|
||||
bool enabled;
|
||||
final int size; // Count of files in the mod directory
|
||||
final bool isBaseGame; // Is this the base RimWorld game
|
||||
final bool isExpansion; // Is this a RimWorld expansion
|
||||
@@ -42,10 +41,10 @@ class Mod {
|
||||
required this.loadAfter,
|
||||
required this.loadBefore,
|
||||
required this.incompatabilities,
|
||||
required this.enabled,
|
||||
required this.size,
|
||||
this.isBaseGame = false,
|
||||
this.isExpansion = false,
|
||||
this.enabled = false,
|
||||
});
|
||||
|
||||
static Mod fromDirectory(String path, {bool skipFileCount = false}) {
|
||||
@@ -250,10 +249,41 @@ class Mod {
|
||||
loadAfter: loadAfter,
|
||||
loadBefore: loadBefore,
|
||||
incompatabilities: incompatabilities,
|
||||
enabled: false,
|
||||
size: size,
|
||||
isBaseGame: isBaseGame,
|
||||
isExpansion: isExpansion,
|
||||
);
|
||||
}
|
||||
|
||||
Mod copyWith({
|
||||
String? name,
|
||||
String? id,
|
||||
String? path,
|
||||
List<String>? versions,
|
||||
String? description,
|
||||
List<String>? hardDependencies,
|
||||
List<String>? loadAfter,
|
||||
List<String>? loadBefore,
|
||||
List<String>? incompatabilities,
|
||||
int? size,
|
||||
bool? isBaseGame,
|
||||
bool? isExpansion,
|
||||
bool? enabled,
|
||||
}) {
|
||||
return Mod(
|
||||
name: name ?? this.name,
|
||||
id: id ?? this.id,
|
||||
path: path ?? this.path,
|
||||
versions: versions ?? this.versions,
|
||||
description: description ?? this.description,
|
||||
hardDependencies: hardDependencies ?? this.hardDependencies,
|
||||
loadAfter: loadAfter ?? this.loadAfter,
|
||||
loadBefore: loadBefore ?? this.loadBefore,
|
||||
incompatabilities: incompatabilities ?? this.incompatabilities,
|
||||
size: size ?? this.size,
|
||||
isBaseGame: isBaseGame ?? this.isBaseGame,
|
||||
isExpansion: isExpansion ?? this.isExpansion,
|
||||
enabled: enabled ?? this.enabled,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user