Make dev settings show in the config when in localhost

This commit is contained in:
Oliver-Akins 2024-09-29 00:04:45 -06:00
parent d46d727a70
commit 713ab3fa00

View file

@ -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.`);
}
},
}); });
}; };