From 23d192fdbb5bc26f205b48f7dad497efe33798f0 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 8 Jun 2021 14:11:23 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20position=20du=20calendrier=20par=20d?= =?UTF-8?q?=C3=A9faut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit calendrier positionné indépendamment par user default setting pour la position initiale --- module/rdd-calendrier.js | 7 ++++--- module/rdd-main.js | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index 473106fa..6f385db4 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -37,6 +37,9 @@ const MAX_NOMBRE_ASTRAL = 12; /* -------------------------------------------- */ export class RdDCalendrier extends Application { + static createCalendrierPos() { + return { top: 200, left: 200 }; + } static getCalendrier(index) { let calendrier = { @@ -67,9 +70,7 @@ export class RdDCalendrier extends Application { // position this.calendrierPos = duplicate(game.settings.get("foundryvtt-reve-de-dragon", "calendrier-pos")); if (this.calendrierPos == undefined || this.calendrierPos.top == undefined) { - this.calendrierPos = {}; - this.calendrierPos.top = 200; - this.calendrierPos.left = 200; + this.calendrierPos = RdDCalendrier.createCalendrierPos(); if (game.user.isGM) { // Uniquement si GM game.settings.set("foundryvtt-reve-de-dragon", "calendrier-pos", this.calendrierPos); } diff --git a/module/rdd-main.js b/module/rdd-main.js index 014a53e9..9cc02aa1 100644 --- a/module/rdd-main.js +++ b/module/rdd-main.js @@ -88,8 +88,9 @@ Hooks.once("init", async function () { /* -------------------------------------------- */ game.settings.register("foundryvtt-reve-de-dragon", "calendrier-pos", { name: "calendrierPos", - scope: "world", + scope: "client", config: false, + default: RdDCalendrier.createCalendrierPos(), type: Object });