Add a dev mode setting that auto-switches the sidebar tab when reloading
This commit is contained in:
parent
16a714868e
commit
911db1007a
2 changed files with 17 additions and 0 deletions
|
|
@ -60,4 +60,14 @@ Hooks.once(`init`, () => {
|
||||||
|
|
||||||
Hooks.once(`ready`, () => {
|
Hooks.once(`ready`, () => {
|
||||||
console.debug(".dungeon | 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();
|
||||||
|
};
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
@ -6,4 +6,11 @@ export default function() {
|
||||||
default: false,
|
default: false,
|
||||||
requiresReload: false,
|
requiresReload: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
game.settings.register(`dotdungeon`, `defaultTab`, {
|
||||||
|
scope: `client`,
|
||||||
|
type: String,
|
||||||
|
config: false,
|
||||||
|
requiresReload: false,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue