#24 Ajouter le seuil de rêve
This commit is contained in:
parent
8aaf7770dc
commit
09f68a5c7c
@ -334,6 +334,12 @@ export class RdDActorSheet extends ActorSheet {
|
||||
this.actor.update( { "data.reve.reve": reve } );
|
||||
} );
|
||||
|
||||
// On seuil de reve change
|
||||
html.find('.seuil-reve-value').change((event) => {
|
||||
console.log("seuil-reve-value", event.currentTarget)
|
||||
this.actor.setPointsDeSeuil(event.currentTarget.value);
|
||||
} );
|
||||
|
||||
// On competence change
|
||||
html.find('.competence-xp').change((event) => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
|
@ -553,6 +553,20 @@ export class RdDActor extends Actor {
|
||||
await this.update( {"data.reve.reve": reve } );
|
||||
}
|
||||
|
||||
async updatePointDeSeuil(value=1) {
|
||||
const seuil = Misc.toInt(this.data.data.reve.seuil.value);
|
||||
const reve = Misc.toInt(this.data.data.carac.reve.value);
|
||||
if (seuil < reve) {
|
||||
await this.setPointsDeSeuil(Math.min(seuil+value, reve));
|
||||
}
|
||||
}
|
||||
|
||||
async setPointsDeSeuil( value ) {
|
||||
let seuil = duplicate(this.data.data.reve.seuil);
|
||||
seuil.value = value;
|
||||
await this.update( {"data.reve.seuil": seuil } );
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
testSiSonne( sante, endurance )
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||
"version": "0.9.48",
|
||||
"version": "0.9.49",
|
||||
"minimumCoreVersion": "0.7.5",
|
||||
"compatibleCoreVersion": "0.7.6",
|
||||
"templateVersion": 46,
|
||||
|
@ -395,6 +395,11 @@
|
||||
"value": 0,
|
||||
"label": "Points de Rêve actuels"
|
||||
},
|
||||
"seuil": {
|
||||
"max": 0,
|
||||
"value": 0,
|
||||
"label": "Seuil de Rêve"
|
||||
},
|
||||
"tmrpos": {
|
||||
"coord": "A1",
|
||||
"label": "Position TMR"
|
||||
|
@ -398,7 +398,11 @@
|
||||
<ol class="item-list">
|
||||
<li class="item flexrow">
|
||||
<span class="ptreve-actuel"><a>Points de Rêve actuels</a> :</span>
|
||||
<span><input class="pointsreve-value competence-value" type="text" name="data.reve.reve.value" value="{{data.reve.reve.value}}" data-dtype="Number"/></span>
|
||||
<span><input class="pointsreve-value" type="text" name="data.reve.reve.value" value="{{data.reve.reve.value}}" data-dtype="Number"/></span>
|
||||
</li>
|
||||
<li class="item flexrow">
|
||||
<span class="seuil-reve"><a>Seuil de Rêve</a> :</span>
|
||||
<span><input class="seuil-reve-value" type="text" name="data.reve.seuil.value" value="{{data.reve.seuil.value}}" data-dtype="Number"/></span>
|
||||
</li>
|
||||
{{#if data.isGM}}
|
||||
<li class="item flexrow">
|
||||
|
Loading…
Reference in New Issue
Block a user