From 76cfcb29ea8917f5cfedf721fb05d726975ce263 Mon Sep 17 00:00:00 2001 From: moliloo Date: Mon, 28 Jul 2025 23:44:48 -0300 Subject: [PATCH] style remaing chat messages --- module/applications/dialogs/deathMove.mjs | 2 + module/documents/chatMessage.mjs | 8 ++- module/documents/item.mjs | 4 ++ styles/less/global/chat.less | 29 ++++++---- styles/less/ui/chat/downtime.less | 32 ----------- styles/less/ui/chat/sheet.less | 69 +++++++++++++++++++++++ templates/ui/chat/chat-message.hbs | 4 +- templates/ui/chat/deathMove.hbs | 7 --- templates/ui/chat/downtime.hbs | 7 --- 9 files changed, 103 insertions(+), 59 deletions(-) diff --git a/module/applications/dialogs/deathMove.mjs b/module/applications/dialogs/deathMove.mjs index 81808790..f7de27ab 100644 --- a/module/applications/dialogs/deathMove.mjs +++ b/module/applications/dialogs/deathMove.mjs @@ -54,6 +54,8 @@ export default class DhpDeathMove extends HandlebarsApplicationMixin(Application { player: this.actor.name, actor: { name: this.actor.name, img: this.actor.img }, + author: this.author, + speaker: cls.getSpeaker(), title: game.i18n.localize(this.selectedMove.name), img: this.selectedMove.img, description: game.i18n.localize(this.selectedMove.description) diff --git a/module/documents/chatMessage.mjs b/module/documents/chatMessage.mjs index 82562bcf..b1c184f7 100644 --- a/module/documents/chatMessage.mjs +++ b/module/documents/chatMessage.mjs @@ -7,9 +7,13 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage { }); const actor = game.actors.get(this.speaker.actor); - const actorData = actor ?? { img: 'icons/svg/mystery-man.svg', name: '' }; + const actorData = actor ?? { + img: this.author.avatar ? this.author.avatar : 'icons/svg/mystery-man.svg', + name: '' + }; /* We can change to fully implementing the renderHTML function if needed, instead of augmenting it. */ - const html = await super.renderHTML({ actor: actorData }); + const html = await super.renderHTML({ actor: actorData, author: this.author }); + console.log(this.author); this.applyPermission(html); if (this.type === 'dualityRoll') { diff --git a/module/documents/item.mjs b/module/documents/item.mjs index f69bcbc2..b6dfb280 100644 --- a/module/documents/item.mjs +++ b/module/documents/item.mjs @@ -128,7 +128,11 @@ export default class DHItem extends foundry.documents.Item { const msg = new cls({ type: 'abilityUse', user: game.user.id, + actor: this.actor, + author: this.author, + speaker: cls.getSpeaker(), system: systemData, + title: game.i18n.localize('DAGGERHEART.ACTIONS.Config.displayInChat'), content: await foundry.applications.handlebars.renderTemplate( 'systems/daggerheart/templates/ui/chat/ability-use.hbs', systemData diff --git a/styles/less/global/chat.less b/styles/less/global/chat.less index 11aaf92c..54d1ba46 100644 --- a/styles/less/global/chat.less +++ b/styles/less/global/chat.less @@ -3,14 +3,21 @@ @import '../utils/mixin.less'; .theme-light { - .daggerheart.chat-sidebar .chat-log { + .daggerheart.chat-sidebar .chat-log, + #chat-notifications .chat-log { .chat-message { background-image: url('../assets/parchments/dh-parchment-light.png'); } } } -.daggerheart.chat-sidebar { +#chat-message { + font-family: @font-body; + padding: 8px; +} + +.daggerheart.chat-sidebar, +#chat-notifications { .chat-log { .chat-message { border: none !important; @@ -28,18 +35,21 @@ .message-metadata { font-family: @font-body; + color: light-dark(@dark, @beige); } } .message-header-main { - flex: 1; display: flex; + align-items: center; gap: 8px; + flex: 1; .actor-img { border-radius: 50%; - width: 60px; - height: 60px; + width: 40px; + height: 40px; + object-fit: cover; } .message-sub-header-container { @@ -47,15 +57,14 @@ display: flex; flex-direction: column; justify-content: space-between; - padding: 4px 0; - color: @beige; + color: light-dark(@dark, @beige); h4 { - font-size: 20px; + font-size: 16px; font-weight: bold; margin-bottom: 0; - font-family: @font-body; - color: @golden; + font-family: @font-subtitle; + color: light-dark(@dark-blue, @golden); } } } diff --git a/styles/less/ui/chat/downtime.less b/styles/less/ui/chat/downtime.less index ab9ca3dc..0aa7acb1 100644 --- a/styles/less/ui/chat/downtime.less +++ b/styles/less/ui/chat/downtime.less @@ -8,38 +8,6 @@ flex-direction: column; align-items: center; - .downtime-header { - display: flex; - gap: 13px; - flex-direction: row; - align-items: center; - width: 100%; - padding-left: 8px; - margin-bottom: 12px; - - .profile { - width: 40px; - height: 40px; - border-radius: 50%; - object-fit: cover; - } - - .header-label { - .title { - font-size: 20px; - color: @golden; - font-family: @font-subtitle; - margin: 0; - } - .label { - font-size: 12px; - color: @beige; - font-family: @font-body; - margin: 0; - } - } - } - .downtime-moves-list { display: flex; flex-direction: column; diff --git a/styles/less/ui/chat/sheet.less b/styles/less/ui/chat/sheet.less index 1c41f97e..1c57bb13 100644 --- a/styles/less/ui/chat/sheet.less +++ b/styles/less/ui/chat/sheet.less @@ -1,3 +1,12 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.chat-message.dh-chat-message { + .message-content { + padding: 0; + } +} + .chat-message { .duality-modifiers, .duality-result, @@ -6,6 +15,66 @@ } .message-content { + padding: 0 8px; + font-family: @font-body; + color: light-dark(@dark, @beige); + + blockquote { + border-left: 5px solid light-dark(@dark-blue-40, @golden-40); + } + + a[href] { + color: light-dark(@dark-blue, @golden); + } + + a[href]:hover, + a[href].active { + font-weight: bold; + text-shadow: 0 0 8px light-dark(@dark-blue, @golden); + } + + button { + background: light-dark(transparent, @golden); + border: 1px solid light-dark(@dark-blue, @dark-blue); + color: light-dark(@dark-blue, @dark-blue); + outline: none; + box-shadow: none; + + &:hover { + background: light-dark(@light-black, @dark-blue); + color: light-dark(@dark-blue, @golden); + } + + &.glow { + animation: glow 0.75s infinite alternate; + } + + &:disabled { + background: light-dark(transparent, @golden); + color: light-dark(@dark-blue, @dark-blue); + opacity: 0.6; + cursor: not-allowed; + + &:hover { + background: light-dark(transparent, @golden); + color: light-dark(@dark-blue, @dark-blue); + } + } + + &.reverted { + background: light-dark(@dark-blue-10, @golden-10); + color: light-dark(@dark-blue, @golden); + border: 1px solid light-dark(@dark, transparent); + &:hover { + background: light-dark(transparent, @golden); + color: light-dark(@dark-blue, @dark-blue); + } + img { + border-radius: 3px; + } + } + } + .enriched-effect { display: flex; align-items: center; diff --git a/templates/ui/chat/chat-message.hbs b/templates/ui/chat/chat-message.hbs index d275a137..4132e495 100644 --- a/templates/ui/chat/chat-message.hbs +++ b/templates/ui/chat/chat-message.hbs @@ -5,7 +5,9 @@

{{ifThen message.title message.title alias}}

-
{{actor.name}}
+ {{#if actor.name}} +
{{actor.name}} {{#if author.isGM}}(GM){{/if}}
+ {{/if}}
diff --git a/templates/ui/chat/deathMove.hbs b/templates/ui/chat/deathMove.hbs index 01bc2398..cb50fd5d 100644 --- a/templates/ui/chat/deathMove.hbs +++ b/templates/ui/chat/deathMove.hbs @@ -1,11 +1,4 @@
-
- -
-

{{localize 'DAGGERHEART.UI.Chat.deathMove.title'}}

- {{actor.name}} -
-
  • diff --git a/templates/ui/chat/downtime.hbs b/templates/ui/chat/downtime.hbs index e8e9f5c9..9eb95ce9 100644 --- a/templates/ui/chat/downtime.hbs +++ b/templates/ui/chat/downtime.hbs @@ -1,11 +1,4 @@
    -
    - -
    -

    {{title}}

    - {{actor.name}} -
    -
      {{#each moves as | move index |}}