diff --git a/.changeset/yellow-tips-beg.md b/.changeset/yellow-tips-beg.md new file mode 100644 index 00000000..1edeefa4 --- /dev/null +++ b/.changeset/yellow-tips-beg.md @@ -0,0 +1,5 @@ +--- +"forbidden-lands": patch +--- + +Backported the Dark mode setting to v11 as it was only native to v12 diff --git a/lang/en.json b/lang/en.json index 0c76cace..f9ac2340 100644 --- a/lang/en.json +++ b/lang/en.json @@ -377,8 +377,8 @@ "ROLL.STANDING_DODGE": "Standing dodge", "ROLL_MODIFIER.SELECT": "Please select a modifier", "SCENE.RENDER": "Toggle scene", - "SETTINGS.DARKMODE": "Dark Mode (Experimental)", - "SETTINGS.DARKMODE_HINT": "Set sheets to display in dark grey instead of white. This is an experimental feature and may give poor contrast with some sheets or UI controls.", + "SETTINGS.DARKMODE": "Dark Mode", + "SETTINGS.DARKMODE_HINT": "Set sheets to display in sepia instead of white.", "SETTINGS.REMOVEBORDERS": "Remove borders", "SETTINGS.REMOVEBORDERS_HINT": "Remove borders from the sheets to give a more minimalistic look (also improves compatibility with certain modules).", "SHEET.CLOSE": "Close", diff --git a/src/forbidden-lands.ts b/src/forbidden-lands.ts index 4def2962..396d4d1d 100644 --- a/src/forbidden-lands.ts +++ b/src/forbidden-lands.ts @@ -75,6 +75,9 @@ Hooks.once("init", () => { // Remove borders if the setting is enabled if (game.settings.get("forbidden-lands", "removeBorders")) $("html").addClass("no-borders"); + + if (game.settings.get("forbidden-lands", "darkmode")) + $("body").addClass("theme-dark"); }); Hooks.once("ready", () => { diff --git a/src/system/core/settings.js b/src/system/core/settings.js index 76dad6b7..13f59624 100644 --- a/src/system/core/settings.js +++ b/src/system/core/settings.js @@ -319,6 +319,16 @@ export default function registerSettings() { /* -------------------------------------------- */ /* Visible */ /* -------------------------------------------- */ + if (Number(game.version?.slice(0, 2)) < 12) + game.settings.register("forbidden-lands", "darkmode", { + name: "SETTINGS.DARKMODE", + hint: "SETTINGS.DARKMODE_HINT", + scope: "client", + config: true, + default: false, + requiresReload: true, + type: Boolean, + }); game.settings.register("forbidden-lands", "removeBorders", { name: "SETTINGS.REMOVEBORDERS",