using helpers for selects
This commit is contained in:
@@ -42,7 +42,7 @@ export class DicePickerDialog extends FormApplication {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
id: "l5r5e-dice-picker-dialog",
|
||||
classes: ["l5r5e", "dice-picker-dialog"],
|
||||
template: CONFIG.L5r5e.paths.templates + "dice/dice-picker-dialog.html",
|
||||
template: CONFIG.l5r5e.paths.templates + "dice/dice-picker-dialog.html",
|
||||
title: "L5R Dice Roller",
|
||||
width: 660,
|
||||
height: 460,
|
||||
@@ -120,7 +120,7 @@ export class DicePickerDialog extends FormApplication {
|
||||
* @param ringId
|
||||
*/
|
||||
set ringId(ringId) {
|
||||
this._ringId = CONFIG.L5r5e.stances.includes(ringId) || null;
|
||||
this._ringId = CONFIG.l5r5e.stances.includes(ringId) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -197,7 +197,7 @@ export class DicePickerDialog extends FormApplication {
|
||||
getData(options = null) {
|
||||
return {
|
||||
...super.getData(options),
|
||||
elementsList: this._getElements(),
|
||||
ringsList: game.l5r5e.HelpersL5r5e.getRingsList(),
|
||||
dicesList: [0, 1, 2, 3, 4, 5, 6],
|
||||
skillData: this._skillData,
|
||||
actor: this._actor,
|
||||
@@ -386,20 +386,6 @@ export class DicePickerDialog extends FormApplication {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load elements (id, label, value)
|
||||
* @private
|
||||
*/
|
||||
_getElements() {
|
||||
return CONFIG.L5r5e.stances.map((e) => {
|
||||
return {
|
||||
id: e,
|
||||
label: game.i18n.localize(`l5r5e.rings.${e}`),
|
||||
value: this._actor?.data?.data?.rings?.[e] || 0,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Return a reference to the target attribute
|
||||
// * @type {String}
|
||||
|
||||
@@ -27,7 +27,7 @@ export class L5rBaseDie extends DiceTerm {
|
||||
* @override
|
||||
*/
|
||||
static getResultLabel(result) {
|
||||
return `<img src="${CONFIG.L5r5e.paths.assets}dices/default/${this.FACES[result].image}.svg" alt="${result}" />`;
|
||||
return `<img src="${CONFIG.l5r5e.paths.assets}dices/default/${this.FACES[result].image}.svg" alt="${result}" />`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -173,7 +173,7 @@ export class RollL5r5e extends Roll {
|
||||
displaySummary: contexte?.from !== "render",
|
||||
};
|
||||
|
||||
return renderTemplate(CONFIG.L5r5e.paths.templates + this.constructor.TOOLTIP_TEMPLATE, { chatData });
|
||||
return renderTemplate(CONFIG.l5r5e.paths.templates + this.constructor.TOOLTIP_TEMPLATE, { chatData });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -185,7 +185,7 @@ export class RollL5r5e extends Roll {
|
||||
{
|
||||
user: game.user._id,
|
||||
flavor: null,
|
||||
template: CONFIG.L5r5e.paths.templates + this.constructor.CHAT_TEMPLATE,
|
||||
template: CONFIG.l5r5e.paths.templates + this.constructor.CHAT_TEMPLATE,
|
||||
blind: false,
|
||||
},
|
||||
chatOptions
|
||||
|
||||
Reference in New Issue
Block a user