From 6470018c90912019cea387a4c2543a5d207d90da Mon Sep 17 00:00:00 2001 From: macniel Date: Fri, 13 Mar 2026 20:19:36 +0100 Subject: [PATCH] #68 clicking on a Spellname will open the Spell Dialog with a reduced but fixed display of inputs. Hides Complex inputs for now. This applies to Skillnames with Skill Dialogs as well. --- src/module/sheets/characterSheet.mjs | 7 ++- src/module/sheets/spellSheet.mjs | 1 + src/style/organisms/_spell-sheet.scss | 54 +++++++++++++++++++ src/style/styles.scss | 1 + src/templates/item/skill/tab-meta.hbs | 2 +- src/templates/item/spell/tab-meta.hbs | 45 ++++++++++------ src/templates/ui/partial-rollable-button.hbs | 2 +- .../ui/partial-rollable-language-button.hbs | 2 +- .../partial-rollable-weaponskill-button.hbs | 9 ++-- 9 files changed, 97 insertions(+), 26 deletions(-) create mode 100644 src/style/organisms/_spell-sheet.scss diff --git a/src/module/sheets/characterSheet.mjs b/src/module/sheets/characterSheet.mjs index d6b36946..a4319caf 100644 --- a/src/module/sheets/characterSheet.mjs +++ b/src/module/sheets/characterSheet.mjs @@ -24,7 +24,6 @@ import {StandaloneLiturgies} from "./character-standalone/liturgies.mjs"; import {StandaloneHealth} from "./character-standalone/health.mjs"; import {SpellDialog} from "../dialog/spellDialog.mjs"; import {displayRoll} from "../globals/displayRoll.js"; -import {evaluateRoll} from "../globals/DSARoll.mjs"; const {HandlebarsApplicationMixin, DocumentSheetV2} = foundry.applications.api const {ActorSheetV2} = foundry.applications.sheets @@ -57,6 +56,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { openCombatAction: CharacterSheet.#openCombatAction, openLiturgyDialog: CharacterSheet.openLiturgyDialog, openSpellDialog: CharacterSheet.openSpellDialog, + openSkillDialog: CharacterSheet.openSkillDialog, castSpell: CharacterSheet.castSpell, progressCooldown: CharacterSheet.#progressCooldown, cancelCooldown: CharacterSheet.#cancelCooldown, @@ -262,6 +262,11 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { this.document.itemTypes["Spell"]?.find(p => p.id === itemId)?.sheet.render(true) } + static openSkillDialog(event, target) { + const {itemId} = target.dataset + this.document.itemTypes["Skill"]?.find(p => p.id === itemId)?.sheet.render(true) + } + static castSpell(event, target) { const {itemId} = target.dataset new SpellDialog(this.document, itemId).render(true) diff --git a/src/module/sheets/spellSheet.mjs b/src/module/sheets/spellSheet.mjs index 66fecbf5..7073f9bd 100644 --- a/src/module/sheets/spellSheet.mjs +++ b/src/module/sheets/spellSheet.mjs @@ -72,6 +72,7 @@ export class SpellSheet extends HandlebarsApplicationMixin(DocumentSheetV2) { context.system = spellData.system; context.flags = spellData.flags; + context.name = spellData.name; return context; } diff --git a/src/style/organisms/_spell-sheet.scss b/src/style/organisms/_spell-sheet.scss new file mode 100644 index 00000000..8ea0b4d7 --- /dev/null +++ b/src/style/organisms/_spell-sheet.scss @@ -0,0 +1,54 @@ +.dsa41.sheet.item.spell { + + .meta-details { + + display: grid; + grid-template-columns: 1fr 1fr 1fr; + grid-template-rows: 52px 52px 1fr; + + .name { + grid-row: 1; + grid-column: 1/span 3; + } + + .zfw { + grid-row: 2; + grid-column: 2; + } + + .probenmod { + grid-row: 2; + grid-column: 3; + } + + .statistics { + grid-row: 2; + grid-column: 1; + display: grid; + grid-template-columns: 1fr 1fr 1fr; + grid-template-rows: auto 1fr; + + & > label { + grid-column: 1/4; + text-align: center; + } + } + + .effect { + grid-row: 3; + grid-column: 1/span 3; + display: flex; + flex-flow: column; + + label { + display: block; + } + + textarea { + display: block; + height: 100%; + resize: none; + } + } + } +} diff --git a/src/style/styles.scss b/src/style/styles.scss index 4e7a99fa..ea49c6b0 100644 --- a/src/style/styles.scss +++ b/src/style/styles.scss @@ -22,6 +22,7 @@ @use "organisms/equipment-sheet"; @use "organisms/creature-sheet"; @use "organisms/modify-liturgy"; +@use "organisms/spell-sheet"; @use "organisms/skill-sheet"; @use "organisms/active-effect-sheet"; @use "organisms/advantage-sheet"; diff --git a/src/templates/item/skill/tab-meta.hbs b/src/templates/item/skill/tab-meta.hbs index ebc0cf24..d78b1a1d 100644 --- a/src/templates/item/skill/tab-meta.hbs +++ b/src/templates/item/skill/tab-meta.hbs @@ -12,7 +12,7 @@
-
- {{this.name}} + {{this.name}}
{{#each this.werte}}
{{this.name}}
- {{this.name}} + {{this.name}}
Komp{{this.komplexität}}
diff --git a/src/templates/ui/partial-rollable-weaponskill-button.hbs b/src/templates/ui/partial-rollable-weaponskill-button.hbs index fe7648dd..baf0a1c6 100644 --- a/src/templates/ui/partial-rollable-weaponskill-button.hbs +++ b/src/templates/ui/partial-rollable-weaponskill-button.hbs @@ -1,8 +1,7 @@ -
+
-
+
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }} {{#if this.taw}} @@ -15,7 +14,7 @@
- {{this.name}} + {{this.name}}
AT{{this.at}}