Fix: position du calendrier par défaut
calendrier positionné indépendamment par user default setting pour la position initiale
This commit is contained in:
parent
2e256d88da
commit
c49fdb2903
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user