Add new Compendium

This commit is contained in:
sladecraven 2020-07-22 00:12:13 +02:00
parent a873ff92d0
commit c7ccfacf84
3 changed files with 31 additions and 15 deletions

View File

@ -476,12 +476,12 @@ export class RdDActor extends Actor {
return; return;
} }
console.log("Loading TMR template!!!");
let data = { let data = {
fatigueHTML:"<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix( this.data.data.sante.fatigue.value, this.data.data.sante.endurance.max ).html() + "</table>", fatigueHTML:"<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix( this.data.data.sante.fatigue.value, this.data.data.sante.endurance.max ).html() + "</table>",
draconic: this.getDraconicList(), draconic: this.getDraconicList(),
sort: this.getSortList(), sort: this.getSortList(),
caracReve: this.data.data.carac.reve.value caracReve: this.data.data.carac.reve.value,
pointsReve: this.data.data.reve.reve.value
} }
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html', data ); let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html', data );
new RdDTMRDialog(sortID, html, this ).render(true); new RdDTMRDialog(sortID, html, this ).render(true);

View File

@ -15,13 +15,13 @@ export class RdDTMRDialog extends Dialog {
content: html, content: html,
buttons: buttons:
{ {
rollButton: closeButton:
{ {
label: "Fermer", label: "Fermer",
callback: html => this.performRoll(html) callback: html => this.close(html)
} }
}, },
default: "rollButton" default: "closeButton"
} }
let dialogOptions = { classes: [ "tmrdialog"] } let dialogOptions = { classes: [ "tmrdialog"] }
@ -281,6 +281,11 @@ export class RdDTMRDialog extends Dialog {
} }
} }
/* -------------------------------------------- */
lancerSort () {
console.log("Lancer de sort !!!!!");
}
/* -------------------------------------------- */ /* -------------------------------------------- */
async activateListeners(html) { async activateListeners(html) {
super.activateListeners(html); super.activateListeners(html);
@ -288,7 +293,12 @@ export class RdDTMRDialog extends Dialog {
var row = document.getElementById("tmrrow1"); var row = document.getElementById("tmrrow1");
var cell1 = row.insertCell(1); var cell1 = row.insertCell(1);
cell1.append( this.pixiApp.view ); cell1.append( this.pixiApp.view );
// Roll Sort
html.find('#lancer-sort').click((event) => {
this.lancerSort();
});
// load the texture we need // load the texture we need
await this.pixiApp.loader.add('tmr', 'systems/foundryvtt-reve-de-dragon/styles/ui/tmp_main_r1.webp').load((loader, resources) => { await this.pixiApp.loader.add('tmr', 'systems/foundryvtt-reve-de-dragon/styles/ui/tmp_main_r1.webp').load((loader, resources) => {
// This creates a texture from a 'bunny.png' image // This creates a texture from a 'bunny.png' image

View File

@ -4,24 +4,27 @@
<table id="tmrsheet"> <table id="tmrsheet">
<tr id="tmrrow1"> <tr id="tmrrow1">
<td> <td>
<div class="flex-group-center flex-fatigue"> <div class="flex-group-center">
Rêve Actuel : <span id="pointsreve-value">0</span> Rêve Actuel : <span id="pointsreve-value">0</span>
</div> </div>
<div class="flex-group-center flex-fatigue"> <div class="flex-group-center">
Coordonnées : <span id="tmr-pos">0</span> Coordonnées : <span id="tmr-pos">0</span>
</div> </div>
<div class="flex-group-center flex-fatigue"> <div class="flex-group-center">
Etat général : <span id="etatgeneral-value">0</span> Etat général : <span id="etatgeneral-value">0</span>
</div> </div>
<div class="flex-group-center flex-fatigue"> <div class="flex-group-center">
Refoulement : <span id="refoulement-value">0</span> Refoulement : <span id="refoulement-value">0</span>
</div> </div>
<div class="flex-group-center flex-fatigue"> <div class="flex-group-center flex-fatigue">
Fatigue Fatigue
<span id="fatigue-table">{{{fatigueHTML}}}</span> <span id="fatigue-table">{{{fatigueHTML}}}</span>
</div> </div>
<div class="form-group"> <div class="flex-group-center">
<label for="categorie">Caractéristique Rêve : </label><label>{{caracReve}}</label> <label>Carac. Rêve : </label><label>{{caracReve}}</label>
</div>
<div class="flex-group-center">
<label>Points de Rêve : </label><label>{{pointsReve}}</label>
</div> </div>
<div class="flex-group-center"> <div class="flex-group-center">
@ -35,8 +38,7 @@
</select> </select>
</span> </span>
</div> </div>
<div class="flex-group-center"> <div class="flex-group-center">
Sorts : <span id="sorts-list"> Sorts : <span id="sorts-list">
<select name="sort" id="sort-list" data-dtype="String"> <select name="sort" id="sort-list" data-dtype="String">
@ -48,7 +50,11 @@
</select> </select>
</span> </span>
</div> </div>
<div class="flex-group-center">
<button id="lancer-sort">Lancer un Sort</button>
</div>
</td> </td>
</tr> </tr>
</table> </table>