Affichage niveau min necessaire #188

This commit is contained in:
sladecraven 2021-05-28 09:37:22 +02:00
parent f22622710a
commit e2139f41b0
3 changed files with 12 additions and 8 deletions

View File

@ -3010,6 +3010,7 @@ export class RdDActor extends Actor {
pointsReve: this.getReveActuel(), pointsReve: this.getReveActuel(),
isRapide: isRapide isRapide: isRapide
} }
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html', tmrFormData); let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html', tmrFormData);
this.currentTMR = await RdDTMRDialog.create(html, this, tmrFormData); this.currentTMR = await RdDTMRDialog.create(html, this, tmrFormData);
this.currentTMR.render(true); this.currentTMR.render(true);
@ -3923,6 +3924,7 @@ export class RdDActor extends Actor {
if (status) { if (status) {
await this.addStatusEffect(demiReve) await this.addStatusEffect(demiReve)
} else { } else {
console.log("Delete from here ....");
await this.deleteStatusEffect(demiReve) await this.deleteStatusEffect(demiReve)
} }
} }
@ -3951,7 +3953,7 @@ export class RdDActor extends Actor {
const ids = Array.from(this.effects?.values()) const ids = Array.from(this.effects?.values())
.filter(it => it.data.flags.core?.statusId == id) .filter(it => it.data.flags.core?.statusId == id)
.map(it => it.id); .map(it => it.id);
//console.log("Delete effect IDS1: ", this.effects, ids); console.log("Delete effect IDS1: ", this.effects, ids);
if (ids.length > 0) { if (ids.length > 0) {
await this.deleteEmbeddedDocuments('ActiveEffect', ids); await this.deleteEmbeddedDocuments('ActiveEffect', ids);
} }
@ -3962,7 +3964,7 @@ export class RdDActor extends Actor {
const ids = Array.from(this.effects?.values()) const ids = Array.from(this.effects?.values())
.filter(it => StatusEffects.statusId(it.data) == StatusEffects.statusId(effect)) .filter(it => StatusEffects.statusId(it.data) == StatusEffects.statusId(effect))
.map(it => it.id); .map(it => it.id);
//console.log("Delete effect 1: ", this.effects, ids); console.log("Delete effect 1: ", this.effects, ids);
if (ids.length > 0) { if (ids.length > 0) {
await this.deleteEmbeddedDocuments('ActiveEffect', ids); await this.deleteEmbeddedDocuments('ActiveEffect', ids);
} }

View File

@ -270,12 +270,14 @@ export class RdDTMRDialog extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
close() { close() {
this.actor.tmrApp = undefined; // Cleanup reference if ( this.actor.tmrApp ) {
if ( !this.viewOnly ) { this.actor.tmrApp = undefined; // Cleanup reference
this.actor.setStatusDemiReve(); if ( !this.viewOnly ) {
this._tellToGM(this.actor.name + " a quitté les terres médianes"); this.actor.setStatusDemiReve(false);
this._tellToGM(this.actor.name + " a quitté les terres médianes");
}
this.actor.santeIncDec("fatigue", this.cumulFatigue).then(super.close()); // moving 1 cell costs 1 fatigue
} }
this.actor.santeIncDec("fatigue", this.cumulFatigue).then(super.close()); // moving 1 cell costs 1 fatigue
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

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.4.11", "version": "1.4.12",
"manifestPlusVersion": "1.0.0", "manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "0.8.0", "minimumCoreVersion": "0.8.0",
"compatibleCoreVersion": "0.8.5", "compatibleCoreVersion": "0.8.5",