Add the ability to add/remove a chat background (Closes #1)
This commit is contained in:
parent
529aa72bdf
commit
c626c981aa
7 changed files with 60 additions and 3 deletions
35
module/settings/chatSidebarBackground.mjs
Normal file
35
module/settings/chatSidebarBackground.mjs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { __ID, inDev } from "../consts.mjs";
|
||||
|
||||
const key = `chatSidebarBackground`;
|
||||
|
||||
const config = {
|
||||
name: `OFT.setting.${key}.name`,
|
||||
hint: `OFT.setting.${key}.hint`,
|
||||
scope: `user`,
|
||||
type: Boolean,
|
||||
default: true,
|
||||
config: true,
|
||||
requiresReload: false,
|
||||
onChange: (newValue) => {
|
||||
if (inDev()) {
|
||||
console.log(`${__ID} | setting:${key} | Setting to: ${newValue}`);
|
||||
};
|
||||
document.body.classList.toggle(`oft-${key}`, newValue);
|
||||
},
|
||||
};
|
||||
|
||||
export const chatSidebarBackground = {
|
||||
value() {
|
||||
return game.settings.get(__ID, key);
|
||||
},
|
||||
register() {
|
||||
game.settings.register(__ID, key, config);
|
||||
|
||||
if (this.value()) {
|
||||
if (inDev()) {
|
||||
console.log(`${__ID} | setting:${key} | Adding chat background`);
|
||||
};
|
||||
document.body.classList.add(`oft-${key}`);
|
||||
};
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue