forked from public/foundryvtt-reve-de-dragon
Fix retour en arrière sur le calendrier
This commit is contained in:
@ -64,7 +64,7 @@ export class RdDCalendrier extends Application {
|
||||
console.log(this.calendrier, this.calendrierPos, this.listeNombreAstral);
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_loadListNombreAstral() {
|
||||
return Object.values(game.settings.get("foundryvtt-reve-de-dragon", "liste-nombre-astral"));
|
||||
}
|
||||
@ -120,6 +120,10 @@ export class RdDCalendrier extends Application {
|
||||
getNombreAstral( index ) {
|
||||
const liste = this.listeNombreAstral || this._loadListNombreAstral();
|
||||
let astralData = liste.find( (nombreAstral, i) => nombreAstral.index == index );
|
||||
if ( astralData == undefined ) {
|
||||
this.rebuildListeNombreAstral();
|
||||
astralData = liste.find( (nombreAstral, i) => nombreAstral.index == index );
|
||||
}
|
||||
return astralData.nombreAstral || "N/A";
|
||||
}
|
||||
|
||||
@ -131,7 +135,8 @@ export class RdDCalendrier extends Application {
|
||||
|
||||
// Nettoyage des nombres astraux anciens
|
||||
let jourCourant = this.getCurrentDayIndex();
|
||||
let newList = this.listeNombreAstral.filter( (nombreAstral, i) => nombreAstral.index >= jourCourant );
|
||||
let jourFin = jourCourant + 12;
|
||||
let newList = this.listeNombreAstral.filter( (nombreAstral, i) => nombreAstral && nombreAstral.index >= jourCourant && nombreAstral.index < jourFin);
|
||||
//console.log("LSTES", this.listeNombreAstral, newList );
|
||||
|
||||
let lastDay = jourCourant;
|
||||
|
Reference in New Issue
Block a user