From b152018607b1ec554b53101d59bbc973fbe99f86 Mon Sep 17 00:00:00 2001 From: Vlyan Date: Fri, 18 Dec 2020 18:37:11 +0100 Subject: [PATCH] fix roll with new helper --- system/scripts/actors/twenty-questions-dialog.js | 1 - system/scripts/dice/dice-picker-dialog.js | 2 +- system/scripts/helpers.js | 5 +++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/scripts/actors/twenty-questions-dialog.js b/system/scripts/actors/twenty-questions-dialog.js index 24bf0c1..40d13ae 100644 --- a/system/scripts/actors/twenty-questions-dialog.js +++ b/system/scripts/actors/twenty-questions-dialog.js @@ -77,7 +77,6 @@ export class TwentyQuestionsDialog extends FormApplication { * @return {Object} */ getData(options = null) { - console.log(game.l5r5e.HelpersL5r5e.getRingsList()); return { ...super.getData(options), ringsList: game.l5r5e.HelpersL5r5e.getRingsList(), diff --git a/system/scripts/dice/dice-picker-dialog.js b/system/scripts/dice/dice-picker-dialog.js index e4eface..11556f1 100644 --- a/system/scripts/dice/dice-picker-dialog.js +++ b/system/scripts/dice/dice-picker-dialog.js @@ -197,7 +197,7 @@ export class DicePickerDialog extends FormApplication { getData(options = null) { return { ...super.getData(options), - ringsList: game.l5r5e.HelpersL5r5e.getRingsList(), + ringsList: game.l5r5e.HelpersL5r5e.getRingsList(this._actor), dicesList: [0, 1, 2, 3, 4, 5, 6], skillData: this._skillData, actor: this._actor, diff --git a/system/scripts/helpers.js b/system/scripts/helpers.js index 65f5709..d3b0617 100644 --- a/system/scripts/helpers.js +++ b/system/scripts/helpers.js @@ -7,11 +7,12 @@ export class HelpersL5r5e { /** * Get Rings/Element for List / Select */ - static getRingsList() { + static getRingsList(actor = null) { return CONFIG.l5r5e.stances.map((e) => { return { id: e, label: game.i18n.localize(`l5r5e.rings.${e}`), + value: actor?.data?.data?.rings?.[e] || 0, }; }); } @@ -19,7 +20,7 @@ export class HelpersL5r5e { /** * Get Skills for List / Select with groups */ - static getSkillsList(useGroup) { + static getSkillsList(useGroup = false) { if (!useGroup) { return Array.from(L5R5E.skills).map(([id, cat]) => { return {