diff --git a/module/applications/dialogs/groupRollDialog.mjs b/module/applications/dialogs/groupRollDialog.mjs index 6325795a..821a91a1 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: 390, height: 'auto' }, + position: { width: 380, 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, - markSuccessful: this.#markSuccessful, + markSuccessfull: this.#markSuccessfull, cancelRoll: this.#onCancelRoll, finishRoll: this.#finishRoll }, @@ -204,8 +204,7 @@ 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), - modifier: data.successfull ? 1 : data.successfull === false ? -1 : 0 + hasRolled: Boolean(data.rollData) }; } @@ -407,13 +406,12 @@ export default class GroupRollDialog extends HandlebarsApplicationMixin(Applicat ); } - 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'); + static #markSuccessfull(_event, button) { + const previousValue = this.party.system.groupRoll.aidingCharacters[button.dataset.member].successfull; + const newValue = Boolean(button.dataset.successfull === 'true'); this.updatePartyData( { - [`system.groupRoll.aidingCharacters.${memberKey}.successfull`]: + [`system.groupRoll.aidingCharacters.${button.dataset.member}.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 d89c61bf..a56281aa 100644 --- a/styles/less/dialog/group-roll-dialog/main.less +++ b/styles/less/dialog/group-roll-dialog/main.less @@ -19,58 +19,15 @@ } .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; - } - } - - .with-result { - border-radius: 5px; - background: var(--duality-bg); - color: var(--color-light-2); - - &.hope { - --duality-text-color: @golden; - --duality-bg: url(../assets/parchments/dh-parchment-hope.png); - } - - &.fear { - --duality-text-color: @chat-blue; - --duality-bg: url(../assets/parchments/dh-parchment-fear.png); - } - - &.critical { - --duality-text-color: @chat-purple; - --duality-bg: url(../assets/parchments/dh-parchment-critical.png); - } - - .duality-label { - font-family: var(--dh-font-subtitle); - color: var(--duality-text-color); - font-weight: 700; - } } .member-roll-container { @@ -80,11 +37,6 @@ gap: 8px; height: 3.375rem; - &.inactive { - opacity: 0.3; - pointer-events: none; - } - .name-area { display: flex; flex-direction: column; @@ -96,24 +48,17 @@ .trait { display: flex; align-items: center; - gap: 6px; + gap: var(--spacer-8); select { --input-height: 2em; width: auto; } } - .item-tags { - align-items: stretch; - } } - .buttons { - display: flex; - flex-direction: column; - button { - --button-size: 1.5em; - padding: 0 var(--spacer-4); - } + &.inactive { + opacity: 0.3; + pointer-events: none; } a.roll-button.initial-roll { @@ -121,82 +66,94 @@ height: 1.875rem; margin-right: 2px; /** makes hover look a bit nicer */ } + } + } - .with-result { + .roll-container { + display: flex; + flex-direction: column; + } + + .with-result { + border-radius: 5px; + background: var(--duality-bg); + color: var(--color-light-2); + + &.hope { + --duality-text-color: @golden; + --duality-bg: url(../assets/parchments/dh-parchment-hope.png); + } + + &.fear { + --duality-text-color: @chat-blue; + --duality-bg: url(../assets/parchments/dh-parchment-fear.png); + } + + &.critical { + --duality-text-color: @chat-purple; + --duality-bg: url(../assets/parchments/dh-parchment-critical.png); + } + + .duality-label { + font-family: var(--dh-font-subtitle); + color: var(--duality-text-color); + font-weight: 700; + } + } + + .roll-data { + display: flex; + flex-direction: column; + align-items: end; + justify-content: center; + padding: 0 4px; + min-height: 3rem; + + .duality-label { + font-size: var(--font-size-15); + + .unused-damage { + text-decoration: line-through; + } + + .with { + font-size: var(--font-size-10); + } + } + + .roll-dice-container { + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + gap: 4px; + + .roll-dice { + position: relative; display: flex; - justify-content: end; align-items: center; - gap: 6px; + justify-content: center; - .roll-data { - display: flex; - flex-direction: column; - align-items: end; - justify-content: center; - padding: 0 4px; - min-height: 3rem; - - .duality-label { - font-size: var(--font-size-15); - - .unused-damage { - text-decoration: line-through; - } - - .with { - font-size: var(--font-size-10); - } - } - - .roll-dice-container { - display: flex; - align-items: center; - justify-content: center; - flex-wrap: wrap; - gap: 4px; - - .roll-dice { - position: relative; - display: flex; - align-items: center; - justify-content: center; - - .dice-label { - position: absolute; - color: white; - font-size: 1rem; - paint-order: stroke fill; - -webkit-text-stroke: 2px black; - } - - img { - height: 1.25rem; - } - } - - .roll-operator { - font-size: var(--font-size-18); - } - - .roll-value { - font-size: var(--font-size-16); - } - } + .dice-label { + position: absolute; + color: white; + font-size: 1rem; + paint-order: stroke fill; + -webkit-text-stroke: 2px black; } - .buttons { - gap: 2px; - button { - color: var(--medium-red); - &[data-success=true] { - color: var(--green); - } - &.inactive { - opacity: 0.4; - } - } + img { + height: 1.25rem; } } + + .roll-operator { + font-size: var(--font-size-18); + } + + .roll-value { + font-size: var(--font-size-16); + } } } @@ -221,10 +178,6 @@ 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 535f9992..a57600cd 100644 --- a/templates/dialogs/groupRollDialog/parts/member.hbs +++ b/templates/dialogs/groupRollDialog/parts/member.hbs @@ -1,17 +1,13 @@ {{#with (ifThen (eq partId "leader") leader (lookup members partId))}}
{{log this}} + {{log @root}}
{{name}} {{#if hasRolled}}
{{rollChoiceLabel}}
- {{#if modifier}} - - {{numberFormat modifier sign=true}} - - {{/if}}
{{else if readyToRoll}}
@@ -23,38 +19,30 @@ {{/if}}
{{#if roll}} -
-
-
- {{roll.total}} - {{localize "DAGGERHEART.GENERAL.withThing" thing=roll.totalLabel}} -
-
- - {{roll.dHope.total}} - - - - {{roll.dFear.total}} - - - {{#if roll.advantage.type}} - {{#if (eq roll.advantage.type 1)}}+{{else}}-{{/if}} - - {{roll.advantage.value}} - - - {{/if}} - {{#if (gte roll.modifierTotal 0)}}+{{else}}-{{/if}} - {{positive roll.modifierTotal}} -
+
+
+ {{roll.total}} + {{localize "DAGGERHEART.GENERAL.withThing" thing=roll.totalLabel}} +
+
+ + {{roll.dHope.total}} + + + + {{roll.dFear.total}} + + + {{#if roll.advantage.type}} + {{#if (eq roll.advantage.type 1)}}+{{else}}-{{/if}} + + {{roll.advantage.value}} + + + {{/if}} + {{#if (gte roll.modifierTotal 0)}}+{{else}}-{{/if}} + {{positive roll.modifierTotal}}
- {{#if (and isEditable (ne ../partId "leader"))}} -
- - -
- {{/if}}
{{else if readyToRoll}} diff --git a/templates/dialogs/groupRollDialog/parts/result.hbs b/templates/dialogs/groupRollDialog/parts/result.hbs index 993fbb02..668c1ef0 100644 --- a/templates/dialogs/groupRollDialog/parts/result.hbs +++ b/templates/dialogs/groupRollDialog/parts/result.hbs @@ -12,9 +12,7 @@ Modifiers
{{#each groupRoll.modifiers as |modifier|}} - - {{numberFormat modifier sign=true}} - + {{#if (gte modifier 0)}}+{{else}}-{{/if}}{{positive modifier}} {{/each}}