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

View File

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

View File

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