forked from public/foundryvtt-reve-de-dragon
Lancer un sort avec RdDRoll
This commit is contained in:
@ -75,6 +75,9 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
async onAction(action, html) {
|
||||
await RdDResolutionTable.rollData(this.rollData);
|
||||
|
||||
console.log("RdDRoll -=>", this.rollData, this.rollData.rolled);
|
||||
|
||||
if (action.callbacks)
|
||||
for (let callback of action.callbacks) {
|
||||
if (callback.condition == undefined || callback.condition(this.rollData)) {
|
||||
@ -102,6 +105,7 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
// Sort management
|
||||
if (rollData.selectedSort) {
|
||||
rollData.bonus = RdDItemSort.getCaseBonus( rollData.selectedSort, rollData.coord ),
|
||||
//console.log("Toggle show/hide", rollData.selectedSort);
|
||||
HtmlUtility._showControlWhen("#div-sort-difficulte", RdDItemSort.isDifficulteVariable(rollData.selectedSort))
|
||||
HtmlUtility._showControlWhen("#div-sort-ptreve", RdDItemSort.isCoutVariable(rollData.selectedSort))
|
||||
@ -154,6 +158,7 @@ export class RdDRoll extends Dialog {
|
||||
html.find('#sort').change((event) => {
|
||||
let sortKey = Misc.toInt(event.currentTarget.value);
|
||||
this.rollData.selectedSort = rollData.sortList[sortKey]; // Update the selectedCarac
|
||||
this.rollData.bonus = RdDItemSort.getCaseBonus( rollData.selectedSort, rollData.coord );
|
||||
RdDItemSort.setCoutReveReel(rollData.selectedSort);
|
||||
//console.log("RdDRollSelectDialog - Sort selection", rollData.selectedSort);
|
||||
updateRollResult(rollData);
|
||||
|
Reference in New Issue
Block a user