2023-03-07 02:28:10 +01:00
|
|
|
import { ThemeAstral } from "./sommeil/theme-astral.js";
|
2020-12-10 20:14:35 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Extend the base Dialog entity by defining a custom window to perform roll.
|
|
|
|
* @extends {Dialog}
|
|
|
|
*/
|
2023-01-07 20:06:04 +01:00
|
|
|
export class RdDAstrologieEditeur extends Dialog {
|
2020-12-10 20:14:35 +01:00
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
constructor(html, calendrier, calendrierData) {
|
2023-03-07 02:28:10 +01:00
|
|
|
let dialogConf = {
|
|
|
|
title: "Editeur d'Astrologie",
|
|
|
|
content: html,
|
|
|
|
default: "fermer",
|
|
|
|
buttons: {
|
|
|
|
fermer: { label: "Fermer", callback: html => { } }
|
|
|
|
}
|
2023-01-07 20:06:04 +01:00
|
|
|
};
|
|
|
|
let dialogOptions = {
|
2023-03-07 02:28:10 +01:00
|
|
|
classes: ["rdd-roll-dialog"],
|
|
|
|
width: 600,
|
2023-01-07 20:06:04 +01:00
|
|
|
height: 'fit-content',
|
|
|
|
'max-height': 800,
|
|
|
|
'z-index': 99999
|
|
|
|
}
|
2020-12-10 20:14:35 +01:00
|
|
|
super(dialogConf, dialogOptions)
|
2023-01-07 20:06:04 +01:00
|
|
|
|
2020-12-10 20:14:35 +01:00
|
|
|
this.calendrier = calendrier;
|
2023-01-07 20:06:04 +01:00
|
|
|
this.updateData(calendrierData);
|
2020-12-10 20:14:35 +01:00
|
|
|
}
|
|
|
|
|
2022-12-09 02:00:31 +01:00
|
|
|
activateListeners(html) {
|
|
|
|
super.activateListeners(html);
|
|
|
|
this.html = html;
|
2023-03-07 02:28:10 +01:00
|
|
|
this.html.find('[name="theme-astral"]').click(event => ThemeAstral.create());
|
|
|
|
this.html.find('[name="reset-nombres-astraux"]').click(event => this.resetNombreAstraux());
|
2022-12-09 02:00:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-01-07 20:06:04 +01:00
|
|
|
/* -------------------------------------------- */
|
2021-06-01 21:58:40 +02:00
|
|
|
async resetNombreAstraux() {
|
2021-04-25 10:08:40 +02:00
|
|
|
game.system.rdd.calendrier.resetNombreAstral();
|
2021-06-25 14:17:58 +02:00
|
|
|
await game.system.rdd.calendrier.rebuildListeNombreAstral();
|
2021-04-25 10:08:40 +02:00
|
|
|
|
|
|
|
game.system.rdd.calendrier.showAstrologieEditor();
|
2023-03-07 02:28:10 +01:00
|
|
|
this.close()
|
2021-04-25 10:08:40 +02:00
|
|
|
}
|
|
|
|
|
2020-12-10 20:14:35 +01:00
|
|
|
/* -------------------------------------------- */
|
2023-01-07 20:06:04 +01:00
|
|
|
updateData(calendrierData) {
|
2020-12-10 20:14:35 +01:00
|
|
|
this.calendrierData = duplicate(calendrierData);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|