From e031fe712cad9bf5ad85aec67d25becf4e744143 Mon Sep 17 00:00:00 2001 From: macniel Date: Fri, 17 Oct 2025 22:16:15 +0200 Subject: [PATCH] restores rollability --- src/module/sheets/character/skills.mjs | 2 +- src/module/sheets/characterSheet.mjs | 9 +++++++++ src/templates/ui/partial-rollable-button.hbs | 5 +++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/module/sheets/character/skills.mjs b/src/module/sheets/character/skills.mjs index b8c271c0..58e14280 100644 --- a/src/module/sheets/character/skills.mjs +++ b/src/module/sheets/character/skills.mjs @@ -22,7 +22,7 @@ export default { context.skills = {}; context.flatSkills = []; - Object.values(actorData.items).forEach((item, index) => { + actorData.items.forEach((item, index) => { if (item.type === "Skill") { const talentGruppe = item.system.gruppe; diff --git a/src/module/sheets/characterSheet.mjs b/src/module/sheets/characterSheet.mjs index d79341f9..d60bc6d1 100644 --- a/src/module/sheets/characterSheet.mjs +++ b/src/module/sheets/characterSheet.mjs @@ -29,6 +29,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { resizable: true, }, actions: { + rollSkill: CharacterSheet.#rollSkill, roll: CharacterSheet.#dieRoll, editImage: ActorSheetV2.DEFAULT_OPTIONS.actions.editImage, openEmbeddedDocument: CharacterSheet.#openEmbeddedDocument, @@ -76,6 +77,14 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { } } + static #rollSkill(event) { + const {id} = event.srcElement.dataset + const skill = this.document.items.get(id) + if (skill?.system?.roll) { + skill.system.roll("publicroll") + } + } + static #dieRoll(event) { event.preventDefault() const dataset = event.currentTarget.dataset diff --git a/src/templates/ui/partial-rollable-button.hbs b/src/templates/ui/partial-rollable-button.hbs index 535886b1..7007661b 100644 --- a/src/templates/ui/partial-rollable-button.hbs +++ b/src/templates/ui/partial-rollable-button.hbs @@ -1,12 +1,13 @@ -
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }} - {{#if this.taw}} + {{#if this.taw}} {{this.taw}} {{else}} {{#if this.liturgiekenntnis}}