From 713ab3fa00676d7f39ac17f3ad18e78e700693b8 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sun, 29 Sep 2024 00:04:45 -0600 Subject: [PATCH] Make dev settings show in the config when in localhost --- src/settings/dev_settings.mjs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/settings/dev_settings.mjs b/src/settings/dev_settings.mjs index 229775c..80235b1 100644 --- a/src/settings/dev_settings.mjs +++ b/src/settings/dev_settings.mjs @@ -1,16 +1,25 @@ export function registerDevSettings() { + const isLocalhost = window.location.hostname === `localhost`; + game.settings.register(game.system.id, `devMode`, { + name: `Dev Mode?`, scope: `client`, type: Boolean, - config: false, + config: isLocalhost, default: false, - requiresReload: true, + requiresReload: false, }); game.settings.register(game.system.id, `defaultTab`, { + name: `Default Sidebar Tab`, scope: `client`, type: String, - config: false, + config: isLocalhost, 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.`); + } + }, }); };