Make dev settings show in the config when in localhost
This commit is contained in:
parent
d46d727a70
commit
713ab3fa00
1 changed files with 12 additions and 3 deletions
|
|
@ -1,16 +1,25 @@
|
||||||
export function registerDevSettings() {
|
export function registerDevSettings() {
|
||||||
|
const isLocalhost = window.location.hostname === `localhost`;
|
||||||
|
|
||||||
game.settings.register(game.system.id, `devMode`, {
|
game.settings.register(game.system.id, `devMode`, {
|
||||||
|
name: `Dev Mode?`,
|
||||||
scope: `client`,
|
scope: `client`,
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
config: false,
|
config: isLocalhost,
|
||||||
default: false,
|
default: false,
|
||||||
requiresReload: true,
|
requiresReload: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
game.settings.register(game.system.id, `defaultTab`, {
|
game.settings.register(game.system.id, `defaultTab`, {
|
||||||
|
name: `Default Sidebar Tab`,
|
||||||
scope: `client`,
|
scope: `client`,
|
||||||
type: String,
|
type: String,
|
||||||
config: false,
|
config: isLocalhost,
|
||||||
requiresReload: false,
|
requiresReload: false,
|
||||||
|
onChange(value) {
|
||||||
|
if (!ui.sidebar.tabs[value]) {
|
||||||
|
ui.notifications.warn(`"${value}" cannot be found in the sidebar tabs, it may not work at reload.`);
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue