Lecture des signes draconiques

This commit is contained in:
Vincent Vandemeulebrouck
2021-05-10 19:18:11 +02:00
parent a0f1c36dc6
commit ef08dbeb97
7 changed files with 185 additions and 44 deletions

View File

@ -183,22 +183,25 @@ export class RdDTMRDialog extends Dialog {
async activateListeners(html) {
super.activateListeners(html);
HtmlUtility._showControlWhen($(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue"));
document.getElementById("tmrrow1").insertCell(0).append(this.pixiApp.view);
if (this.viewOnly) {
html.find('#lancer-sort').remove();
}
else {
// Roll Sort
html.find('#lancer-sort').click((event) => {
this.actor.rollUnSort(Misc.data(this.actor).data.reve.tmrpos.coord);
});
}
if (this.viewOnly) {
html.find('.lancer-sort').remove();
html.find('.lire-signe-draconique').remove();
return;
}
HtmlUtility._showControlWhen($(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue"));
HtmlUtility._showControlWhen($(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(this._getActorCoord()));
// Roll Sort
html.find('.lancer-sort').click((event) => {
this.actor.rollUnSort(this._getActorCoord());
});
html.find('.lire-signe-draconique').click((event) => {
this.actor.rollLireSigneDraconique(this._getActorCoord());
});
html.find('#dir-top').click((event) => {
this.moveFromKey("top");
});
@ -235,6 +238,9 @@ export class RdDTMRDialog extends Dialog {
/* -------------------------------------------- */
updateValuesDisplay() {
Array.from(document.getElementsByClassName("lire-signe-draconique"))
.forEach(it => HtmlUtility._showControlWhen(it, this.actor.isResonanceSigneDraconique(this._getActorCoord())));
let ptsreve = document.getElementById("tmr-pointsreve-value");
const actorData = Misc.data(this.actor);
ptsreve.innerHTML = actorData.data.reve.reve.value;