Add setting to prevent the UserConfig from opening on loading Foundry (closes #9)

This commit is contained in:
Eldritch-Oliver 2025-11-22 16:46:45 -07:00
parent c626c981aa
commit 857aca3423
5 changed files with 46 additions and 5 deletions

View file

@ -1,10 +1,12 @@
import { __ID } from "../consts.mjs";
import { chatSidebarBackground } from "../settings/chatSidebarBackground.mjs";
import { preventUserConfigOpen } from "../settings/preventUserConfigOpen.mjs";
import { startSidebarExpanded } from "../settings/startSidebarExpanded.mjs";
Hooks.once(`init`, () => {
console.log(`${__ID} | Initializing`);
startSidebarExpanded.register();
chatSidebarBackground.register();
preventUserConfigOpen.register();
startSidebarExpanded.register();
});

View file

@ -0,0 +1,12 @@
import { preventUserConfigOpen } from "../settings/preventUserConfigOpen.mjs";
// #region Once
Hooks.once(`renderUserConfig`, (app, element) => {
// MARK: Prevent Unready Open
if (!game.ready && preventUserConfigOpen.value()) {
element.style.display = `none`;
app.close();
};
});
// #endregion Once