Reformat with prettier

This commit is contained in:
Manuel Vögele
2022-09-28 07:35:16 +02:00
parent 71424cd284
commit 5e82049686
19 changed files with 956 additions and 710 deletions
+12 -12
View File
@@ -1,26 +1,24 @@
import {RightClickAction, settingsKey} from "./settings.js"
import {RightClickAction, settingsKey} from "./settings.js";
const currentDataVersion = "1.10.0"
const currentDataVersion = "1.10.0";
export async function performMigrations() {
if (game.user.isGM)
await performWorldMigraionts()
await performClientMigrations()
if (game.user.isGM) await performWorldMigraionts();
await performClientMigrations();
}
async function performWorldMigraionts() {
let dataVersion = game.settings.get(settingsKey, "dataVersion");
if (dataVersion === currentDataVersion)
return;
if (dataVersion === currentDataVersion) return;
if (dataVersion === "fresh install") {
game.settings.set(settingsKey, "dataVersion", currentDataVersion)
return
game.settings.set(settingsKey, "dataVersion", currentDataVersion);
return;
}
if (dataVersion === "1.3.0") {
dataVersion = "1.10.0"
dataVersion = "1.10.0";
}
game.settings.set(settingsKey, "dataVersion", dataVersion);
@@ -31,13 +29,15 @@ async function performClientMigrations() {
if (dataVersion === "fresh install") {
// Start of migration from unnamed version (< 1.10.0). TODO Remove in a future version
const swapSpacebarRightClick = game.settings.storage.get("client").getItem(`${settingsKey}.swapSpacebarRightClick`);
const swapSpacebarRightClick = game.settings.storage
.get("client")
.getItem(`${settingsKey}.swapSpacebarRightClick`);
if (swapSpacebarRightClick) {
game.settings.set(settingsKey, "rightClickAction", RightClickAction.CREATE_WAYPOINT);
await game.keybindings.set(settingsKey, "createWaypoint", []);
await game.keybindings.set(settingsKey, "deleteWaypoint", [{key: "Space"}]);
}
// End of migration from unnamed version
game.settings.set(settingsKey, "clientDataVersion", currentDataVersion)
game.settings.set(settingsKey, "clientDataVersion", currentDataVersion);
}
}