diff --git a/daggerheart.mjs b/daggerheart.mjs index 4e7d1898..22d28af4 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -106,7 +106,7 @@ Hooks.once('init', () => { Hooks.on('ready', () => { ui.resources = new CONFIG.ui.resources(); ui.resources.render({ force: true }); - document.body.classList.toggle('theme-colorfull', game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme === DualityRollColor.colorful.value); + document.body.classList.toggle('theme-colorful', game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme === DualityRollColor.colorful.value); }); Hooks.once('dicesoniceready', () => {}); diff --git a/module/applications/chatMessage.mjs b/module/applications/chatMessage.mjs index a7f61cd8..4850a0d2 100644 --- a/module/applications/chatMessage.mjs +++ b/module/applications/chatMessage.mjs @@ -11,9 +11,7 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage { const html = await super.renderHTML(); if ( - this.type === 'dualityRoll' && - game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme === - DualityRollColor.colorful.value + this.type === 'dualityRoll' ) { html.classList.add('duality'); const dualityResult = this.system.dualityResult; diff --git a/module/applications/settings/appearanceSettings.mjs b/module/applications/settings/appearanceSettings.mjs index 7603eeea..ae21a612 100644 --- a/module/applications/settings/appearanceSettings.mjs +++ b/module/applications/settings/appearanceSettings.mjs @@ -67,7 +67,7 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App await game.socket.emit('reload'); foundry.utils.debouncedReload(); } */ - document.body.classList.toggle('theme-colorfull', game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme === DualityRollColor.colorful.value); + document.body.classList.toggle('theme-colorful', game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme === DualityRollColor.colorful.value); this.close(); } diff --git a/module/data/chat-message/dualityRoll.mjs b/module/data/chat-message/dualityRoll.mjs index 2da44e2d..c1301e6b 100644 --- a/module/data/chat-message/dualityRoll.mjs +++ b/module/data/chat-message/dualityRoll.mjs @@ -59,8 +59,7 @@ export default class DHDualityRoll extends foundry.abstract.TypeDataModel { }), { nullable: true, initial: null } ) - }), - forceDisplay: new fields.BooleanField({initial: false}) + }) }; } @@ -69,6 +68,7 @@ export default class DHDualityRoll extends foundry.abstract.TypeDataModel { } get modifierTotal() { + // return {value: 12, label: "+12"} const total = this.modifiers.reduce((acc, x) => acc + x.value, 0); return { value: total, @@ -97,7 +97,7 @@ export default class DHDualityRoll extends foundry.abstract.TypeDataModel { get colorful() { return ( - !this.forceDisplay && game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme === + game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme === DualityRollColor.colorful.value ); } diff --git a/module/documents/actor.mjs b/module/documents/actor.mjs index decad99e..2f24a272 100644 --- a/module/documents/actor.mjs +++ b/module/documents/actor.mjs @@ -272,17 +272,9 @@ export default class DhpActor extends Actor { system: systemData, content: config.chatMessage.template, rolls: [roll] - }), - msg2 = new cls({ - type: config.chatMessage.type ?? 'dualityRoll', - sound: config.chatMessage.mute ? null : CONFIG.sounds.dice, - system: {...systemData, forceDisplay: true }, - content: config.chatMessage.template, - rolls: [roll] }); await cls.create(msg.toObject()); - await cls.create(msg2.toObject()); } return roll; } diff --git a/styles/chat.less b/styles/chat.less index cb81b670..11024ebf 100644 --- a/styles/chat.less +++ b/styles/chat.less @@ -332,6 +332,7 @@ > .roll { display: flex; align-items: center; + justify-content: center; gap: 4px; margin-bottom: 4px; .dice-container { @@ -608,19 +609,11 @@ .dice-result { .roll-damage-button, - .damage-button { + .damage-button, + .duality-action { margin-top: 5px; } } - - .dice-actions { - margin-top: 5px; - display: flex; - - button { - flex: 1; - } - } } &.domain-card { @@ -675,7 +668,7 @@ } } -.theme-colorfull { +.theme-colorful { .chat-message.duality { border-color: black; padding: 8px 0 0 0; @@ -752,9 +745,9 @@ gap: .25rem; .dice { .dice-rolls { + margin-bottom: 0; display: flex; gap: 0.25rem; - margin-bottom: 0; li { display: flex; align-items: center; @@ -782,6 +775,10 @@ } .dice-actions { justify-content: space-between; + &.duality-alone { + justify-content: end; + margin-top: -20px; + } .duality-action { color: var(--color-light-1); text-shadow: 0 0 1px black; @@ -795,20 +792,20 @@ margin-left: -8px; flex: unset; } - } - .duality-result { - display: flex; - flex-direction: column; - align-items: end; - justify-content: center; - gap: 2px; - color: var(--color-light-1); - text-shadow: 0 0 1px black; - font-weight: bold; - background: var(--color-dark-1); - padding: 4px 4px 0 4px; - border-radius: 6px 0 0 0; - margin-right: -8px; + .duality-result { + display: flex; + flex-direction: column; + align-items: end; + justify-content: center; + gap: 2px; + color: var(--color-light-1); + text-shadow: 0 0 1px black; + font-weight: bold; + background: var(--color-dark-1); + padding: 4px 4px 0 4px; + border-radius: 6px 0 0 0; + margin-right: -8px; + } } } } diff --git a/styles/daggerheart.css b/styles/daggerheart.css index 84334249..6c212485 100755 --- a/styles/daggerheart.css +++ b/styles/daggerheart.css @@ -1490,6 +1490,7 @@ .daggerheart.chat.roll .dice-tooltip .dice-rolls > .roll { display: flex; align-items: center; + justify-content: center; gap: 4px; margin-bottom: 4px; } @@ -1630,16 +1631,10 @@ flex: 1; } .daggerheart.chat.roll .dice-result .roll-damage-button, -.daggerheart.chat.roll .dice-result .damage-button { +.daggerheart.chat.roll .dice-result .damage-button, +.daggerheart.chat.roll .dice-result .duality-action { margin-top: 5px; } -.daggerheart.chat.roll .dice-actions { - margin-top: 5px; - display: flex; -} -.daggerheart.chat.roll .dice-actions button { - flex: 1; -} .daggerheart.chat.domain-card { display: flex; flex-direction: column; @@ -1682,47 +1677,47 @@ .daggerheart.chat.domain-card img { width: 80px; } -.theme-colorfull .chat-message.duality { +.theme-colorful .chat-message.duality { border-color: black; padding: 8px 0 0 0; } -.theme-colorfull .chat-message.duality .message-header { +.theme-colorful .chat-message.duality .message-header { color: var(--color-light-3); padding: 0 8px; } -.theme-colorfull .chat-message.duality.hope { +.theme-colorful .chat-message.duality.hope { background: linear-gradient(0, rgba(165, 42, 42, 0.6) 40px, rgba(0, 0, 0, 0.6)); } -.theme-colorfull .chat-message.duality.fear { +.theme-colorful .chat-message.duality.fear { background: linear-gradient(0, rgba(0, 0, 255, 0.6), rgba(15, 15, 97, 0.6)); } -.theme-colorfull .chat-message.duality.critical { +.theme-colorful .chat-message.duality.critical { background: linear-gradient(0, rgba(128, 0, 128, 0.6), rgba(37, 8, 37, 0.6)); } -.theme-colorfull .chat-message.duality .chat-message header { +.theme-colorful .chat-message.duality .chat-message header { color: var(--color-light-3); } -.theme-colorfull .chat-message.duality > * { +.theme-colorful .chat-message.duality > * { padding: 0 8px; } -.theme-colorfull .chat-message.duality .message-content .duality-modifiers, -.theme-colorfull .chat-message.duality .message-content .duality-result, -.theme-colorfull .chat-message.duality .message-content .dice-title { +.theme-colorful .chat-message.duality .message-content .duality-modifiers, +.theme-colorful .chat-message.duality .message-content .duality-result, +.theme-colorful .chat-message.duality .message-content .dice-title { display: flex; } -.theme-colorfull .chat-message.duality .message-content .duality-modifiers { +.theme-colorful .chat-message.duality .message-content .duality-modifiers { display: flex; gap: 2px; margin-bottom: 4px; } -.theme-colorfull .chat-message.duality .message-content .duality-modifiers .duality-modifier { +.theme-colorful .chat-message.duality .message-content .duality-modifiers .duality-modifier { padding: 2px; border-radius: 6px; border: 1px solid; background: var(--color-dark-6); font-size: 12px; } -.theme-colorfull .chat-message.duality .message-content .dice-flavor { +.theme-colorful .chat-message.duality .message-content .dice-flavor { color: var(--color-light-1); text-shadow: 0 0 1px black; border-bottom: 1px solid; @@ -1733,37 +1728,37 @@ margin: 0 -8px 2px; font-weight: unset; } -.theme-colorfull .chat-message.duality .message-content .dice-result .duality-modifiers { +.theme-colorful .chat-message.duality .message-content .dice-result .duality-modifiers { display: flex; gap: 2px; margin-bottom: 4px; } -.theme-colorfull .chat-message.duality .message-content .dice-result .duality-modifiers .duality-modifier { +.theme-colorful .chat-message.duality .message-content .dice-result .duality-modifiers .duality-modifier { padding: 2px; border-radius: 6px; border: 1px solid; background: var(--color-dark-6); font-size: 12px; } -.theme-colorfull .chat-message.duality .message-content .dice-result .dice-formula, -.theme-colorfull .chat-message.duality .message-content .dice-result > .dice-total, -.theme-colorfull .chat-message.duality .message-content .dice-result .part-header { +.theme-colorful .chat-message.duality .message-content .dice-result .dice-formula, +.theme-colorful .chat-message.duality .message-content .dice-result > .dice-total, +.theme-colorful .chat-message.duality .message-content .dice-result .part-header { display: none; } -.theme-colorfull .chat-message.duality .message-content .dice-result .dice-tooltip { +.theme-colorful .chat-message.duality .message-content .dice-result .dice-tooltip { grid-template-rows: 1fr; } -.theme-colorfull .chat-message.duality .message-content .dice-result .dice-tooltip .wrapper .tooltip-part { +.theme-colorful .chat-message.duality .message-content .dice-result .dice-tooltip .wrapper .tooltip-part { display: flex; align-items: end; gap: 0.25rem; } -.theme-colorfull .chat-message.duality .message-content .dice-result .dice-tooltip .wrapper .tooltip-part .dice .dice-rolls { +.theme-colorful .chat-message.duality .message-content .dice-result .dice-tooltip .wrapper .tooltip-part .dice .dice-rolls { + margin-bottom: 0; display: flex; gap: 0.25rem; - margin-bottom: 0; } -.theme-colorfull .chat-message.duality .message-content .dice-result .dice-tooltip .wrapper .tooltip-part .dice .dice-rolls li { +.theme-colorful .chat-message.duality .message-content .dice-result .dice-tooltip .wrapper .tooltip-part .dice .dice-rolls li { display: flex; align-items: center; justify-content: center; @@ -1772,21 +1767,25 @@ line-height: unset; font-weight: unset; } -.theme-colorfull .chat-message.duality .message-content .dice-result .target-section { +.theme-colorful .chat-message.duality .message-content .dice-result .target-section { margin: 4px 0; border: 2px solid; margin-top: 5px; } -.theme-colorfull .chat-message.duality .message-content .dice-result .target-section .dice-total { +.theme-colorful .chat-message.duality .message-content .dice-result .target-section .dice-total { box-shadow: unset; border: unset; border-radius: unset; font-size: var(--font-size-18); } -.theme-colorfull .chat-message.duality .message-content .dice-result .dice-actions { +.theme-colorful .chat-message.duality .message-content .dice-result .dice-actions { justify-content: space-between; } -.theme-colorfull .chat-message.duality .message-content .dice-result .dice-actions .duality-action { +.theme-colorful .chat-message.duality .message-content .dice-result .dice-actions.duality-alone { + justify-content: end; + margin-top: -20px; +} +.theme-colorful .chat-message.duality .message-content .dice-result .dice-actions .duality-action { color: var(--color-light-1); text-shadow: 0 0 1px black; font-weight: bold; @@ -1799,7 +1798,7 @@ margin-left: -8px; flex: unset; } -.theme-colorfull .chat-message.duality .message-content .dice-result .duality-result { +.theme-colorful .chat-message.duality .message-content .dice-result .dice-actions .duality-result { display: flex; flex-direction: column; align-items: end; diff --git a/templates/chat/duality-roll.hbs b/templates/chat/duality-roll.hbs index 2892cf04..723ec98a 100644 --- a/templates/chat/duality-roll.hbs +++ b/templates/chat/duality-roll.hbs @@ -218,14 +218,14 @@ {{/each}} {{/if}} - {{#if damage.value}} -