Implement delayed reload to esnure all settings are applied
This commit is contained in:
@@ -2,7 +2,11 @@ export const settingsKey = "smart-doors";
|
|||||||
|
|
||||||
function reloadGM() {
|
function reloadGM() {
|
||||||
if (game.user.isGM)
|
if (game.user.isGM)
|
||||||
location.reload()
|
delayedReload()
|
||||||
|
}
|
||||||
|
|
||||||
|
function delayedReload() {
|
||||||
|
window.setTimeout(() => location.reload(), 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function registerSettings() {
|
export function registerSettings() {
|
||||||
@@ -19,7 +23,7 @@ export function registerSettings() {
|
|||||||
config: true,
|
config: true,
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 1.5,
|
default: 1.5,
|
||||||
onChange: () => location.reload()
|
onChange: delayedReload,
|
||||||
})
|
})
|
||||||
game.settings.register(settingsKey, "highlightSecretDoors", {
|
game.settings.register(settingsKey, "highlightSecretDoors", {
|
||||||
name: "smart-doors.settings.highlightSecretDoors.name",
|
name: "smart-doors.settings.highlightSecretDoors.name",
|
||||||
|
|||||||
Reference in New Issue
Block a user