Remove the requirement to use devmode for the tab switching to work

This commit is contained in:
Oliver-Akins 2024-01-13 01:24:26 -07:00
parent 2ba9ab2b21
commit e71d2133f2

View file

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