added setting options for chaning sheet background

This commit is contained in:
TheLastScrub
2021-03-21 00:04:40 -07:00
parent e6ef2cd34e
commit 4ebde111ca
4 changed files with 60 additions and 7 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

+7
View File
@@ -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;
}
+30 -1
View File
@@ -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 */
/* -------------------------------------------- */
+23 -6
View File
@@ -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)
}
});
}