foundry-sw5e/module/settings.js
supervj 5bb253d9c3 Update Core to 1.4.1
Update Core to 1.4.1 and internal Version to 1.4.1.R1-A8
2021-08-06 16:38:15 -04:00

156 lines
4.1 KiB
JavaScript

export const registerSystemSettings = function () {
/**
* Track the system version upon which point a migration was last applied
*/
game.settings.register("sw5e", "systemMigrationVersion", {
name: "System Migration Version",
scope: "world",
config: false,
type: String,
default: game.system.data.version
});
/**
* Register resting variants
*/
game.settings.register("sw5e", "restVariant", {
name: "SETTINGS.5eRestN",
hint: "SETTINGS.5eRestL",
scope: "world",
config: true,
default: "normal",
type: String,
choices: {
normal: "SETTINGS.5eRestPHB",
gritty: "SETTINGS.5eRestGritty",
epic: "SETTINGS.5eRestEpic"
}
});
/**
* Register diagonal movement rule setting
*/
game.settings.register("sw5e", "diagonalMovement", {
name: "SETTINGS.5eDiagN",
hint: "SETTINGS.5eDiagL",
scope: "world",
config: true,
default: "555",
type: String,
choices: {
555: "SETTINGS.5eDiagPHB",
5105: "SETTINGS.5eDiagDMG",
EUCL: "SETTINGS.5eDiagEuclidean"
},
onChange: (rule) => (canvas.grid.diagonalRule = rule)
});
/**
* Register Initiative formula setting
*/
game.settings.register("sw5e", "initiativeDexTiebreaker", {
name: "SETTINGS.5eInitTBN",
hint: "SETTINGS.5eInitTBL",
scope: "world",
config: true,
default: false,
type: Boolean
});
/**
* Require Currency Carrying Weight
*/
game.settings.register("sw5e", "currencyWeight", {
name: "SETTINGS.5eCurWtN",
hint: "SETTINGS.5eCurWtL",
scope: "world",
config: true,
default: true,
type: Boolean
});
/**
* Option to disable XP bar for session-based or story-based advancement.
*/
game.settings.register("sw5e", "disableExperienceTracking", {
name: "SETTINGS.5eNoExpN",
hint: "SETTINGS.5eNoExpL",
scope: "world",
config: true,
default: false,
type: Boolean
});
/**
* Option to automatically collapse Item Card descriptions
*/
game.settings.register("sw5e", "autoCollapseItemCards", {
name: "SETTINGS.5eAutoCollapseCardN",
hint: "SETTINGS.5eAutoCollapseCardL",
scope: "client",
config: true,
default: false,
type: Boolean,
onChange: (s) => {
ui.chat.render();
}
});
/**
* Option to allow GMs to restrict polymorphing to GMs only.
*/
game.settings.register("sw5e", "allowPolymorphing", {
name: "SETTINGS.5eAllowPolymorphingN",
hint: "SETTINGS.5eAllowPolymorphingL",
scope: "world",
config: true,
default: false,
type: Boolean
});
/**
* Remember last-used polymorph settings.
*/
game.settings.register("sw5e", "polymorphSettings", {
scope: "client",
default: {
keepPhysical: false,
keepMental: false,
keepSaves: false,
keepSkills: false,
mergeSaves: false,
mergeSkills: false,
keepClass: false,
keepFeats: false,
keepPowers: false,
keepItems: false,
keepBio: false,
keepVision: true,
transformTokens: true
}
});
game.settings.register("sw5e", "colorTheme", {
name: "SETTINGS.SWColorN",
hint: "SETTINGS.SWColorL",
scope: "world",
config: true,
default: "light",
type: String,
choices: {
light: "SETTINGS.SWColorLight",
dark: "SETTINGS.SWColorDark"
}
});
/**
* Option to replace imperial weight units with metric weight units.
*/
game.settings.register("sw5e", "metricWeightUnits", {
name: "SETTINGS.5eMetricN",
hint: "SETTINGS.5eMetricL",
scope: "world",
config: true,
type: Boolean,
default: false
});
};