mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 13:11:08 +01:00
Added effect message
This commit is contained in:
parent
744412bf9f
commit
30229407cd
5 changed files with 106 additions and 1 deletions
|
|
@ -2322,6 +2322,7 @@
|
||||||
"action": {
|
"action": {
|
||||||
"title": "Action"
|
"title": "Action"
|
||||||
},
|
},
|
||||||
|
"appliedTo": "Applied To",
|
||||||
"applyEffect": {
|
"applyEffect": {
|
||||||
"title": "Apply Effects - {name}"
|
"title": "Apply Effects - {name}"
|
||||||
},
|
},
|
||||||
|
|
@ -2331,6 +2332,10 @@
|
||||||
"rollHealing": "Roll Healing",
|
"rollHealing": "Roll Healing",
|
||||||
"applyEffect": "Apply Effects"
|
"applyEffect": "Apply Effects"
|
||||||
},
|
},
|
||||||
|
"damageSummary": {
|
||||||
|
"title": "Damage Applied",
|
||||||
|
"healingTitle": "Healing Applied"
|
||||||
|
},
|
||||||
"damageRoll": {
|
"damageRoll": {
|
||||||
"title": "Damage - {damage}",
|
"title": "Damage - {damage}",
|
||||||
"dealDamageToTargets": "Damage Hit Targets",
|
"dealDamageToTargets": "Damage Hit Targets",
|
||||||
|
|
@ -2352,6 +2357,9 @@
|
||||||
"dualityRoll": {
|
"dualityRoll": {
|
||||||
"abilityCheckTitle": "{ability} Check"
|
"abilityCheckTitle": "{ability} Check"
|
||||||
},
|
},
|
||||||
|
"effectSummary": {
|
||||||
|
"title": "Effects Applied"
|
||||||
|
},
|
||||||
"featureTitle": "Class Feature",
|
"featureTitle": "Class Feature",
|
||||||
"healingRoll": {
|
"healingRoll": {
|
||||||
"title": "Heal - {damage}",
|
"title": "Heal - {damage}",
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,9 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
const msg = {
|
const msg = {
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
speaker: cls.getSpeaker(),
|
speaker: cls.getSpeaker(),
|
||||||
title: game.i18n.localize('DAGGERHEART.UI.Chat.deathMove.title'),
|
title: game.i18n.localize(
|
||||||
|
`DAGGERHEART.UI.Chat.damageSummary.${this.system.hasHealing ? 'healingTitle' : 'title'}`
|
||||||
|
),
|
||||||
content: await foundry.applications.handlebars.renderTemplate(
|
content: await foundry.applications.handlebars.renderTemplate(
|
||||||
'systems/daggerheart/templates/ui/chat/damageSummary.hbs',
|
'systems/daggerheart/templates/ui/chat/damageSummary.hbs',
|
||||||
{
|
{
|
||||||
|
|
@ -255,6 +257,25 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected'));
|
ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected'));
|
||||||
this.consumeOnSuccess();
|
this.consumeOnSuccess();
|
||||||
await action.applyEffects(event, this, targets);
|
await action.applyEffects(event, this, targets);
|
||||||
|
|
||||||
|
const effects = this.system.action.item.effects.filter(effect =>
|
||||||
|
this.system.action.effects.some(x => x._id === effect.id)
|
||||||
|
);
|
||||||
|
const cls = getDocumentClass('ChatMessage');
|
||||||
|
const msg = {
|
||||||
|
user: game.user.id,
|
||||||
|
speaker: cls.getSpeaker(),
|
||||||
|
title: game.i18n.localize('DAGGERHEART.UI.Chat.effectSummary.title'),
|
||||||
|
content: await foundry.applications.handlebars.renderTemplate(
|
||||||
|
'systems/daggerheart/templates/ui/chat/effectSummary.hbs',
|
||||||
|
{
|
||||||
|
effects,
|
||||||
|
targets
|
||||||
|
}
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
cls.create(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
54
styles/less/ui/chat/effect-summary.less
Normal file
54
styles/less/ui/chat/effect-summary.less
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
.daggerheart.chat.effect-summary {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
h5 {
|
||||||
|
color: light-dark(@dark, @beige);
|
||||||
|
margin: 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.effects-container {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.targets-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.effect-target-container,
|
||||||
|
.token-target-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 2px;
|
||||||
|
border: 1px solid light-dark(@dark-blue, @golden);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 0 2px;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
flex: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.token-target-container {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
filter: drop-shadow(0 0 3px @golden);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
@import './chat/chat.less';
|
@import './chat/chat.less';
|
||||||
@import './chat/damage-summary.less';
|
@import './chat/damage-summary.less';
|
||||||
@import './chat/downtime.less';
|
@import './chat/downtime.less';
|
||||||
|
@import './chat/effect-summary.less';
|
||||||
@import './chat/sheet.less';
|
@import './chat/sheet.less';
|
||||||
|
|
||||||
@import './combat-sidebar/combat-sidebar.less';
|
@import './combat-sidebar/combat-sidebar.less';
|
||||||
|
|
|
||||||
21
templates/ui/chat/effectSummary.hbs
Normal file
21
templates/ui/chat/effectSummary.hbs
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
<div class="daggerheart chat effect-summary">
|
||||||
|
<h5>{{localize "DAGGERHEART.GENERAL.Effect.plural"}}</h5>
|
||||||
|
<div class="effects-container">
|
||||||
|
{{#each effects}}
|
||||||
|
<div class="effect-target-container" data-tooltip="{{concat "#item#" this.uuid}}">
|
||||||
|
<img src="{{this.img}}" />
|
||||||
|
<label>{{this.name}}</label>
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h5>{{localize "DAGGERHEART.UI.Chat.appliedTo"}}</h5>
|
||||||
|
<div class="targets-container">
|
||||||
|
{{#each targets}}
|
||||||
|
<div class="token-target-container" data-token-uuid="{{this.uuid}}">
|
||||||
|
<img src="{{this.texture.src}}" />
|
||||||
|
<label>{{this.name}}</label>
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue