#52 Gestion astrologie
This commit is contained in:
@ -54,19 +54,12 @@ export class RdDCalendrier extends Application {
|
||||
// nombre astral
|
||||
if ( game.user.isGM) {
|
||||
this.listeNombreAstral = duplicate(game.settings.get("foundryvtt-reve-de-dragon", "liste-nombre-astral"));
|
||||
if ( this.listeNombreAstral == undefined ) {
|
||||
this.rebuildListeNombreAstral();
|
||||
}
|
||||
this.rebuildListeNombreAstral(); // Ensure always up-to-date
|
||||
}
|
||||
console.log(this.calendrier, this.calendrierPos, this.listeNombreAstral);
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getCurrentDayIndex( ) {
|
||||
return (this.calendrier.moisRdD * 28) + this.calendrier.jour;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
@ -76,6 +69,11 @@ export class RdDCalendrier extends Application {
|
||||
return options;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getCurrentDayIndex( ) {
|
||||
return (this.calendrier.moisRdD * 28) + this.calendrier.jour;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
ajouterNombreAstral(index) {
|
||||
return {
|
||||
@ -85,6 +83,12 @@ export class RdDCalendrier extends Application {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getCurrentNombreAstral() {
|
||||
let index = this.getCurrentDayIndex();
|
||||
return this.listeNombreAstral[index].nombreAstral;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
rebuildListeNombreAstral() {
|
||||
// Auto-create if needed
|
||||
@ -215,10 +219,11 @@ export class RdDCalendrier extends Application {
|
||||
updateDisplay() {
|
||||
let data = this.fillCalendrierData( );
|
||||
// Rebuild data
|
||||
document.getElementById("calendar--move-handle").innerHTML = `Jour ${data.jourMois} de ${data.nomMois} (${data.nomSaison})`;
|
||||
document.getElementById("calendar--move-handle").innerHTML = `Jour ${data.jourMois} de ${data.nomMois} (${data.nomSaison})` + " - NA: "+this.getCurrentNombreAstral();
|
||||
document.getElementById("calendar-heure-texte").innerHTML = ` - ${data.nomHeure}`;
|
||||
document.getElementById("calendar-time").innerHTML = `${data.heuresRelative}:${data.minutesRelative}`;
|
||||
document.getElementById("calendar-icone-heure").innerHTML = data.lettreFont;
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
Reference in New Issue
Block a user