Find roll buttons via data-roll-formula and not the roll class.
This commit is contained in:
parent
0deda3235a
commit
15462c98fb
3 changed files with 2 additions and 7 deletions
|
|
@ -41,7 +41,7 @@ export class GenericActorSheet extends ActorSheet {
|
|||
console.debug(`.dungeon | Generic sheet adding listeners`);
|
||||
|
||||
html.find(`summary`).on(`click`, this._handleSummaryToggle.bind(this));
|
||||
html.find(`.roll`).on(`click`, this._handleRoll.bind(this));
|
||||
html.find(`[data-roll-formula]`).on(`click`, this._handleRoll.bind(this));
|
||||
html.find(`[data-embedded-update]`)
|
||||
.on(`change`, this.actor.genericEmbeddedUpdate.bind(this.actor));
|
||||
html.find(`[data-embedded-delete]`)
|
||||
|
|
@ -56,10 +56,6 @@ export class GenericActorSheet extends ActorSheet {
|
|||
|
||||
async _handleRoll($e) {
|
||||
let data = $e.currentTarget.dataset;
|
||||
if (!data.rollFormula) {
|
||||
console.warn(`.dungeon | Element has .roll class with no roll formula`, $e.target);
|
||||
return;
|
||||
};
|
||||
console.debug(`.dungeon | Attempting to roll with formula "${data.rollFormula}"`);
|
||||
|
||||
let flavor;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="skill">
|
||||
<button
|
||||
class="skill__label skill__button roll"
|
||||
class="skill__label skill__button"
|
||||
aria-label="{{localize "dotdungeon.aria.actor.pc.skill.button.roll" skill=name}}"
|
||||
data-roll-formula="1{{dd-objectValue system (concat "stats." stat)}} {{dd-objectValue system.skills (concat stat "." name)}}"
|
||||
data-roll-label="dotdungeon.rolls.skills.{{name}}"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<label class="stat stat--{{name}}">
|
||||
<button
|
||||
class="roll"
|
||||
data-stat="{{name}}"
|
||||
data-roll-formula="1{{value}}"
|
||||
data-roll-label="dotdungeon.rolls.stats.{{name}}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue