From 98f9957ba0ff836185c7373bc6293b250beb188b Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Thu, 23 Apr 2026 06:35:02 -0400 Subject: [PATCH] Style and restore aid modifiers --- .../applications/dialogs/groupRollDialog.mjs | 16 ++++---- .../less/dialog/group-roll-dialog/main.less | 40 ++++++++++++++++++- .../dialogs/groupRollDialog/parts/member.hbs | 14 ++++++- .../dialogs/groupRollDialog/parts/result.hbs | 4 +- 4 files changed, 63 insertions(+), 11 deletions(-) diff --git a/module/applications/dialogs/groupRollDialog.mjs b/module/applications/dialogs/groupRollDialog.mjs index 821a91a1..6325795a 100644 --- a/module/applications/dialogs/groupRollDialog.mjs +++ b/module/applications/dialogs/groupRollDialog.mjs @@ -37,7 +37,7 @@ export default class GroupRollDialog extends HandlebarsApplicationMixin(Applicat tag: 'form', id: 'GroupRollDialog', classes: ['daggerheart', 'views', 'dh-style', 'dialog', 'group-roll-dialog'], - position: { width: 380, height: 'auto' }, + position: { width: 390, height: 'auto' }, window: { icon: 'fa-solid fa-users' }, @@ -47,7 +47,7 @@ export default class GroupRollDialog extends HandlebarsApplicationMixin(Applicat makeRoll: this.#makeRoll, removeRoll: this.#removeRoll, rerollDice: this.#rerollDice, - markSuccessfull: this.#markSuccessfull, + markSuccessful: this.#markSuccessful, cancelRoll: this.#onCancelRoll, finishRoll: this.#finishRoll }, @@ -204,7 +204,8 @@ export default class GroupRollDialog extends HandlebarsApplicationMixin(Applicat isEditable: actor?.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER), key: partId, readyToRoll: Boolean(data.rollChoice), - hasRolled: Boolean(data.rollData) + hasRolled: Boolean(data.rollData), + modifier: data.successfull ? 1 : data.successfull === false ? -1 : 0 }; } @@ -406,12 +407,13 @@ export default class GroupRollDialog extends HandlebarsApplicationMixin(Applicat ); } - static #markSuccessfull(_event, button) { - const previousValue = this.party.system.groupRoll.aidingCharacters[button.dataset.member].successfull; - const newValue = Boolean(button.dataset.successfull === 'true'); + static #markSuccessful(_event, button) { + const memberKey = button.closest('[data-member-key]').dataset.memberKey; + const previousValue = this.party.system.groupRoll.aidingCharacters[memberKey].successfull; + const newValue = Boolean(button.dataset.success === 'true'); this.updatePartyData( { - [`system.groupRoll.aidingCharacters.${button.dataset.member}.successfull`]: + [`system.groupRoll.aidingCharacters.${memberKey}.successfull`]: previousValue === newValue ? null : newValue }, this.getUpdatingParts(button) diff --git a/styles/less/dialog/group-roll-dialog/main.less b/styles/less/dialog/group-roll-dialog/main.less index a56281aa..98247a24 100644 --- a/styles/less/dialog/group-roll-dialog/main.less +++ b/styles/less/dialog/group-roll-dialog/main.less @@ -19,15 +19,31 @@ } .item-tags { + gap: 6px; + .tag.failure, .tag.success { + font-weight: 600; + justify-content: center; + min-width: 3ch; + } + + .tag.success { + border-color: @green; background: @green-10; color: @green; } .tag.failure { + border-color: @red; background: @red-10; color: @red; } + + .tag { + padding-top: 0; + padding-bottom: 0; + line-height: 1.1875rem; + } } .member-roll-container { @@ -48,12 +64,30 @@ .trait { display: flex; align-items: center; - gap: var(--spacer-8); + gap: 6px; select { --input-height: 2em; width: auto; } } + .item-tags { + align-items: stretch; + .buttons { + align-items: stretch; + display: flex; + button { + --button-size: auto; + color: var(--medium-red); + padding: 0 var(--spacer-4); + &[data-success=true] { + color: var(--green); + } + &.inactive { + opacity: 0.5; + } + } + } + } } &.inactive { @@ -178,6 +212,10 @@ margin-block: var(--spacer-4); } + .modifiers .item-tags { + min-height: calc(2px + 1.1875rem); + } + .total { .label { font-size: var(--font-size-14); diff --git a/templates/dialogs/groupRollDialog/parts/member.hbs b/templates/dialogs/groupRollDialog/parts/member.hbs index a57600cd..d2cc2b84 100644 --- a/templates/dialogs/groupRollDialog/parts/member.hbs +++ b/templates/dialogs/groupRollDialog/parts/member.hbs @@ -1,13 +1,23 @@ {{#with (ifThen (eq partId "leader") leader (lookup members partId))}}
{{log this}} - {{log @root}}
{{name}} {{#if hasRolled}}
{{rollChoiceLabel}}
+ {{#if modifier}} + + {{numberFormat modifier sign=true}} + + {{/if}} + {{#if (and isEditable (ne ../partId "leader"))}} +
+ + +
+ {{/if}}
{{else if readyToRoll}}
@@ -40,7 +50,7 @@ {{/if}} - {{#if (gte roll.modifierTotal 0)}}+{{else}}-{{/if}} + {{#if (gte roll.modifierTotal 0)}}+{{else}}-{{/if}} {{positive roll.modifierTotal}}
diff --git a/templates/dialogs/groupRollDialog/parts/result.hbs b/templates/dialogs/groupRollDialog/parts/result.hbs index 668c1ef0..993fbb02 100644 --- a/templates/dialogs/groupRollDialog/parts/result.hbs +++ b/templates/dialogs/groupRollDialog/parts/result.hbs @@ -12,7 +12,9 @@ Modifiers
{{#each groupRoll.modifiers as |modifier|}} - {{#if (gte modifier 0)}}+{{else}}-{{/if}}{{positive modifier}} + + {{numberFormat modifier sign=true}} + {{/each}}