#52 Travaux en progres....

This commit is contained in:
2020-12-12 23:31:19 +01:00
parent be825ffa8a
commit 808cd7296d
11 changed files with 131 additions and 20 deletions

View File

@ -1,4 +1,6 @@
import { Misc } from "./misc.js";
import { RdDCalendrier } from "./rdd-calendrier.js";
import { RdDUtility } from "./rdd-utility.js";
/**
* Extend the base Dialog entity by defining a custom window to perform roll.
@ -9,12 +11,16 @@ export class RdDAstrologieJoueur extends Dialog {
/* -------------------------------------------- */
static async create(actor, dialogConfig) {
let data = { nombres: actor.data.items.filter( (item) => item.type == 'nombreastral')
let data = { nombres: actor.data.items.filter( (item) => item.type == 'nombreastral') ,
dates: game.system.rdd.calendrier.getJoursSuivants( 10 ),
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
astrologie: RdDUtility.findCompetence( actor.data.items, 'Astrologie')
}
console.log("DATA", data);
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', data);
let options = { classes: ["rdddialog"], width: 600, height: 500, 'z-index': 99999 };
if (dialogConfig.options) {
mergeObject(options, dialogConfig.options, { overwrite: true })
mergeObject(options, dialogConfig.options, { overwrite: true });
}
return new RdDAstrologieJoueur(html, actor, data);
}
@ -23,7 +29,7 @@ export class RdDAstrologieJoueur extends Dialog {
constructor(html, actor, data ) {
let myButtons = {
saveButton: { label: "Fermer", callback: html => this.fillData() }
saveButton: { label: "Fermer", callback: html => this.fillData() }
};
// Get all n
@ -35,6 +41,24 @@ export class RdDAstrologieJoueur extends Dialog {
this.actor = actor;
this.dataNombreAstral = duplicate(data);
}
/* -------------------------------------------- */
requestJetAstrologie( ) {
let data = { id: this.actor.data._id,
carac_vue: this.actor.data.data.carac['vue'].value,
astrologie: this.dataNombreAstral.astrologie,
conditions: $("#diffConditions").val(),
date: $("#joursAstrologie").val()
}
if ( game.user.isGM) {
game.system.rdd.calendrier.requestNombreAstral( data );
} else {
game.socket.emit("system.foundryvtt-reve-de-dragon", {
msg: "msg_request_nombre_astral",
data: data
} );
}
}
/* -------------------------------------------- */
fillData() {