35 lines
768 B
JavaScript
35 lines
768 B
JavaScript
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}`);
|
|
};
|
|
},
|
|
};
|