diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index e08a0dc4..bd9d0dda 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -58,13 +58,17 @@ export class RdDCalendrier extends Application { } // nombre astral if ( game.user.isGM) { - this.listeNombreAstral = duplicate(game.settings.get("foundryvtt-reve-de-dragon", "liste-nombre-astral")); + this.listeNombreAstral = this._loadListNombreAstral(); this.rebuildListeNombreAstral(); // Ensure always up-to-date } console.log(this.calendrier, this.calendrierPos, this.listeNombreAstral); } + _loadListNombreAstral() { + return Object.values(game.settings.get("foundryvtt-reve-de-dragon", "liste-nombre-astral")); + } + /* -------------------------------------------- */ static get defaultOptions() { const options = super.defaultOptions; @@ -114,7 +118,7 @@ export class RdDCalendrier extends Application { /* -------------------------------------------- */ getNombreAstral( index ) { - const liste = this.listeNombreAstral || game.settings.get("foundryvtt-reve-de-dragon", "liste-nombre-astral") + const liste = this.listeNombreAstral || this._loadListNombreAstral(); let astralData = liste.find( (nombreAstral, i) => nombreAstral.index == index ); return astralData.nombreAstral || "N/A"; }