forked from public/foundryvtt-reve-de-dragon
Utilisation de system dans les Item/Actor Sheet
Utilisation de system dans les data de formulaire pour tous les Item/Actor (à la base, ou les sous-éléments) Corrections sur les sorts en réserve (ce ne sont pas des Item) Petites améliorations: * `actor.itemTypes[type]` revient à faire (sans besoin de filtrer) `actor.items.filter(it => it.type == type)` * dans les ItemSheet, this.object et this.document remplacés par this.item * dans les ActorSheet, this.object et this.document remplacés par this.actor Quelques corrections en plus: * parade ne marchait pas * problèmes sur le commerce
This commit is contained in:
@ -12,23 +12,23 @@ export class RdDAstrologieJoueur extends Dialog {
|
||||
/* -------------------------------------------- */
|
||||
static async create(actor, dialogConfig) {
|
||||
|
||||
let data = {
|
||||
let dialogData = {
|
||||
nombres: this.organizeNombres(actor),
|
||||
dates: game.system.rdd.calendrier.getJoursSuivants(10),
|
||||
etat: actor.getEtatGeneral(),
|
||||
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
|
||||
astrologie: RdDItemCompetence.findCompetence(actor.items, 'Astrologie')
|
||||
}
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', data);
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', dialogData);
|
||||
let options = { classes: ["rdddialog"], width: 600, height: 500, 'z-index': 99999 };
|
||||
if (dialogConfig.options) {
|
||||
mergeObject(options, dialogConfig.options, { overwrite: true });
|
||||
}
|
||||
return new RdDAstrologieJoueur(html, actor, data);
|
||||
return new RdDAstrologieJoueur(html, actor, dialogData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(html, actor, data) {
|
||||
constructor(html, actor, dialogData) {
|
||||
|
||||
let myButtons = {
|
||||
saveButton: { label: "Fermer", callback: html => this.quitDialog() }
|
||||
@ -41,7 +41,7 @@ export class RdDAstrologieJoueur extends Dialog {
|
||||
super(dialogConf, dialogOptions);
|
||||
|
||||
this.actor = actor;
|
||||
this.dataNombreAstral = duplicate(data);
|
||||
this.dataNombreAstral = duplicate(dialogData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -63,7 +63,7 @@ export class RdDAstrologieJoueur extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
requestJetAstrologie() {
|
||||
let data = {
|
||||
let socketData = {
|
||||
id: this.actor.id,
|
||||
carac_vue: this.actor.system.carac['vue'].value,
|
||||
etat: this.dataNombreAstral.etat,
|
||||
@ -73,11 +73,11 @@ export class RdDAstrologieJoueur extends Dialog {
|
||||
userId: game.user.id
|
||||
}
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
game.system.rdd.calendrier.requestNombreAstral(data);
|
||||
game.system.rdd.calendrier.requestNombreAstral(socketData);
|
||||
} else {
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||
msg: "msg_request_nombre_astral",
|
||||
data: data
|
||||
data: socketData
|
||||
});
|
||||
}
|
||||
this.close();
|
||||
|
Reference in New Issue
Block a user