ds4/src/module/settings.ts

49 lines
1.4 KiB
TypeScript
Raw Normal View History

2021-06-26 22:02:00 +02:00
// SPDX-FileCopyrightText: 2021 Johannes Loher
//
// SPDX-License-Identifier: MIT
export function registerSystemSettings(): void {
/**
2021-01-20 22:11:53 +01:00
* Track the migrations version of the latest migration that has been applied
*/
game.settings.register("ds4", "systemMigrationVersion", {
name: "System Migration Version",
scope: "world",
config: false,
2021-01-20 22:11:53 +01:00
type: Number,
default: -1,
});
2021-03-18 08:52:02 +01:00
game.settings.register("ds4", "useSlayingDiceForAutomatedChecks", {
name: "DS4.SettingUseSlayingDiceForAutomatedChecksName",
hint: "DS4.SettingUseSlayingDiceForAutomatedChecksHint",
scope: "world",
config: true,
type: Boolean,
default: false,
});
2021-05-13 15:41:00 +02:00
game.settings.register("ds4", "showSlayerPoints", {
name: "DS4.SettingShowSlayerPointsName",
hint: "DS4.SettingShowSlayerPointsHint",
scope: "world",
config: true,
type: Boolean,
default: false,
});
}
2021-06-30 13:42:20 +02:00
export interface DS4Settings {
2021-05-13 15:41:00 +02:00
systemMigrationVersion: number;
useSlayingDiceForAutomatedChecks: boolean;
showSlayerPoints: boolean;
}
export function getDS4Settings(): DS4Settings {
return {
systemMigrationVersion: game.settings.get("ds4", "systemMigrationVersion"),
useSlayingDiceForAutomatedChecks: game.settings.get("ds4", "useSlayingDiceForAutomatedChecks"),
showSlayerPoints: game.settings.get("ds4", "showSlayerPoints"),
};
}