fix labels in duality rolls messages and style experience and effects messages

This commit is contained in:
moliloo 2025-08-02 02:14:58 -03:00
parent b2fbb6ff50
commit 5463b0c7ed
6 changed files with 79 additions and 46 deletions

View file

@ -614,7 +614,13 @@ export default class CharacterSheet extends DHBaseActorSheet {
}, },
hasRoll: true hasRoll: true
}; };
this.document.diceRoll(config); this.document.diceRoll({
...config,
headerTitle: `${game.i18n.localize('DAGGERHEART.GENERAL.dualityRoll')}: ${this.actor.name}`,
title: game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle', {
ability: abilityLabel
})
});
} }
//TODO: redo toggleEquipItem method //TODO: redo toggleEquipItem method

View file

@ -121,21 +121,37 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) {
*/ */
static async #sendExpToChat(_, button) { static async #sendExpToChat(_, button) {
const experience = this.document.system.experiences[button.dataset.id]; const experience = this.document.system.experiences[button.dataset.id];
const cls = getDocumentClass('ChatMessage');
const systemData = { const systemData = {
name: game.i18n.localize('DAGGERHEART.GENERAL.Experience.single'), actor: { name: this.actor.name, img: this.actor.img },
description: `${experience.name} ${experience.value.signedString()}` author: game.users.get(game.user.id),
action: {
name: `${experience.name} ${experience.value.signedString()}`,
img: '/icons/sundries/misc/admission-ticket-blue.webp'
},
itemOrigin: {
name: game.i18n.localize('DAGGERHEART.GENERAL.Experience.single')
},
description: experience.description
}; };
foundry.documents.ChatMessage.implementation.create({ const msg = {
type: 'abilityUse',
user: game.user.id, user: game.user.id,
system: systemData,
content: await foundry.applications.handlebars.renderTemplate( content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/ui/chat/ability-use.hbs', 'systems/daggerheart/templates/ui/chat/action.hbs',
systemData systemData
) ),
}); title: game.i18n.localize('DAGGERHEART.ACTIONS.Config.displayInChat'),
speaker: cls.getSpeaker(),
flags: {
daggerheart: {
cssClass: 'dh-chat-message dh-style'
}
}
};
cls.create(msg);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View file

@ -115,20 +115,22 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
async toChat(origin) { async toChat(origin) {
const cls = getDocumentClass('ChatMessage'); const cls = getDocumentClass('ChatMessage');
const actor = game.actors.get(cls.getSpeaker().actor);
const systemData = { const systemData = {
title: game.i18n.localize('DAGGERHEART.CONFIG.ActionType.action'), action: { img: this.img, name: this.name },
actor: { name: actor.name, img: actor.img },
author: this.author,
speaker: cls.getSpeaker(),
origin: origin, origin: origin,
img: this.img,
name: this.name,
description: this.description, description: this.description,
actions: [] actions: []
}; };
const msg = { const msg = {
type: 'abilityUse', title: game.i18n.localize('DAGGERHEART.GENERAL.Effect.single'),
user: game.user.id, user: game.user.id,
system: systemData, system: systemData,
content: await foundry.applications.handlebars.renderTemplate( content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/ui/chat/ability-use.hbs', 'systems/daggerheart/templates/ui/chat/action.hbs',
systemData systemData
) )
}; };

View file

@ -364,7 +364,8 @@
} }
} }
.daggerheart, #chat-notifications { .daggerheart,
#chat-notifications {
.chat-message { .chat-message {
--text-color: light-dark(@dark-blue, @golden); --text-color: light-dark(@dark-blue, @golden);
--bg-color: light-dark(@dark-blue-40, @golden-40); --bg-color: light-dark(@dark-blue-40, @golden-40);
@ -373,7 +374,8 @@
&.hope { &.hope {
--text-color: @golden; --text-color: @golden;
--bg-color: @golden-40; --bg-color: @golden-40;
.message-header, .message-content { .message-header,
.message-content {
background-color: @golden-bg; background-color: @golden-bg;
} }
} }
@ -381,7 +383,8 @@
&.fear { &.fear {
--text-color: @chat-blue; --text-color: @chat-blue;
--bg-color: @chat-blue-40; --bg-color: @chat-blue-40;
.message-header, .message-content { .message-header,
.message-content {
background-color: @chat-blue-bg; background-color: @chat-blue-bg;
} }
} }
@ -389,7 +392,8 @@
&.critical { &.critical {
--text-color: @chat-purple; --text-color: @chat-purple;
--bg-color: @chat-purple-40; --bg-color: @chat-purple-40;
.message-header, .message-content { .message-header,
.message-content {
background-color: @chat-purple-bg; background-color: @chat-purple-bg;
} }
} }
@ -418,17 +422,18 @@
padding: 0 10px; padding: 0 10px;
} }
&:before, &:after { &:before,
&:after {
content: ' '; content: ' ';
height: 1px; height: 1px;
} }
&:before { &:before {
background: linear-gradient(90deg,rgba(0, 0, 0, 0) 0%, var(--text-color) 100%); background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, var(--text-color) 100%);
} }
&:after { &:after {
background: linear-gradient(90deg,var(--text-color) 0%, rgba(0, 0, 0, 0) 100%); background: linear-gradient(90deg, var(--text-color) 0%, rgba(0, 0, 0, 0) 100%);
} }
} }
@ -468,6 +473,7 @@
.roll-result-container { .roll-result-container {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center;
gap: 10px; gap: 10px;
color: var(--text-color); color: var(--text-color);
font-weight: 700; font-weight: 700;
@ -550,7 +556,8 @@
text-align: center; text-align: center;
} }
.button-target-selection:hover, .target-selected { .button-target-selection:hover,
.target-selected {
font-weight: bold; font-weight: bold;
text-shadow: 0px 0px 8px var(--text-color); text-shadow: 0px 0px 8px var(--text-color);
} }
@ -608,7 +615,8 @@
margin: auto; margin: auto;
} }
.roll-difficulty, .target-hit-status { .roll-difficulty,
.target-hit-status {
color: @green; color: @green;
background-color: @green-10; background-color: @green-10;
border: 1px solid currentColor; border: 1px solid currentColor;
@ -628,9 +636,10 @@
margin-top: 2px; margin-top: 2px;
} }
div[data-action="expandRoll"] { div[data-action='expandRoll'] {
.roll-part-header > div > span { .roll-part-header > div > span {
&:before, &:after { &:before,
&:after {
content: '\f078'; content: '\f078';
font-family: var(--font-awesome); font-family: var(--font-awesome);
color: var(--text-color); color: var(--text-color);
@ -653,7 +662,8 @@
&.expanded { &.expanded {
.roll-part-header > div > span { .roll-part-header > div > span {
&:before, &:after { &:before,
&:after {
transform: rotate(180deg); transform: rotate(180deg);
} }
} }

View file

@ -11,18 +11,14 @@
@chat-blue-40: #8f87ee40; @chat-blue-40: #8f87ee40;
@chat-blue-bg: #14142599; @chat-blue-bg: #14142599;
@chat-purple: #f3c267; @chat-purple: #a778b1;
@chat-purple-10: #f3c26710; @chat-purple-10: #a778b110;
@chat-purple-40: #f3c26740; @chat-purple-40: #a778b140;
@chat-purple-bg: #2a152e99; @chat-purple-bg: #2a152e99;
@red: #a778b1; @medium-red: #d04747;
@red-10: #a778b110; @medium-red-10: #d0474710;
@red-40: #a778b140; @medium-red-40: #d0474740;
@medium-red: #D04747;
@medium-red-10: #D0474710;
@medium-red-40: #D0474740;
@dark-golden: #2b1d03; @dark-golden: #2b1d03;
@dark-golden-80: #2b1d0380; @dark-golden-80: #2b1d0380;

View file

@ -3,14 +3,17 @@
<header class="message-header flexrow"> <header class="message-header flexrow">
<div class="message-header-main"> <div class="message-header-main">
<img class="actor-img" src="{{actor.img}}" /> <img class="actor-img" src="{{actor.img}}" />
{{#if (eq message.type 'base')}}
<div class="message-sub-header-container">
<h4>{{actor.name}}</h4>
<div>{{author.name}}</div>
</div>
{{else}}
<div class="message-sub-header-container"> <div class="message-sub-header-container">
<h4>{{ifThen message.title message.title alias}}</h4> <h4>{{ifThen message.title message.title alias}}</h4>
{{#if actor.name}}
<div>{{actor.name}} {{#if author.isGM}}(GM){{/if}}</div> <div>{{actor.name}} {{#if author.isGM}}(GM){{/if}}</div>
{{else unless (eq message.type 'base')}}
<div>{{alias}}</div>
{{/if}}
</div> </div>
{{/if}}
</div> </div>
<div class="message-header-metadata"> <div class="message-header-metadata">
<span class="message-metadata"> <span class="message-metadata">