Rename loot and equipment
This commit is contained in:
parent
dacce1b29d
commit
343a888b68
13 changed files with 267 additions and 128 deletions
|
@ -1,4 +1,6 @@
|
|||
import { migrate as migrate001 } from "./migrations/001";
|
||||
import { migrate as migrate002 } from "./migrations/002";
|
||||
import notifications from "./ui/notifications";
|
||||
|
||||
async function migrate(): Promise<void> {
|
||||
if (!game.user?.isGM) {
|
||||
|
@ -25,7 +27,7 @@ async function migrateFromTo(oldMigrationVersion: number, targetMigrationVersion
|
|||
const migrationsToExecute = migrations.slice(oldMigrationVersion, targetMigrationVersion);
|
||||
|
||||
if (migrationsToExecute.length > 0) {
|
||||
ui.notifications?.info(
|
||||
notifications.info(
|
||||
game.i18n.format("DS4.InfoSystemUpdateStart", {
|
||||
currentVersion: oldMigrationVersion,
|
||||
targetVersion: targetMigrationVersion,
|
||||
|
@ -40,7 +42,7 @@ async function migrateFromTo(oldMigrationVersion: number, targetMigrationVersion
|
|||
await migration();
|
||||
game.settings.set("ds4", "systemMigrationVersion", currentMigrationVersion);
|
||||
} catch (err) {
|
||||
ui.notifications?.error(
|
||||
notifications.error(
|
||||
game.i18n.format("DS4.ErrorDuringMigration", {
|
||||
currentVersion: oldMigrationVersion,
|
||||
targetVersion: targetMigrationVersion,
|
||||
|
@ -54,7 +56,7 @@ async function migrateFromTo(oldMigrationVersion: number, targetMigrationVersion
|
|||
}
|
||||
}
|
||||
|
||||
ui.notifications?.info(
|
||||
notifications.info(
|
||||
game.i18n.format("DS4.InfoSystemUpdateCompleted", {
|
||||
currentVersion: oldMigrationVersion,
|
||||
targetVersion: targetMigrationVersion,
|
||||
|
@ -68,7 +70,7 @@ function getTargetMigrationVersion(): number {
|
|||
return migrations.length;
|
||||
}
|
||||
|
||||
const migrations: Array<() => Promise<void>> = [migrate001];
|
||||
const migrations: Array<() => Promise<void>> = [migrate001, migrate002];
|
||||
|
||||
function isFirstWorldStart(migrationVersion: number): boolean {
|
||||
return migrationVersion < 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue