diff --git a/assets/img/ivory-off-white-paper-texture.jpg b/assets/img/ivory-off-white-paper-texture.jpg new file mode 100644 index 0000000..9ef14c3 Binary files /dev/null and b/assets/img/ivory-off-white-paper-texture.jpg differ diff --git a/css/deltagreen.css b/css/deltagreen.css index ba85fda..aabed75 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -39,6 +39,13 @@ section.window-content{ } */ +.old-paper-background{ + background: url("../assets/img/old_paper.jpg") !important; +} +.default-parchment-background{ + background: url("/ui/parchment.jpg") repeat !important; +} + .typewriter-condensed-font{ font-family: "TypeWriterCondensed", sans-serif !important; } diff --git a/module/deltagreen.js b/module/deltagreen.js index 31fc38b..32e3087 100644 --- a/module/deltagreen.js +++ b/module/deltagreen.js @@ -35,8 +35,8 @@ Hooks.once('init', async function() { // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); - Actors.registerSheet("deltagreen", DeltaGreenActorSheet, { makeDefault: true }); Items.unregisterSheet("core", ItemSheet); + Actors.registerSheet("deltagreen", DeltaGreenActorSheet, { makeDefault: true }); Items.registerSheet("deltagreen", DeltaGreenItemSheet, { makeDefault: true }); // Preload Handlebars Templates @@ -139,6 +139,35 @@ Hooks.once("ready", async function() { Hooks.on("hotbarDrop", (bar, data, slot) => createDeltaGreenMacro(data, slot)); }); +Hooks.on("ready", ()=> { + + let backgroundImageSetting = game.settings.get("deltagreen", "characterSheetBackgroundImageSetting"); + + let customCss = ""; + + let customStyle = document.createElement("style"); + customStyle.id = "dg-custom-css"; + + if(backgroundImageSetting === "OldPaper1"){ + customCss += `section.window-content{ + background: url("systems/deltagreen/assets/img/old_paper.jpg") !important; + }`; + } + else if(backgroundImageSetting === "IvoryPaper"){ + customCss += `section.window-content{ + background: url("systems/deltagreen/assets/img/ivory-off-white-paper-texture.jpg") !important; + background-size: 100% !important; + }`; + } + + customStyle.innerHTML = customCss; + + if(customCss != ""){ + document.querySelector("head").appendChild(customStyle); + } + +}); + /* -------------------------------------------- */ /* Hotbar Macros */ /* -------------------------------------------- */ diff --git a/module/settings.js b/module/settings.js index 16a0384..3c7d3a4 100644 --- a/module/settings.js +++ b/module/settings.js @@ -6,14 +6,31 @@ export const registerSystemSettings = function() { config: true, // This specifies that the setting appears in the configuration view type: String, choices: { // If choices are defined, the resulting setting will be a select menu - "TypeWriterCondensed": "Condensed Typewriter", - "atwriter": "Another Typewriter", - "Martel": "Martel", - "Signika": "Signika" + "TypeWriterCondensed": "Condensed Typewriter (Modern, small typewriter font)", + "atwriter": "Another Typewriter (Older-style typewriter font)", + "Martel": "Martel (Delta Green system default)", + "Signika": "Signika (Foundry Default Font)" }, - default: "TypeWriterCondensed", // The default value for the setting + default: "Martel", // The default value for the setting onChange: value => { // A callback function which triggers when the setting is changed - console.log(value) + //console.log(value) } }); + + game.settings.register('deltagreen', 'characterSheetBackgroundImageSetting', { + name: "World Sheet Background Image", + hint: "Choose background image for use throughout this world. (Refresh page to see change.)", + scope: "world", // This specifies a world-stored setting + config: true, // This specifies that the setting appears in the configuration view + type: String, + choices: { // If choices are defined, the resulting setting will be a select menu + "DefaultParchment": "Default Parchment", + "OldPaper1": "Old Dirty Paper", + "IvoryPaper": "Ivory White Paper" + }, + default: "IvoryPaper", // The default value for the setting + onChange: value => { // A callback function which triggers when the setting is changed + //console.log(value) + } + }); } \ No newline at end of file