From 4aa414be0036d962115943a46948fd0e53ae975b Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Thu, 15 Jan 2026 00:53:33 +0100 Subject: [PATCH 1/4] [Fix] Daggerheart Menu LightMode (#1534) * Fixed so the menu and menuIcon coloration correctly changes with mode change * . * . * . --- styles/less/global/global.less | 11 +++++++++++ styles/less/ui/sidebar/tabs.less | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/styles/less/global/global.less b/styles/less/global/global.less index 6cc63c2a..6c63fe7a 100644 --- a/styles/less/global/global.less +++ b/styles/less/global/global.less @@ -51,3 +51,14 @@ } } } + +/* TODO: Remove me when this issue is resolved https://github.com/foundryvtt/foundryvtt/issues/13734 */ +body.theme-dark, +.themed.theme-dark { + color-scheme: dark; +} + +body.theme-light, +.themed.theme-light { + color-scheme: light; +} diff --git a/styles/less/ui/sidebar/tabs.less b/styles/less/ui/sidebar/tabs.less index e9de2924..c620ff91 100644 --- a/styles/less/ui/sidebar/tabs.less +++ b/styles/less/ui/sidebar/tabs.less @@ -1,4 +1,4 @@ -.theme-light #interface #ui-right #sidebar { +.theme-light#interface #ui-right #sidebar { menu li button img { filter: @grey-filter; } From b92a47406980f9d4e9f4d195654fffe59b39ef62 Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Wed, 14 Jan 2026 20:04:00 -0500 Subject: [PATCH 2/4] Fix bottom gap of item settings and make header rows more rhythmic (#1529) --- styles/less/global/index.less | 1 - styles/less/global/item-header.less | 2 +- styles/less/global/tab-settings.less | 8 -------- 3 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 styles/less/global/tab-settings.less diff --git a/styles/less/global/index.less b/styles/less/global/index.less index f51140de..216dc9f4 100644 --- a/styles/less/global/index.less +++ b/styles/less/global/index.less @@ -10,7 +10,6 @@ @import './tab-description.less'; @import './tab-features.less'; @import './tab-effects.less'; -@import './tab-settings.less'; @import './item-header.less'; @import './feature-section.less'; @import './inventory-item.less'; diff --git a/styles/less/global/item-header.less b/styles/less/global/item-header.less index 073762e0..f47ca7dc 100755 --- a/styles/less/global/item-header.less +++ b/styles/less/global/item-header.less @@ -160,7 +160,7 @@ .item-description { display: flex; flex-direction: column; - gap: 10px; + gap: 7px; } h3 { diff --git a/styles/less/global/tab-settings.less b/styles/less/global/tab-settings.less deleted file mode 100644 index 3d5248be..00000000 --- a/styles/less/global/tab-settings.less +++ /dev/null @@ -1,8 +0,0 @@ -@import '../utils/colors.less'; -@import '../utils/fonts.less'; - -.sheet.daggerheart.dh-style { - .tab.settings { - margin-bottom: 36px; - } -} From 9393bab6cf6cd1203d4f991895d3e589d011a104 Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Thu, 15 Jan 2026 09:45:10 +0100 Subject: [PATCH 3/4] Added so that beastforms can set a scale to handle specific images (#1532) --- lang/en.json | 3 ++- module/data/activeEffect/beastformEffect.mjs | 9 +++++++-- module/data/item/beastform.mjs | 6 +++++- templates/sheets/items/beastform/settings.hbs | 3 +++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lang/en.json b/lang/en.json index b84906f3..14915a81 100755 --- a/lang/en.json +++ b/lang/en.json @@ -2284,7 +2284,8 @@ "placeholder": "Using character dimensions", "disabledPlaceholder": "Set by character size", "height": { "label": "Height" }, - "width": { "label": "Width" } + "width": { "label": "Width" }, + "scale": { "label": "Token Scale" } }, "evolved": { "maximumTier": { "label": "Maximum Tier" }, diff --git a/module/data/activeEffect/beastformEffect.mjs b/module/data/activeEffect/beastformEffect.mjs index 5311b827..65e36606 100644 --- a/module/data/activeEffect/beastformEffect.mjs +++ b/module/data/activeEffect/beastformEffect.mjs @@ -19,6 +19,7 @@ export default class BeastformEffect extends BaseEffect { base64: false }), tokenSize: new fields.SchemaField({ + scale: new fields.NumberField({ nullable: false, initial: 1 }), height: new fields.NumberField({ integer: false, nullable: true }), width: new fields.NumberField({ integer: false, nullable: true }) }) @@ -55,7 +56,9 @@ export default class BeastformEffect extends BaseEffect { const update = { ...baseUpdate, texture: { - src: this.characterTokenData.tokenImg + src: this.characterTokenData.tokenImg, + scaleX: this.characterTokenData.tokenSize.scale, + scaleY: this.characterTokenData.tokenSize.scale }, ring: { enabled: this.characterTokenData.usesDynamicToken, @@ -86,7 +89,9 @@ export default class BeastformEffect extends BaseEffect { y, 'texture': { enabled: this.characterTokenData.usesDynamicToken, - src: token.flags.daggerheart?.beastformTokenImg ?? this.characterTokenData.tokenImg + src: token.flags.daggerheart?.beastformTokenImg ?? this.characterTokenData.tokenImg, + scaleX: this.characterTokenData.tokenSize.scale, + scaleY: this.characterTokenData.tokenSize.scale }, 'ring': { subject: { diff --git a/module/data/item/beastform.mjs b/module/data/item/beastform.mjs index 1840e26a..dd491169 100644 --- a/module/data/item/beastform.mjs +++ b/module/data/item/beastform.mjs @@ -49,6 +49,7 @@ export default class DHBeastform extends BaseDataItem { choices: CONFIG.DH.ACTOR.tokenSize, initial: CONFIG.DH.ACTOR.tokenSize.custom.id }), + scale: new fields.NumberField({ nullable: false, min: 0.2, max: 3, step: 0.05, initial: 1 }), height: new fields.NumberField({ integer: true, min: 1, initial: null, nullable: true }), width: new fields.NumberField({ integer: true, min: 1, initial: null, nullable: true }) }), @@ -184,6 +185,7 @@ export default class DHBeastform extends BaseDataItem { tokenImg: this.parent.parent.prototypeToken.texture.src, tokenRingImg: this.parent.parent.prototypeToken.ring.subject.texture, tokenSize: { + scale: this.parent.parent.prototypeToken.texture.scaleX, height: this.parent.parent.prototypeToken.height, width: this.parent.parent.prototypeToken.width } @@ -209,7 +211,9 @@ export default class DHBeastform extends BaseDataItem { height, width, texture: { - src: this.tokenImg + src: this.tokenImg, + scaleX: this.tokenSize.scale, + scaleY: this.tokenSize.scale }, ring: { subject: { diff --git a/templates/sheets/items/beastform/settings.hbs b/templates/sheets/items/beastform/settings.hbs index 844b9d61..82065ad3 100644 --- a/templates/sheets/items/beastform/settings.hbs +++ b/templates/sheets/items/beastform/settings.hbs @@ -47,6 +47,9 @@ disabled=dimensionsDisabled }} +
+ {{formGroup systemFields.tokenSize.fields.scale value=source.system.tokenSize.scale localize=true }} +
{{else}} {{localize "DAGGERHEART.ITEMS.Beastform.evolvedTokenHint"}} {{/unless}} From d414b464b5d3c51096f54d1a1dc7d04e827eae2d Mon Sep 17 00:00:00 2001 From: Chris Ryan Date: Thu, 15 Jan 2026 23:39:44 +1000 Subject: [PATCH 4/4] Pass the hope value in the button data; skeleton risk it all dialog to fill out. --- lang/en.json | 4 ++ module/applications/dialogs/deathMove.mjs | 7 +++- .../applications/dialogs/riskItAllDialog.mjs | 42 +++++++++++++++++++ module/applications/ui/chatLog.mjs | 11 +++-- module/data/actor/character.mjs | 2 +- templates/dialogs/riskItAllDialog.hbs | 18 ++++++++ templates/ui/chat/deathMove.hbs | 2 +- 7 files changed, 79 insertions(+), 7 deletions(-) create mode 100644 module/applications/dialogs/riskItAllDialog.mjs create mode 100644 templates/dialogs/riskItAllDialog.hbs diff --git a/lang/en.json b/lang/en.json index b28a3c93..c9160405 100755 --- a/lang/en.json +++ b/lang/en.json @@ -614,6 +614,10 @@ "title": "{name} Resource", "rerollDice": "Reroll Dice" }, + "RiskItAllDialog": { + "title": "Risk It All - Clear Stress and Hope", + "submit": "Submit" + }, "TagTeamSelect": { "title": "Tag Team Roll", "leaderTitle": "Initiating Character", diff --git a/module/applications/dialogs/deathMove.mjs b/module/applications/dialogs/deathMove.mjs index 0996fc27..ea7a18eb 100644 --- a/module/applications/dialogs/deathMove.mjs +++ b/module/applications/dialogs/deathMove.mjs @@ -9,7 +9,8 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV this.actor = actor; this.selectedMove = null; this.showRiskItAllButton = false; - this.riskItAllButtonLabel = "" + this.riskItAllButtonLabel = ""; + this.riskItAllHope = 0; } get title() { @@ -109,6 +110,7 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV } else { chatMessage = game.i18n.format('DAGGERHEART.UI.Chat.deathMove.riskItAllSuccess', { hope: config.roll.hope.value }) this.showRiskItAllButton = true; + this.riskItAllHope = config.roll.hope.value; this.riskItAllButtonLabel = game.i18n.format('DAGGERHEART.UI.Chat.deathMove.riskItAllClearStressAndHitPoints', { hope: config.roll.hope.value }) } } @@ -185,7 +187,8 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV open: autoExpandDescription ? 'open' : '', chevron: autoExpandDescription ? 'fa-chevron-up' : 'fa-chevron-down', showRiskItAllButton: this.showRiskItAllButton, - riskItAllButtonLabel: this.riskItAllButtonLabel + riskItAllButtonLabel: this.riskItAllButtonLabel, + riskItAllHope: this.riskItAllHope } ), title: game.i18n.localize('DAGGERHEART.UI.Chat.deathMove.title'), diff --git a/module/applications/dialogs/riskItAllDialog.mjs b/module/applications/dialogs/riskItAllDialog.mjs new file mode 100644 index 00000000..5a114d3a --- /dev/null +++ b/module/applications/dialogs/riskItAllDialog.mjs @@ -0,0 +1,42 @@ +const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; +export default class RiskItAllDialog extends HandlebarsApplicationMixin(ApplicationV2) { + constructor(actor, config) { + super({}); + + this.actor = actor; + this.validChoices = null; + this.config = config; + } + + get title() { + return game.i18n.format('DAGGERHEART.APPLICATIONS.RiskItAllDialog.title', { actor: this.actor.name }); + } + + static DEFAULT_OPTIONS = { + classes: ['daggerheart', 'dh-style', 'dialog', 'views', 'risk-it-all'], + position: { width: 'auto', height: 'auto' }, + window: { icon: 'fa-solid fa-skull' }, + actions: { + submit: this.submit + } + }; + + static PARTS = { + application: { + id: 'risk-it-all', + template: 'systems/daggerheart/templates/dialogs/riskItAllDialog.hbs' + } + }; + + async _prepareContext(_options) { + const context = await super._prepareContext(_options); + context.RiskItAllDialog = this.RiskItAllDialog; + context.title = game.i18n.localize('DAGGERHEART.APPLICATIONS.RiskItAllDialog.submit'); + + return context; + } + + static async submit() { + this.close(); + } +} diff --git a/module/applications/ui/chatLog.mjs b/module/applications/ui/chatLog.mjs index d3e30dab..febb6155 100644 --- a/module/applications/ui/chatLog.mjs +++ b/module/applications/ui/chatLog.mjs @@ -1,5 +1,6 @@ import { abilities } from '../../config/actorConfig.mjs'; import { emitAsGM, GMUpdateEvent, RefreshType, socketEvent } from '../../systemRegistration/socket.mjs'; +import RiskItAllDialog from '../dialogs/riskItAllDialog.mjs'; export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLog { constructor(options) { @@ -82,7 +83,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo element.addEventListener('click', this.groupRollExpandSection) ); html.querySelectorAll('.risk-it-all-button').forEach(element => - element.addEventListener('click', event => this.riskItAllClearStressAndHitPoints(event, message)) + element.addEventListener('click', event => this.riskItAllClearStressAndHitPoints(event, data)) ); }; @@ -375,8 +376,12 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo } - async riskItAllClearStressAndHitPoints(event, message) { - console.log("riskItAllClearStressAndHitPoints button hit!", event, message); + async riskItAllClearStressAndHitPoints(event, data) { + const hopeValue = event.target.dataset.hope; + const config = { + hope: hopeValue + } + await new RiskItAllDialog(data.actor, config).render({ force: true }); } diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index d36a4b08..a7f99ca8 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -738,7 +738,7 @@ export default class DhCharacter extends BaseDataActor { static migrateData(source) { if (typeof source.scars === 'object') source.scars = 0; - if (source.resources.hope.max) source.scars = Math.max(6 - source.resources.hope.max, 0); + if (source.resources?.hope?.max) source.scars = Math.max(6 - source.resources.hope.max, 0); return super.migrateData(source); } diff --git a/templates/dialogs/riskItAllDialog.hbs b/templates/dialogs/riskItAllDialog.hbs new file mode 100644 index 00000000..0bf78e6b --- /dev/null +++ b/templates/dialogs/riskItAllDialog.hbs @@ -0,0 +1,18 @@ +
+
+

{{title}}

+
+
+ TODO magic here +
+
+ + +
+
\ No newline at end of file diff --git a/templates/ui/chat/deathMove.hbs b/templates/ui/chat/deathMove.hbs index f73b32cd..b36ee590 100644 --- a/templates/ui/chat/deathMove.hbs +++ b/templates/ui/chat/deathMove.hbs @@ -19,7 +19,7 @@ {{#if this.showRiskItAllButton}}
-