Add a dev mode setting that auto-switches the sidebar tab when reloading

This commit is contained in:
Oliver-Akins 2024-01-06 23:30:52 -07:00
parent 16a714868e
commit 911db1007a
2 changed files with 17 additions and 0 deletions

View file

@ -60,4 +60,14 @@ Hooks.once(`init`, () => {
Hooks.once(`ready`, () => {
console.debug(".dungeon | Ready");
if (game.settings.get(`dotdungeon`, `devMode`)) {
let tab = game.settings.get(`dotdungeon`, `defaultTab`);
if (!ui.sidebar?.tabs?.[tab]) {
console.error(`Couldn't find a sidebar tab with ID:`, tab);
} else {
console.debug(`Switching sidebar tab to:`, tab);
ui.sidebar.tabs[tab].activate();
};
};
});