From ee899cba59f637ec40561c3d4739231305589585 Mon Sep 17 00:00:00 2001 From: Dapoolp Date: Fri, 1 Aug 2025 01:13:35 +0200 Subject: [PATCH] y --- lang/en.json | 1 + .../sheets-configs/action-config.mjs | 2 +- module/applications/ui/chatLog.mjs | 4 +- module/data/chat-message/adversaryRoll.mjs | 2 +- module/data/chat-message/damageRoll.mjs | 3 +- module/data/fields/action/rollField.mjs | 2 +- module/dice/dhRoll.mjs | 2 +- styles/less/dialog/actions/action-list.less | 7 ++ styles/less/global/dice.less | 80 +++++++++++++++++ styles/less/global/index.less | 1 + styles/less/ui/chat/chat-temp.less | 14 +-- templates/ui/chat/parts/button-part.hbs | 12 ++- templates/ui/chat/parts/damage-part.hbs | 24 +++-- templates/ui/chat/parts/roll-part.hbs | 87 +++++++++++++++---- templates/ui/chat/parts/target-part.hbs | 9 +- 15 files changed, 205 insertions(+), 45 deletions(-) create mode 100644 styles/less/global/dice.less diff --git a/lang/en.json b/lang/en.json index b86b4738..5360a646 100755 --- a/lang/en.json +++ b/lang/en.json @@ -1717,6 +1717,7 @@ }, "Roll": { "attack": "Attack Roll", + "basic": "Roll", "difficulty": "Roll (Difficulty {difficulty})", "primaryWeaponAttack": "Primary Weapon Attack Roll", "secondaryWeaponAttack": "Secondary Weapon Attack Roll", diff --git a/module/applications/sheets-configs/action-config.mjs b/module/applications/sheets-configs/action-config.mjs index 6af1b42e..ea3c6f31 100644 --- a/module/applications/sheets-configs/action-config.mjs +++ b/module/applications/sheets-configs/action-config.mjs @@ -16,7 +16,7 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) { static DEFAULT_OPTIONS = { tag: 'form', - classes: ['daggerheart', 'dh-style', 'dialog'], + classes: ['daggerheart', 'dh-style', 'dialog', 'max-800'], window: { icon: 'fa-solid fa-wrench', resizable: false diff --git a/module/applications/ui/chatLog.mjs b/module/applications/ui/chatLog.mjs index 47619120..89792c18 100644 --- a/module/applications/ui/chatLog.mjs +++ b/module/applications/ui/chatLog.mjs @@ -165,8 +165,8 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo const targetSelection = Boolean(event.target.dataset.targetHit), msg = ui.chat.collection.get(message._id); if (msg.system.targetSelection === targetSelection) return; - if (targetSelection !== true && !Array.from(game.user.targets).length) - return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected')); + // if (targetSelection !== true && !Array.from(game.user.targets).length) + // return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected')); msg.system.targetSelection = targetSelection; msg.system.prepareDerivedData(); ui.chat.updateMessage(msg); diff --git a/module/data/chat-message/adversaryRoll.mjs b/module/data/chat-message/adversaryRoll.mjs index fab9d740..10bf80a9 100644 --- a/module/data/chat-message/adversaryRoll.mjs +++ b/module/data/chat-message/adversaryRoll.mjs @@ -36,7 +36,7 @@ export default class DHAdversaryRoll extends foundry.abstract.TypeDataModel { } get messageTemplate() { - return 'systems/daggerheart/templates/ui/chat/adversary-roll.hbs'; + return 'systems/daggerheart/templates/ui/chat/roll.hbs'; } prepareDerivedData() { diff --git a/module/data/chat-message/damageRoll.mjs b/module/data/chat-message/damageRoll.mjs index 167e97d9..d485e23c 100644 --- a/module/data/chat-message/damageRoll.mjs +++ b/module/data/chat-message/damageRoll.mjs @@ -34,7 +34,8 @@ export default class DHDamageRoll extends foundry.abstract.TypeDataModel { } get messageTemplate() { - return `systems/daggerheart/templates/ui/chat/${this.messageType}-roll.hbs`; + return `systems/daggerheart/templates/ui/chat/roll.hbs`; + // return `systems/daggerheart/templates/ui/chat/${this.messageType}-roll.hbs`; } prepareDerivedData() { diff --git a/module/data/fields/action/rollField.mjs b/module/data/fields/action/rollField.mjs index 7522ebc5..8a473232 100644 --- a/module/data/fields/action/rollField.mjs +++ b/module/data/fields/action/rollField.mjs @@ -54,7 +54,7 @@ export class DHActionRollData extends foundry.abstract.DataModel { this.diceRolling.multiplier === 'flat' ? this.diceRolling.flatMultiplier : `@${this.diceRolling.multiplier}`; - if (this.diceRolling.compare && this.diceRolling.threshold) { + if (this.diceRolling.compare && this.diceRolling.treshold) { formula = `${multiplier}${this.diceRolling.dice}cs${CONFIG.DH.ACTIONS.diceCompare[this.diceRolling.compare].operator}${this.diceRolling.treshold}`; } else { formula = `${multiplier}${this.diceRolling.dice}`; diff --git a/module/dice/dhRoll.mjs b/module/dice/dhRoll.mjs index c9cbb069..9d9026c5 100644 --- a/module/dice/dhRoll.mjs +++ b/module/dice/dhRoll.mjs @@ -9,7 +9,7 @@ export default class DHRoll extends Roll { get title() { return game.i18n.localize( - "DAGGERHEART.GENERAL.Roll" + "DAGGERHEART.GENERAL.Roll.basic" ); } diff --git a/styles/less/dialog/actions/action-list.less b/styles/less/dialog/actions/action-list.less index 6a899ca7..33b3d0bb 100644 --- a/styles/less/dialog/actions/action-list.less +++ b/styles/less/dialog/actions/action-list.less @@ -2,6 +2,13 @@ @import '../../utils/colors.less'; .application.daggerheart.dh-style { + &.max-800 { + max-height: 800px; + .tab.active { + overflow: auto; + } + } + .actions-list, .action-buttons-list { display: flex; diff --git a/styles/less/global/dice.less b/styles/less/global/dice.less new file mode 100644 index 00000000..075fa9b4 --- /dev/null +++ b/styles/less/global/dice.less @@ -0,0 +1,80 @@ +.dice { + position: relative; + height: 2rem; + aspect-ratio: 1; + font-size: 1rem; + paint-order: stroke fill; + -webkit-text-stroke: 2px black; + z-index: 1; + + &.xxs { + height: 1rem; + font-size: .5rem; + -webkit-text-stroke: 1px black; + } + + &.xs { + height: 1.5rem; + font-size: .75rem; + } + + &.lg { + height: 2.5rem; + font-size: 1.25rem; + } + + &.xl { + height: 3rem; + font-size: 1.5rem; + } + + &.discarded { + opacity: .5; + } + + &:before { + content: ' '; + position: absolute; + width: 100%; + height: 100%; + z-index: -1; + mask: var(--svg-die) no-repeat center; + mask-size: contain; + background: linear-gradient(139.01deg, #EFE6D8 3.51%, #372E1F 96.49%); + } + + &.d4:before { + --svg-die: url(../assets/icons/dice/default/d4.svg); + } + &.d6:before { + --svg-die: url(../assets/icons/dice/default/d6.svg); + } + &.d8:before { + --svg-die: url(../assets/icons/dice/default/d8.svg); + } + &.d10:before { + --svg-die: url(../assets/icons/dice/default/d10.svg); + } + &.d12:before { + --svg-die: url('../assets/icons/dice/default/d12.svg'); + } + &.d20:before { + --svg-die: url(../assets/icons/dice/default/d20.svg); + } + + &.color-hope:before { + background: linear-gradient(139.01deg, #F3C267 3.51%, #4C3407 96.49%); + } + + &.color-fear:before { + background: linear-gradient(151.21deg, #352AB2 7.21%, #18162E 92.79%); + } + + &.color-adv:before { + background: linear-gradient(139.01deg, #40A640 3.51%, #011B01 96.49%); + } + + &.color-dis:before { + background: linear-gradient(139.01deg, #E54E4E 3.51%, #3C0000 82.19%); + } +} \ No newline at end of file diff --git a/styles/less/global/index.less b/styles/less/global/index.less index 87af76a4..d6c8459e 100644 --- a/styles/less/global/index.less +++ b/styles/less/global/index.less @@ -16,3 +16,4 @@ @import './prose-mirror.less'; @import './filter-menu.less'; @import './tab-attachments.less'; +@import './dice.less'; diff --git a/styles/less/ui/chat/chat-temp.less b/styles/less/ui/chat/chat-temp.less index 46e76f27..9d8f2078 100644 --- a/styles/less/ui/chat/chat-temp.less +++ b/styles/less/ui/chat/chat-temp.less @@ -121,9 +121,10 @@ display: flex; align-items: center; justify-content: center; - gap: 10px; + gap: 5px; font-weight: 700; font-family: 'Cinzel', sans-serif; + flex-wrap: wrap; .roll-die { display: flex; @@ -138,12 +139,9 @@ > div { display: flex; align-items: center; + justify-content: center; gap: 5px; - font-size: var(--font-size-24); - margin: auto; - img { - height: 30px; - } + // font-size: var(--font-size-20); } } } @@ -290,4 +288,8 @@ flex: 1; } } + + .font-20 { + font-size: var(--font-size-20); + } } \ No newline at end of file diff --git a/templates/ui/chat/parts/button-part.hbs b/templates/ui/chat/parts/button-part.hbs index 55e3b888..f85d32f2 100644 --- a/templates/ui/chat/parts/button-part.hbs +++ b/templates/ui/chat/parts/button-part.hbs @@ -1,9 +1,17 @@
{{#if hasDamage}} - + {{#if damage.roll}} + + {{else}} + + {{/if}} {{/if}} {{#if hasHealing}} - + {{#if damage.roll}} + + {{else}} + + {{/if}} {{/if}} {{#if hasEffect}}{{/if}}
\ No newline at end of file diff --git a/templates/ui/chat/parts/damage-part.hbs b/templates/ui/chat/parts/damage-part.hbs index c7d0644c..9d230505 100644 --- a/templates/ui/chat/parts/damage-part.hbs +++ b/templates/ui/chat/parts/damage-part.hbs @@ -26,29 +26,37 @@ {{/if}}
{{#each dice}} -
- {{!--
{{total}}
--}} -
{{total}}
  • -
    + {{#each results}} + {{#unless discarded}} +
    +
    {{result}}
    +
    + {{#unless @last}} +
    +
    +
    +
    + {{/unless}} + {{/unless}} + {{/each}} {{#unless @last}}
    -
    +
    +
    +
    {{/unless}} {{/each}} {{#if modifierTotal}} {{#if (gt modifierTotal 0)}}
    -
    +
    +
    +
    {{/if}}
    -
    {{modifierTotal}}
    +
    {{modifierTotal}}
    {{/if}} {{#unless dice.length}}
    -
    {{total}}
    +
    {{total}}
    {{/unless}}
    diff --git a/templates/ui/chat/parts/roll-part.hbs b/templates/ui/chat/parts/roll-part.hbs index b634b897..da67be48 100644 --- a/templates/ui/chat/parts/roll-part.hbs +++ b/templates/ui/chat/parts/roll-part.hbs @@ -21,30 +21,79 @@
    - {{#each roll.dice}} + {{#if roll.hope}}
    - -
    {{total}}
    + +
    {{roll.hope.value}}
    - {{#unless @last}} +
    + +
    +
    +
    +
    + +
    {{roll.fear.value}}
    +
    + {{#if roll.advantage.type}}
    -
    +
    +
    +
    - {{/unless}} - {{/each}} - {{!--
    - -
    12
    -
    -
    - -
    +
    -
    -
    - -
    6
    -
    --}} +
    + {{#if (eq roll.advantage.type 1)}} + +
    {{roll.advantage.value}}
    + {{else}} + +
    {{roll.advantage.value}}
    + {{/if}} +
    + {{/if}} + {{#if roll.rally.dice}} +
    + +
    +
    +
    +
    + +
    {{roll.rally.value}}
    +
    + {{/if}} + {{#each roll.extra}} +
    + +
    +
    +
    +
    + +
    {{value}}
    +
    + {{#unless @last}} +
    + +
    +
    +
    + {{/unless}} + {{/each}} + {{else}} + {{#each roll.dice}} + {{#each results}} +
    +
    {{result}}
    +
    + {{#unless (or @last (not discarded))}} +
    +
    +
    +
    + {{/unless}} + {{/each}} + {{#unless @last}} +
    +
    +
    +
    + {{/unless}} + {{/each}} + {{/if}}
    {{roll.formula}}
    diff --git a/templates/ui/chat/parts/target-part.hbs b/templates/ui/chat/parts/target-part.hbs index 909b70ed..6d3b0cd8 100644 --- a/templates/ui/chat/parts/target-part.hbs +++ b/templates/ui/chat/parts/target-part.hbs @@ -1,6 +1,6 @@
    Target
    - {{#if targetSelection}} + {{#if targets.length}}
    {{targetShort.hit}} {{#if (gt targetShort.hit 1)}}{{localize "DAGGERHEART.GENERAL.hit.single"}}{{else}}{{localize "DAGGERHEART.GENERAL.hit.plural"}}{{/if}}
    @@ -11,10 +11,13 @@
    - {{#if targets.length}} + {{#if targetSelection}}
    -
    {{localize "DAGGERHEART.UI.Chat.damageRoll.hitTarget"}}
    {{localize "DAGGERHEART.UI.Chat.damageRoll.currentTarget"}}
    +
    +
    {{localize "DAGGERHEART.UI.Chat.damageRoll.hitTarget"}}
    +
    {{localize "DAGGERHEART.UI.Chat.damageRoll.currentTarget"}}
    +
    {{/if}}