Reset des nombre astraux

This commit is contained in:
sladecraven 2021-04-25 09:43:26 +02:00
parent cc8f432746
commit 020824af7e
3 changed files with 19 additions and 3 deletions

View File

@ -9,6 +9,7 @@ export class RdDAstrologieEditeur extends Dialog {
constructor(html, calendrier, calendrierData) {
let myButtons = {
resetButton: { label: "Re-tirer les nombres astraux", callback: html => this.resetNombreAstraux() },
saveButton: { label: "Fermer", callback: html => this.fillData() }
};
@ -21,7 +22,15 @@ export class RdDAstrologieEditeur extends Dialog {
this.updateData( calendrierData );
}
/* -------------------------------------------- */
/* -------------------------------------------- */
resetNombreAstraux() {
game.system.rdd.calendrier.resetNombreAstral();
game.system.rdd.calendrier.rebuildListeNombreAstral();
game.system.rdd.calendrier.showAstrologieEditor();
}
/* -------------------------------------------- */
fillData( ) {
}

View File

@ -135,6 +135,12 @@ export class RdDCalendrier extends Application {
return astralData?.nombreAstral ?? "N/A";
}
/* -------------------------------------------- */
resetNombreAstral( ) {
this.listeNombreAstral = [];
game.settings.set("foundryvtt-reve-de-dragon", "liste-nombre-astral", this.listeNombreAstral);
}
/* -------------------------------------------- */
rebuildListeNombreAstral() {
let jourCourant = this.getCurrentDayIndex();
@ -150,6 +156,7 @@ export class RdDCalendrier extends Application {
this.listeNombreAstral = newList;
game.settings.set("foundryvtt-reve-de-dragon", "liste-nombre-astral", this.listeNombreAstral);
}
/* -------------------------------------------- */
onCalendarButton(ev) {
ev.preventDefault();
@ -390,7 +397,7 @@ export class RdDCalendrier extends Application {
}
astrologieArray.push(duplicate(astralData));
}
//console.log("ASTRO", astrologieArray);
//console.log("ASTRO", astrologieArray);
calendrierData.astrologieData = astrologieArray;
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/calendar-astrologie-template.html', calendrierData);
let astrologieEditeur = new RdDAstrologieEditeur(html, this, calendrierData)

View File

@ -2,7 +2,7 @@
"name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"description": "Rêve de Dragon RPG for FoundryVTT",
"version": "1.3.52",
"version": "1.3.53",
"manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.9",