forked from public/foundryvtt-reve-de-dragon
Utilisation Misc.data
This commit is contained in:
@ -144,10 +144,10 @@ export class RdDRoll extends Dialog {
|
||||
console.log(rollData);
|
||||
// Update html, according to data
|
||||
if (rollData.competence) {
|
||||
let compData = rollData.competence.data.data || rollData.competence.data;
|
||||
const defaut_carac = Misc.templateData(rollData.competence).defaut_carac;
|
||||
// Set the default carac from the competence item
|
||||
rollData.selectedCarac = rollData.carac[compData.defaut_carac];
|
||||
$("#carac").val(compData.defaut_carac);
|
||||
rollData.selectedCarac = rollData.carac[defaut_carac];
|
||||
$("#carac").val(defaut_carac);
|
||||
}
|
||||
if (rollData.selectedSort) {
|
||||
$("#draconic").val(rollData.selectedSort.data.listIndex); // Uniquement a la selection du sort, pour permettre de changer
|
||||
@ -184,8 +184,10 @@ export class RdDRoll extends Dialog {
|
||||
let sortKey = Misc.toInt(event.currentTarget.value);
|
||||
this.rollData.selectedSort = this.rollData.sortList[sortKey]; // Update the selectedCarac
|
||||
this.rollData.bonus = RdDItemSort.getCaseBonus(this.rollData.selectedSort, this.rollData.tmr.coord);
|
||||
this.rollData.diffLibre = RdDItemSort.getDifficulte(this.rollData.selectedSort, -7)
|
||||
RdDItemSort.setCoutReveReel(this.rollData.selectedSort);
|
||||
$("#draconic").val(this.rollData.selectedSort.data.listIndex); // Uniquement a la selection du sort, pour permettre de changer
|
||||
$("#diffLibre").val(this.rollData.diffLibre);
|
||||
this.updateRollResult();
|
||||
});
|
||||
html.find('#ptreve-variable').change((event) => {
|
||||
|
Reference in New Issue
Block a user