diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index 0053d319..03fb26a5 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -45,6 +45,14 @@ export class RdDCalendrier extends Application { Hooks.on('updateSetting', async (setting, update, options, id) => this.onUpdateSetting(setting, update, options, id)); } + display() { + let templatePath = "systems/foundryvtt-reve-de-dragon/templates/calendar-template.html"; + renderTemplate(templatePath, {}).then(html => { + this.render(true); + }); + return this; + } + async onUpdateSetting(setting, update, options, id) { if (setting.key == SYSTEM_RDD + '.' + WORLD_TIMESTAMP_SETTING) { this.timestamp = RdDTimestamp.getWorldTime(); diff --git a/module/rdd-main.js b/module/rdd-main.js index 81f12111..d25d622e 100644 --- a/module/rdd-main.js +++ b/module/rdd-main.js @@ -278,6 +278,7 @@ export class SystemReveDeDragon { } if (Misc.isUniqueConnectedGM()) { + game.system.rdd.calendrier = new RdDCalendrier(); new Migrations().migrate(); } @@ -286,13 +287,7 @@ export class SystemReveDeDragon { RdDDice.onReady(); /* -------------------------------------------- */ /* Affiche/Init le calendrier */ - let calendrier = new RdDCalendrier(); - let templatePath = "systems/foundryvtt-reve-de-dragon/templates/calendar-template.html"; - let templateData = {}; - renderTemplate(templatePath, templateData).then(html => { - calendrier.render(true); - }); - game.system.rdd.calendrier = calendrier; // Reference; + game.system.rdd.calendrier = new RdDCalendrier().display(); // Avertissement si joueur sans personnage if (!game.user.isGM && game.user.character == undefined) {