mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 23:24:52 +09:00
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:
1 parent
7c6aaeb05d
commit
13e12f7335
16 files changed
+146
-34
No files matched your search
@@ -3,6 +3,7 @@ const assert = require("assert").strict;
|
||||
const zlib = require("zlib");
|
||||
|
||||
const libSchema = require("@clusterio/lib/schema");
|
||||
const ExportManifest = require("@clusterio/lib/data/ExportManifest");
|
||||
const ModPack = require("@clusterio/lib/data/ModPack");
|
||||
|
||||
|
||||
@@ -18,6 +19,7 @@ describe("lib/data/ModPack", function() {
|
||||
assert.deepEqual(new ModPack(json), pack);
|
||||
const packStringed = ModPack.fromModPackString(pack.toModPackString());
|
||||
packStringed.id = pack.id;
|
||||
packStringed.exportManifest = pack.exportManifest;
|
||||
assert.deepEqual(packStringed, pack);
|
||||
}
|
||||
|
||||
@@ -40,6 +42,7 @@ describe("lib/data/ModPack", function() {
|
||||
"string-setting": { "value": "a string" },
|
||||
},
|
||||
}}));
|
||||
check(new ModPack({ export_manifest: { assets: { setting: "settings.json" }}}));
|
||||
check(new ModPack({ deleted: true }));
|
||||
check(new ModPack({
|
||||
name: "Super pack",
|
||||
@@ -60,6 +63,7 @@ describe("lib/data/ModPack", function() {
|
||||
"string-setting": { "value": "a string" },
|
||||
},
|
||||
},
|
||||
export_manifest: { assets: { setting: "settings.json" }},
|
||||
deleted: true,
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user