Tie data exports to mod packs

Store the export manifest in ModPack to allow mulitple mod packs to have
different data exported. This is necessary as the export contains the
settings prototypes needed to create a proper UI for mod settings.

For now the useLocale and useItemMetadata interfaces uses the manifest
for a default mod pack set in the master config.
This commit is contained in:
Hornwitser committed 2023-02-02 00:28:58 +01:00
1 parent 7c6aaeb05d
commit 13e12f7335
16 files changed
+146 -34

No files matched your search

-9
View File
@@ -177,7 +177,6 @@ class Master {
this.modPacks = await Master.loadModPacks(path.join(databaseDirectory, "mod-packs.json"));
this.userManager = new UserManager(this.config);
await this.userManager.load(path.join(databaseDirectory, "users.json"));
this.exportManifest = await Master.loadJsonObject(path.join(databaseDirectory, "export_manifest.json"));
let modsDirectory = this.config.get("master.mods_directory");
await fs.ensureDir(modsDirectory);
@@ -445,14 +444,6 @@ class Master {
return manifest;
}
async updateExportManifest(newManifest) {
let databaseDirectory = this.config.get("master.database_directory");
await libFileOps.safeOutputFile(
path.join(databaseDirectory, "export_manifest.json"), JSON.stringify(newManifest, null, 4)
);
this.exportManifest = newManifest;
}
async deleteMod(name, version) {
let filename = `${name}_${version}.zip`;
let mod = this.mods.get(filename);