Update the startSidebarExpanded setting to bring it inline with the rest of the settings
This commit is contained in:
parent
f40d9f9381
commit
9875d49181
5 changed files with 36 additions and 42 deletions
|
|
@ -1,22 +1,29 @@
|
|||
import { __ID } from "../consts.mjs";
|
||||
import { Logger } from "../utils/Logger.mjs";
|
||||
|
||||
const key = `startSidebarExpanded`;
|
||||
|
||||
const config = {
|
||||
name: `OFT.setting.${key}.name`,
|
||||
hint: `OFT.setting.${key}.hint`,
|
||||
scope: `user`,
|
||||
type: Boolean,
|
||||
default: true,
|
||||
config: true,
|
||||
requiresReload: false,
|
||||
};
|
||||
export function startSidebarExpanded() {
|
||||
Logger.log(`Registering setting: ${key}`);
|
||||
|
||||
export const startSidebarExpanded = {
|
||||
value() {
|
||||
return game.settings.get(__ID, key);
|
||||
},
|
||||
register() {
|
||||
game.settings.register(__ID, key, config);
|
||||
},
|
||||
// #region Registration
|
||||
game.settings.register(__ID, key, {
|
||||
name: `OFT.setting.${key}.name`,
|
||||
hint: `OFT.setting.${key}.hint`,
|
||||
scope: `user`,
|
||||
type: Boolean,
|
||||
default: true,
|
||||
config: true,
|
||||
requiresReload: false,
|
||||
});
|
||||
// #endregion Registration
|
||||
|
||||
// #region Implementation
|
||||
Hooks.once(`renderSidebar`, (app) => {
|
||||
if (game.settings.get(__ID, key) && !game.ready) {
|
||||
Logger.debug(`setting:${key} | Expanding sidebar`);
|
||||
app.toggleExpanded(true);
|
||||
};
|
||||
});
|
||||
// #endregion Implementation
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue