Attribute Item Subtype #76
2 changed files with 14 additions and 3 deletions
|
|
@ -26,6 +26,7 @@ export async function migrateTo3_0_0() {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Migrating world actors
|
||||||
worldOperations.push(
|
worldOperations.push(
|
||||||
...await migrateCollection(
|
...await migrateCollection(
|
||||||
game.actors,
|
game.actors,
|
||||||
|
|
@ -36,6 +37,7 @@ export async function migrateTo3_0_0() {
|
||||||
);
|
);
|
||||||
warning.update({ pct: 0.25 });
|
warning.update({ pct: 0.25 });
|
||||||
|
|
||||||
|
// Migrating all of the relevant compendiums
|
||||||
for (const pack of packsToMigrate) {
|
for (const pack of packsToMigrate) {
|
||||||
await pack.getDocuments();
|
await pack.getDocuments();
|
||||||
|
|
||||||
|
|
@ -57,11 +59,20 @@ export async function migrateTo3_0_0() {
|
||||||
|
|
||||||
compendiumOperations = [];
|
compendiumOperations = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
warning.update({ pct: 0.8 });
|
warning.update({ pct: 0.8 });
|
||||||
|
|
||||||
await foundry.documents.modifyBatch(worldOperations);
|
// Migrating the world setting
|
||||||
|
const defaultAttrs = game.settings.get(__ID__, `actorDefaultAttributes`)?.at(0);
|
||||||
|
if (defaultAttrs) {
|
||||||
|
const itemSchemas = [];
|
||||||
|
for (const [key, attr] of Object.entries(defaultAttrs)) {
|
||||||
|
itemSchemas.push(convertToItem(key, attr));
|
||||||
|
};
|
||||||
|
await game.settings.set(__ID__, `actorDefaultAttributes`, itemSchemas);
|
||||||
|
};
|
||||||
|
warning.update({ pct: 0.9 });
|
||||||
|
|
||||||
|
await foundry.documents.modifyBatch(worldOperations);
|
||||||
finishMigrationWarning(warning, `3.0.0`);
|
finishMigrationWarning(warning, `3.0.0`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ export function registerWorldSettings() {
|
||||||
|
|
||||||
game.settings.register(__ID__, `actorDefaultAttributes`, {
|
game.settings.register(__ID__, `actorDefaultAttributes`, {
|
||||||
config: false,
|
config: false,
|
||||||
type: Object,
|
type: Array,
|
||||||
scope: `world`,
|
scope: `world`,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue