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
};
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

View file

@ -121,21 +121,37 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) {
*/
static async #sendExpToChat(_, button) {
const experience = this.document.system.experiences[button.dataset.id];
const cls = getDocumentClass('ChatMessage');
const systemData = {
name: game.i18n.localize('DAGGERHEART.GENERAL.Experience.single'),
description: `${experience.name} ${experience.value.signedString()}`
actor: { name: this.actor.name, img: this.actor.img },
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({
type: 'abilityUse',
const msg = {
user: game.user.id,
system: systemData,
content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/ui/chat/ability-use.hbs',
'systems/daggerheart/templates/ui/chat/action.hbs',
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) {
const cls = getDocumentClass('ChatMessage');
const actor = game.actors.get(cls.getSpeaker().actor);
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,
img: this.img,
name: this.name,
description: this.description,
actions: []
};
const msg = {
type: 'abilityUse',
title: game.i18n.localize('DAGGERHEART.GENERAL.Effect.single'),
user: game.user.id,
system: systemData,
content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/ui/chat/ability-use.hbs',
'systems/daggerheart/templates/ui/chat/action.hbs',
systemData
)
};

View file

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

View file

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

View file

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