Merge branch 'development' into feature/313-preset-measured-templates

This commit is contained in:
Chris Ryan 2025-11-07 19:57:47 +10:00
commit bea6140c66
26 changed files with 700 additions and 154 deletions

View file

@ -34,15 +34,6 @@ Hooks.once('init', () => {
CONFIG.TextEditor.enrichers.push(...enricherConfig); CONFIG.TextEditor.enrichers.push(...enricherConfig);
CONFIG.statusEffects = [
...CONFIG.statusEffects.filter(x => !['dead', 'unconscious'].includes(x.id)),
...Object.values(SYSTEM.GENERAL.conditions).map(x => ({
...x,
name: game.i18n.localize(x.name),
systemEffect: true
}))
];
CONFIG.Dice.daggerheart = { CONFIG.Dice.daggerheart = {
DHRoll: DHRoll, DHRoll: DHRoll,
DualityRoll: DualityRoll, DualityRoll: DualityRoll,
@ -160,6 +151,17 @@ Hooks.once('init', () => {
return handlebarsRegistration(); return handlebarsRegistration();
}); });
Hooks.on('setup', () => {
CONFIG.statusEffects = [
...CONFIG.statusEffects.filter(x => !['dead', 'unconscious'].includes(x.id)),
...Object.values(SYSTEM.GENERAL.conditions()).map(x => ({
...x,
name: game.i18n.localize(x.name),
systemEffect: true
}))
];
});
Hooks.on('ready', async () => { Hooks.on('ready', async () => {
ui.resources = new CONFIG.ui.resources(); ui.resources = new CONFIG.ui.resources();
if (game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).displayFear !== 'hide') if (game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).displayFear !== 'hide')

View file

@ -2309,6 +2309,9 @@
"label": "Apply Effects", "label": "Apply Effects",
"hint": "Automatically apply effects. Targets must be selected before the action is made and Reaction Roll Automation must be different than Never. Bypass users permissions." "hint": "Automatically apply effects. Targets must be selected before the action is made and Reaction Roll Automation must be different than Never. Bypass users permissions."
} }
},
"summaryMessages": {
"label": "Summary Messages"
} }
}, },
"defeated": { "defeated": {
@ -2430,6 +2433,7 @@
"action": { "action": {
"title": "Action" "title": "Action"
}, },
"appliedTo": "Applied To",
"applyEffect": { "applyEffect": {
"title": "Apply Effects - {name}" "title": "Apply Effects - {name}"
}, },
@ -2439,6 +2443,11 @@
"rollHealing": "Roll Healing", "rollHealing": "Roll Healing",
"applyEffect": "Apply Effects" "applyEffect": "Apply Effects"
}, },
"clearResource": "Clear {quantity} {resource}",
"damageSummary": {
"title": "Damage Applied",
"healingTitle": "Healing Applied"
},
"damageRoll": { "damageRoll": {
"title": "Damage - {damage}", "title": "Damage - {damage}",
"dealDamageToTargets": "Damage Hit Targets", "dealDamageToTargets": "Damage Hit Targets",
@ -2460,12 +2469,16 @@
"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}",
"heal": "Heal", "heal": "Heal",
"applyHealing": "Apply Healing" "applyHealing": "Apply Healing"
}, },
"markResource": "Mark {quantity} {resource}",
"refreshMessage": { "refreshMessage": {
"title": "Feature Refresh", "title": "Feature Refresh",
"header": "Refreshed" "header": "Refreshed"

View file

@ -164,28 +164,31 @@ export const healingTypes = {
} }
}; };
export const defeatedConditions = { export const defeatedConditions = () => {
defeated: { const defeated = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).defeated;
id: 'defeated', return {
name: 'DAGGERHEART.CONFIG.Condition.defeated.name', defeated: {
img: 'icons/magic/control/fear-fright-mask-orange.webp', id: 'defeated',
description: 'DAGGERHEART.CONFIG.Condition.defeated.description' name: 'DAGGERHEART.CONFIG.Condition.defeated.name',
}, img: defeated.defeatedIcon,
unconscious: { description: 'DAGGERHEART.CONFIG.Condition.defeated.description'
id: 'unconscious', },
name: 'DAGGERHEART.CONFIG.Condition.unconscious.name', unconscious: {
img: 'icons/magic/control/sleep-bubble-purple.webp', id: 'unconscious',
description: 'DAGGERHEART.CONFIG.Condition.unconscious.description' name: 'DAGGERHEART.CONFIG.Condition.unconscious.name',
}, img: defeated.unconsciousIcon,
dead: { description: 'DAGGERHEART.CONFIG.Condition.unconscious.description'
id: 'dead', },
name: 'DAGGERHEART.CONFIG.Condition.dead.name', dead: {
img: 'icons/magic/death/grave-tombstone-glow-teal.webp', id: 'dead',
description: 'DAGGERHEART.CONFIG.Condition.dead.description' name: 'DAGGERHEART.CONFIG.Condition.dead.name',
} img: defeated.deadIcon,
description: 'DAGGERHEART.CONFIG.Condition.dead.description'
}
};
}; };
export const conditions = { export const conditions = () => ({
vulnerable: { vulnerable: {
id: 'vulnerable', id: 'vulnerable',
name: 'DAGGERHEART.CONFIG.Condition.vulnerable.name', name: 'DAGGERHEART.CONFIG.Condition.vulnerable.name',
@ -204,8 +207,8 @@ export const conditions = {
img: 'icons/magic/control/debuff-chains-shackle-movement-red.webp', img: 'icons/magic/control/debuff-chains-shackle-movement-red.webp',
description: 'DAGGERHEART.CONFIG.Condition.restrained.description' description: 'DAGGERHEART.CONFIG.Condition.restrained.description'
}, },
...defeatedConditions ...defeatedConditions()
}; });
export const defaultRestOptions = { export const defaultRestOptions = {
shortRest: () => ({ shortRest: () => ({

View file

@ -1,9 +1,11 @@
import DHAbilityUse from './abilityUse.mjs'; import DHAbilityUse from './abilityUse.mjs';
import DHActorRoll from './actorRoll.mjs'; import DHActorRoll from './actorRoll.mjs';
import DHSystemMessage from './systemMessage.mjs';
export const config = { export const config = {
abilityUse: DHAbilityUse, abilityUse: DHAbilityUse,
adversaryRoll: DHActorRoll, adversaryRoll: DHActorRoll,
damageRoll: DHActorRoll, damageRoll: DHActorRoll,
dualityRoll: DHActorRoll dualityRoll: DHActorRoll,
systemMessage: DHSystemMessage
}; };

View file

@ -0,0 +1,9 @@
export default class DHSystemMessage extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
useTitle: new fields.BooleanField({ initial: true })
};
}
}

View file

@ -81,6 +81,9 @@ export default class DamageField extends fields.SchemaField {
static async applyDamage(config, targets = null, force = false) { static async applyDamage(config, targets = null, force = false) {
targets ??= config.targets.filter(target => target.hit); targets ??= config.targets.filter(target => target.hit);
if (!config.damage || !targets?.length || (!DamageField.getApplyAutomation() && !force)) return; if (!config.damage || !targets?.length || (!DamageField.getApplyAutomation() && !force)) return;
const targetDamage = [];
const damagePromises = [];
for (let target of targets) { for (let target of targets) {
const actor = fromUuidSync(target.actorId); const actor = fromUuidSync(target.actorId);
if (!actor) continue; if (!actor) continue;
@ -95,9 +98,45 @@ export default class DamageField extends fields.SchemaField {
}); });
} }
if (config.hasHealing) actor.takeHealing(config.damage); if (config.hasHealing)
else actor.takeDamage(config.damage, config.isDirect); damagePromises.push(
actor
.takeHealing(config.damage)
.then(updates => targetDamage.push({ token: actor.token ?? actor.prototypeToken, updates }))
);
else
damagePromises.push(
actor
.takeDamage(config.damage, config.isDirect)
.then(updates => targetDamage.push({ token: actor.token ?? actor.prototypeToken, updates }))
);
} }
Promise.all(damagePromises).then(async _ => {
const summaryMessageSettings = game.settings.get(
CONFIG.DH.id,
CONFIG.DH.SETTINGS.gameSettings.Automation
).summaryMessages;
if (!summaryMessageSettings.damage) return;
const cls = getDocumentClass('ChatMessage');
const msg = {
type: 'systemMessage',
user: game.user.id,
speaker: cls.getSpeaker(),
title: game.i18n.localize(
`DAGGERHEART.UI.Chat.damageSummary.${config.hasHealing ? 'healingTitle' : 'title'}`
),
content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/ui/chat/damageSummary.hbs',
{
targets: targetDamage
}
)
};
cls.create(msg);
});
} }
/** /**

View file

@ -46,17 +46,48 @@ export default class EffectsField extends fields.ArrayField {
*/ */
static async applyEffects(targets) { static async applyEffects(targets) {
if (!this.effects?.length || !targets?.length) return; if (!this.effects?.length || !targets?.length) return;
let effects = this.effects; let effects = this.effects;
targets.forEach(async token => { const messageTargets = [];
targets.forEach(async baseToken => {
if (this.hasSave && token.saved.success === true) effects = this.effects.filter(e => e.onSave === true); if (this.hasSave && token.saved.success === true) effects = this.effects.filter(e => e.onSave === true);
if (!effects.length) return; if (!effects.length) return;
const token = canvas.tokens.get(baseToken.id);
if (!token) return;
messageTargets.push(token.document);
effects.forEach(async e => { effects.forEach(async e => {
const actor = canvas.tokens.get(token.id)?.actor, const effect = this.item.effects.get(e._id);
effect = this.item.effects.get(e._id); if (!token.actor || !effect) return;
if (!actor || !effect) return; await EffectsField.applyEffect(effect, token.actor);
await EffectsField.applyEffect(effect, actor);
}); });
}); });
if (messageTargets.length === 0) return;
const summaryMessageSettings = game.settings.get(
CONFIG.DH.id,
CONFIG.DH.SETTINGS.gameSettings.Automation
).summaryMessages;
if (!summaryMessageSettings.effects) return;
const cls = getDocumentClass('ChatMessage');
const msg = {
type: 'systemMessage',
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: this.effects.map(e => this.item.effects.get(e._id)),
targets: messageTargets
}
)
};
cls.create(msg);
} }
/** /**

View file

@ -2,6 +2,10 @@ export default class DhAutomation extends foundry.abstract.DataModel {
static defineSchema() { static defineSchema() {
const fields = foundry.data.fields; const fields = foundry.data.fields;
return { return {
summaryMessages: new fields.SchemaField({
damage: new fields.BooleanField({ initial: true, label: 'DAGGERHEART.GENERAL.damage' }),
effects: new fields.BooleanField({ initial: true, label: 'DAGGERHEART.GENERAL.Effect.plural' })
}),
hopeFear: new fields.SchemaField({ hopeFear: new fields.SchemaField({
gm: new fields.BooleanField({ gm: new fields.BooleanField({
required: true, required: true,
@ -64,21 +68,39 @@ export default class DhAutomation extends foundry.abstract.DataModel {
}), }),
characterDefault: new fields.StringField({ characterDefault: new fields.StringField({
required: true, required: true,
choices: CONFIG.DH.GENERAL.defeatedConditions, choices: () => CONFIG.DH.GENERAL.defeatedConditions(),
initial: CONFIG.DH.GENERAL.defeatedConditions.unconscious.id, initial: 'unconscious',
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.characterDefault.label' label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.characterDefault.label'
}), }),
adversaryDefault: new fields.StringField({ adversaryDefault: new fields.StringField({
required: true, required: true,
choices: CONFIG.DH.GENERAL.defeatedConditions, choices: () => CONFIG.DH.GENERAL.defeatedConditions(),
initial: CONFIG.DH.GENERAL.defeatedConditions.defeated.id, initial: 'defeated',
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.adversaryDefault.label' label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.adversaryDefault.label'
}), }),
companionDefault: new fields.StringField({ companionDefault: new fields.StringField({
required: true, required: true,
choices: CONFIG.DH.GENERAL.defeatedConditions, choices: () => CONFIG.DH.GENERAL.defeatedConditions(),
initial: CONFIG.DH.GENERAL.defeatedConditions.defeated.id, initial: 'defeated',
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.companionDefault.label' label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.companionDefault.label'
}),
deadIcon: new fields.FilePathField({
initial: 'icons/magic/death/grave-tombstone-glow-teal.webp',
categories: ['IMAGE'],
base64: false,
label: 'Dead'
}),
defeatedIcon: new fields.FilePathField({
initial: 'icons/magic/control/fear-fright-mask-orange.webp',
categories: ['IMAGE'],
base64: false,
label: 'Defeated'
}),
unconsciousIcon: new fields.FilePathField({
initial: 'icons/magic/control/sleep-bubble-purple.webp',
categories: ['IMAGE'],
base64: false,
label: 'Unconcious'
}) })
}), }),
roll: new fields.SchemaField({ roll: new fields.SchemaField({

View file

@ -599,6 +599,8 @@ export default class DhpActor extends Actor {
await this.modifyResource(updates); await this.modifyResource(updates);
if (Hooks.call(`${CONFIG.DH.id}.postTakeDamage`, this, updates) === false) return null; if (Hooks.call(`${CONFIG.DH.id}.postTakeDamage`, this, updates) === false) return null;
return updates;
} }
calculateDamage(baseDamage, type) { calculateDamage(baseDamage, type) {
@ -647,6 +649,8 @@ export default class DhpActor extends Actor {
await this.modifyResource(updates); await this.modifyResource(updates);
if (Hooks.call(`${CONFIG.DH.id}.postTakeHealing`, this, updates) === false) return null; if (Hooks.call(`${CONFIG.DH.id}.postTakeHealing`, this, updates) === false) return null;
return updates;
} }
async modifyResource(resources) { async modifyResource(resources) {
@ -749,7 +753,7 @@ export default class DhpActor extends Actor {
async toggleDefeated(defeatedState) { async toggleDefeated(defeatedState) {
const settings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).defeated; const settings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).defeated;
const { unconscious, defeated, dead } = CONFIG.DH.GENERAL.conditions; const { unconscious, defeated, dead } = CONFIG.DH.GENERAL.conditions();
const defeatedConditions = new Set([unconscious.id, defeated.id, dead.id]); const defeatedConditions = new Set([unconscious.id, defeated.id, dead.id]);
if (!defeatedState) { if (!defeatedState) {
for (let defeatedId of defeatedConditions) { for (let defeatedId of defeatedConditions) {

View file

@ -143,6 +143,12 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
html.querySelectorAll('.button-target-selection').forEach(element => { html.querySelectorAll('.button-target-selection').forEach(element => {
element.addEventListener('click', this.onTargetSelection.bind(this)); element.addEventListener('click', this.onTargetSelection.bind(this));
}); });
html.querySelectorAll('.token-target-container').forEach(element => {
element.addEventListener('pointerover', this.hoverTarget);
element.addEventListener('pointerout', this.unhoverTarget);
element.addEventListener('click', this.clickTarget);
});
} }
async onRollDamage(event) { async onRollDamage(event) {

View file

@ -14,7 +14,8 @@ export default class RegisterHandlebarsHelpers {
getProperty: foundry.utils.getProperty, getProperty: foundry.utils.getProperty,
setVar: this.setVar, setVar: this.setVar,
empty: this.empty, empty: this.empty,
pluralize: this.pluralize pluralize: this.pluralize,
positive: this.positive
}); });
} }
static add(a, b) { static add(a, b) {
@ -89,4 +90,8 @@ export default class RegisterHandlebarsHelpers {
const key = isSingular ? `${baseKey}.single` : `${baseKey}.plural`; const key = isSingular ? `${baseKey}.single` : `${baseKey}.plural`;
return game.i18n.localize(key); return game.i18n.localize(key);
} }
static positive(a) {
return Math.abs(Number(a));
}
} }

View file

@ -1,5 +1,6 @@
export const preloadHandlebarsTemplates = async function () { export const preloadHandlebarsTemplates = async function () {
foundry.applications.handlebars.loadTemplates({ foundry.applications.handlebars.loadTemplates({
'daggerheart.inventory-item-compact': 'systems/daggerheart/templates/sheets/global/partials/inventory-item-compact.hbs',
'daggerheart.inventory-items': 'daggerheart.inventory-items':
'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs', 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs',
'daggerheart.inventory-item': 'systems/daggerheart/templates/sheets/global/partials/inventory-item-V2.hbs' 'daggerheart.inventory-item': 'systems/daggerheart/templates/sheets/global/partials/inventory-item-V2.hbs'
@ -29,7 +30,6 @@ export const preloadHandlebarsTemplates = async function () {
'systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs', 'systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs',
'systems/daggerheart/templates/dialogs/downtime/activities.hbs', 'systems/daggerheart/templates/dialogs/downtime/activities.hbs',
'systems/daggerheart/templates/dialogs/dice-roll/costSelection.hbs', 'systems/daggerheart/templates/dialogs/dice-roll/costSelection.hbs',
'systems/daggerheart/templates/ui/chat/parts/roll-part.hbs', 'systems/daggerheart/templates/ui/chat/parts/roll-part.hbs',
'systems/daggerheart/templates/ui/chat/parts/damage-part.hbs', 'systems/daggerheart/templates/ui/chat/parts/damage-part.hbs',
'systems/daggerheart/templates/ui/chat/parts/target-part.hbs', 'systems/daggerheart/templates/ui/chat/parts/target-part.hbs',

View file

@ -14,7 +14,7 @@
} }
.appTheme({}, { .appTheme({}, {
.inventory-item-header .img-portait .roll-img { .inventory-item .img-portait .roll-img {
filter: invert(1); filter: invert(1);
} }
}); });
@ -25,14 +25,12 @@
list-style-type: none; list-style-type: none;
&:not(.single-img) { &:not(.single-img) {
.inventory-item-header:hover { .img-portait:has(.roll-img):hover {
.img-portait:has(.roll-img) { .roll-img {
.roll-img { opacity: 1;
opacity: 1; }
} .item-img {
.item-img { opacity: 0;
opacity: 0;
}
} }
} }
@ -68,18 +66,15 @@
} }
} }
.inventory-item-header { .inventory-item-header,
display: flex; &.inventory-item-compact {
align-items: center;
gap: 10px;
cursor: pointer;
border-radius: 3px;
.img-portait { .img-portait {
flex: 0 0 40px; flex: 0 0 40px;
height: 40px; height: 40px;
cursor: pointer;
position: relative; position: relative;
&:has(.roll-img) {
cursor: pointer;
}
.item-img, .item-img,
.roll-img { .roll-img {
@ -102,53 +97,6 @@
} }
} }
.item-label {
flex: 1;
align-self: center;
.item-name {
font-size: var(--font-size-14);
.expanded-icon {
display: none;
}
}
.item-tags,
.item-labels {
display: flex;
gap: 10px;
.tag,
.label {
display: flex;
flex-direction: row;
align-items: center;
font-size: var(--font-size-12);
flex-wrap: wrap;
justify-content: start;
}
.tag {
padding: 3px 5px;
background: light-dark(@dark-15, @beige-15);
border: 1px solid light-dark(@dark, @beige);
border-radius: 3px;
}
.label {
gap: 4px;
color: light-dark(@dark-80, @beige-80);
}
}
}
.item-resource {
flex: 0 0 60px;
display: flex;
align-items: center;
gap: 4px;
}
.controls { .controls {
flex: 0 0 auto; flex: 0 0 auto;
display: flex; display: flex;
@ -167,6 +115,52 @@
} }
} }
.inventory-item-header {
align-items: center;
border-radius: 3px;
cursor: pointer;
display: flex;
gap: 10px;
.item-label {
flex: 1;
align-self: center;
.item-name {
font-size: var(--font-size-14);
.expanded-icon {
display: none;
}
}
.item-tags {
display: flex;
gap: 10px;
.tag {
align-items: center;
background: light-dark(@dark-15, @beige-15);
border-radius: 3px;
border: 1px solid light-dark(@dark, @beige);
display: flex;
flex-direction: row;
flex-wrap: wrap;
font-size: var(--font-size-12);
justify-content: start;
padding: 3px 5px;
}
}
}
.item-resource {
flex: 0 0 60px;
display: flex;
align-items: center;
gap: 4px;
}
}
.inventory-item-content { .inventory-item-content {
> *:not(:last-child) { > *:not(:last-child) {
margin-bottom: 5px; margin-bottom: 5px;
@ -251,6 +245,41 @@
} }
} }
} }
&.inventory-item-compact {
display: grid;
grid-template:
"img name controls" auto
"img labels labels" 1fr
/ 40px 1fr min-content;
column-gap: 8px;
> .img-portait {
grid-area: img;
}
> .item-name {
align-self: end;
line-height: 1;
padding-bottom: 1px;
}
> .controls {
grid-area: controls;
align-self: start;
padding-top: 0.3125rem;
gap: 4px;
margin-bottom: -1px;
}
> .item-labels {
align-self: start;
color: light-dark(@dark-80, @beige-80);
display: flex;
flex-direction: row;
flex-wrap: wrap;
font-size: var(--font-size-12);
gap: 4px;
grid-area: labels;
}
}
} }
.card-item { .card-item {

View file

@ -0,0 +1,87 @@
@import '../../utils/colors.less';
#interface.theme-light {
.daggerheart.chat.damage-summary .token-target-container {
&:hover {
background: @dark-blue-10;
}
header {
.actor-name {
color: @dark;
}
&::after {
background: @dark-blue;
}
}
}
}
.daggerheart.chat.damage-summary {
display: flex;
flex-direction: column;
gap: 5px;
padding: 0;
.token-target-container {
display: flex;
flex-direction: column;
gap: 2px;
cursor: pointer;
transition: all 0.3s ease;
border-radius: 6px;
&:hover {
background: @golden-10;
}
header {
display: flex;
align-items: center;
gap: 5px;
pointer-events: none;
position: relative;
margin-bottom: 10px;
img {
width: 40px;
height: 40px;
padding: 0;
border-radius: 50%;
}
.actor-name {
margin: 0;
color: @beige;
font-size: var(--font-size-20);
padding: 8px;
}
&::after {
content: '';
position: absolute;
bottom: -10px;
background: @golden;
mask-image: linear-gradient(270deg, transparent 0%, black 50%, transparent 100%);
height: 2px;
width: 100%;
}
}
.damage-container {
display: flex;
flex-direction: column;
justify-content: center;
gap: 5px;
pointer-events: none;
margin-top: 5px;
list-style: disc;
.damage-row {
padding: 0 2px;
gap: 4px;
}
}
}
}

View file

@ -0,0 +1,166 @@
@import '../../utils/colors.less';
#interface.theme-light {
.daggerheart.chat.effect-summary {
.effect-header,
.actor-header {
&::before,
&::after {
height: 2px;
background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, @dark-blue 100%);
}
&::after {
background: linear-gradient(90deg, @dark-blue 0%, rgba(0, 0, 0, 0) 100%);
}
span {
color: @dark;
}
}
.token-target-container,
.effect-target-container {
.effect-label .title,
.title {
color: @dark-blue;
}
.effect-label {
border-color: @dark-blue;
}
&:hover {
background: @dark-blue-10;
}
}
}
}
.daggerheart.chat.effect-summary {
display: flex;
flex-direction: column;
.effect-header,
.actor-header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 5px;
&::before,
&::after {
content: '';
flex: 1;
height: 2px;
background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, @golden 100%);
}
&::after {
background: linear-gradient(90deg, @golden 0%, rgba(0, 0, 0, 0) 100%);
}
span {
color: @beige;
padding: 0 10px;
white-space: nowrap;
}
}
.effects-container {
display: flex;
flex-wrap: wrap;
gap: 5px;
margin-bottom: 8px;
}
.targets-container {
display: flex;
flex-direction: column;
gap: 5px;
}
.token-target-container {
display: flex;
align-items: center;
gap: 13px;
border-radius: 6px;
padding: 0 2px;
border-radius: 6px;
background: transparent;
transition: all 0.3s ease;
padding: 5px;
cursor: pointer;
transition: all 0.3s ease;
&:hover {
background: @golden-10;
}
img {
width: 40px;
height: 40px;
border-radius: 50%;
pointer-events: none;
}
.title {
font-size: var(--font-size-20);
color: @golden;
font-weight: 700;
margin: 0;
pointer-events: none;
}
}
details[open] {
.fa-chevron-down {
transform: rotate(180deg);
transition: all 0.3s ease;
}
}
.effect-target-container {
width: 100%;
transition: all 0.3s ease;
cursor: pointer;
&:hover {
background: @golden-10;
}
.fa-chevron-down {
transition: all 0.3s ease;
margin-left: auto;
}
.effect-label {
display: flex;
flex-direction: row;
align-items: center;
margin: 8px 8px 0;
padding-bottom: 5px;
width: -webkit-fill-available;
gap: 13px;
border-bottom: 1px solid @golden;
.effect-img {
width: 40px;
height: 40px;
border-radius: 3px;
object-fit: cover;
}
.title {
font-size: var(--font-size-20);
color: @golden;
font-weight: 700;
margin: 0;
}
}
.description {
padding: 8px;
}
}
}

View file

@ -1,7 +1,9 @@
@import './chat/ability-use.less'; @import './chat/ability-use.less';
@import './chat/action.less'; @import './chat/action.less';
@import './chat/chat.less'; @import './chat/chat.less';
@import './chat/damage-summary.less';
@import './chat/downtime.less'; @import './chat/downtime.less';
@import './chat/effect-summary.less';
@import './chat/refresh-message.less'; @import './chat/refresh-message.less';
@import './chat/sheet.less'; @import './chat/sheet.less';

View file

@ -266,7 +266,8 @@
"dualityRoll": {}, "dualityRoll": {},
"adversaryRoll": {}, "adversaryRoll": {},
"damageRoll": {}, "damageRoll": {},
"abilityUse": {} "abilityUse": {},
"systemMessage": {}
} }
}, },
"background": "systems/daggerheart/assets/logos/FoundrybornBackgroundLogo.png", "background": "systems/daggerheart/assets/logos/FoundrybornBackgroundLogo.png",

View file

@ -7,7 +7,11 @@
<label>{{localize "DAGGERHEART.SETTINGS.Automation.FIELDS.hopeFear.label"}}</label> <label>{{localize "DAGGERHEART.SETTINGS.Automation.FIELDS.hopeFear.label"}}</label>
{{formGroup settingFields.schema.fields.hopeFear.fields.gm value=settingFields._source.hopeFear.gm localize=true}} {{formGroup settingFields.schema.fields.hopeFear.fields.gm value=settingFields._source.hopeFear.gm localize=true}}
{{formGroup settingFields.schema.fields.hopeFear.fields.players value=settingFields._source.hopeFear.players localize=true}} {{formGroup settingFields.schema.fields.hopeFear.fields.players value=settingFields._source.hopeFear.players localize=true}}
</div>
<div class="form-group setting-two-values">
<label>{{localize "DAGGERHEART.SETTINGS.Automation.FIELDS.summaryMessages.label"}}</label>
{{formGroup settingFields.schema.fields.summaryMessages.fields.damage value=settingFields._source.summaryMessages.damage localize=true}}
{{formGroup settingFields.schema.fields.summaryMessages.fields.effects value=settingFields._source.summaryMessages.effects localize=true}}
</div> </div>
{{formGroup settingFields.schema.fields.actionPoints value=settingFields._source.actionPoints localize=true}} {{formGroup settingFields.schema.fields.actionPoints value=settingFields._source.actionPoints localize=true}}
{{formGroup settingFields.schema.fields.hordeDamage value=settingFields._source.hordeDamage localize=true}} {{formGroup settingFields.schema.fields.hordeDamage value=settingFields._source.hordeDamage localize=true}}

View file

@ -13,5 +13,9 @@
{{formGroup settingFields.schema.fields.defeated.fields.characterDefault value=settingFields._source.defeated.characterDefault labelAttr="name" localize=true}} {{formGroup settingFields.schema.fields.defeated.fields.characterDefault value=settingFields._source.defeated.characterDefault labelAttr="name" localize=true}}
{{formGroup settingFields.schema.fields.defeated.fields.adversaryDefault value=settingFields._source.defeated.adversaryDefault labelAttr="name" localize=true}} {{formGroup settingFields.schema.fields.defeated.fields.adversaryDefault value=settingFields._source.defeated.adversaryDefault labelAttr="name" localize=true}}
{{formGroup settingFields.schema.fields.defeated.fields.companionDefault value=settingFields._source.defeated.companionDefault labelAttr="name" localize=true}} {{formGroup settingFields.schema.fields.defeated.fields.companionDefault value=settingFields._source.defeated.companionDefault labelAttr="name" localize=true}}
{{formGroup settingFields.schema.fields.defeated.fields.deadIcon value=settingFields._source.defeated.deadIcon localize=true}}
{{formGroup settingFields.schema.fields.defeated.fields.defeatedIcon value=settingFields._source.defeated.defeatedIcon localize=true}}
{{formGroup settingFields.schema.fields.defeated.fields.unconsciousIcon value=settingFields._source.defeated.unconsciousIcon localize=true}}
</fieldset> </fieldset>
</section> </section>

View file

@ -78,13 +78,9 @@
<side-line-div></side-line-div> <side-line-div></side-line-div>
</div> </div>
<ul class="items-sidebar-list"> <ul class="items-sidebar-list">
{{> 'daggerheart.inventory-item' {{> 'daggerheart.inventory-item-compact'
item=document.system.attack item=document.system.attack
type='action' type='action'
hideTags=true
hideDescription=true
hideResources=true
noExtensible=true
noCompendiumEdit=true noCompendiumEdit=true
}} }}
</ul> </ul>

View file

@ -116,24 +116,16 @@
</div> </div>
<ul class="items-sidebar-list"> <ul class="items-sidebar-list">
{{#if document.system.usedUnarmed}} {{#if document.system.usedUnarmed}}
{{> 'daggerheart.inventory-item' {{> 'daggerheart.inventory-item-compact'
item=document.system.usedUnarmed item=document.system.usedUnarmed
type='action' type='action'
hideTags=true
hideDescription=true
hideResources=true
noExtensible=true
}} }}
{{/if}} {{/if}}
{{#each document.items as |item|}} {{#each document.items as |item|}}
{{#if item.system.equipped}} {{#if item.system.equipped}}
{{> 'daggerheart.inventory-item' {{> 'daggerheart.inventory-item-compact'
item=item item=item
type=item.type type=item.type
hideTags=true
hideDescription=true
hideResources=true
noExtensible=true
}} }}
{{/if}} {{/if}}
{{/each}} {{/each}}
@ -147,13 +139,9 @@
</div> </div>
<ul class="items-sidebar-list"> <ul class="items-sidebar-list">
{{#each document.system.domainCards.loadout as |card|}} {{#each document.system.domainCards.loadout as |card|}}
{{> 'daggerheart.inventory-item' {{> 'daggerheart.inventory-item-compact'
item=card item=card
type='domainCard' type='domainCard'
hideTags=true
hideDescription=true
hideResources=true
noExtensible=true
}} }}
{{/each}} {{/each}}

View file

@ -8,11 +8,9 @@
</div> </div>
{{#if document.system.partner}} {{#if document.system.partner}}
<ul class="items-list"> <ul class="items-list">
{{> 'daggerheart.inventory-item' {{> 'daggerheart.inventory-item-compact'
item=document.system.partner item=document.system.partner
type='companion' type='companion'
hideTags=true
hideDescription=true
isActor=true isActor=true
hideTooltip=true hideTooltip=true
}} }}
@ -28,11 +26,9 @@
<side-line-div></side-line-div> <side-line-div></side-line-div>
</div> </div>
<ul class="items-list"> <ul class="items-list">
{{> 'daggerheart.inventory-item' {{> 'daggerheart.inventory-item-compact'
item=document.system.attack item=document.system.attack
type='action' type='action'
hideTags=true
hideDescription=true
hideTooltip=true hideTooltip=true
}} }}
</ul> </ul>

View file

@ -48,20 +48,6 @@ Parameters:
</div> </div>
{{/each}} {{/each}}
</div> </div>
{{else if (not ../hideLabels)}}
<div class="item-labels">
<div class="label">
{{#each this._getLabels as |label|}}
{{ifThen label.value label.value label}}
{{#each label.icons as |icon|}}
<i class="fa-solid {{icon}}"></i>
{{/each}}
{{#if (not @last)}}
<span>-</span>
{{/if}}
{{/each}}
</div>
</div>
{{/if}} {{/if}}
{{/with}} {{/with}}
{{!--Tags End --}} {{!--Tags End --}}

View file

@ -0,0 +1,85 @@
<li class="inventory-item inventory-item-compact" data-item-id="{{item.id}}" {{#if (or (eq type 'action' ) (eq type 'attack' ))}}
data-action-id="{{item.id}}" {{/if}} data-item-uuid="{{item.uuid}}" data-type="{{type}}" data-no-compendium-edit="{{noCompendiumEdit}}" draggable="true">
{{!-- Image --}}
<div class="img-portait" data-action='{{ifThen (or (hasProperty item "use") (eq type "attack")) "useItem" (ifThen
(hasProperty item "toChat" ) "toChat" "editDoc" ) }}' {{#unless hideTooltip}} {{#if (eq type 'attack' )}}
data-tooltip="#attack#{{item.actor.uuid}}" {{else}} data-tooltip="#item#{{item.uuid}}" {{/if}} {{/unless}}>
<img src="{{item.img}}" class="item-img {{#if isActor}}actor-img{{/if}}" />
{{#if (or item.system.actionsList.size item.system.actionsList.length item.actionType)}}
{{#if @root.isNPC}}
<img class="roll-img d20" src="systems/daggerheart/assets/icons/dice/default/d20.svg" alt="d20">
{{else}}
<img class="roll-img duality" src="systems/daggerheart/assets/icons/dice/duality/DualityBW.svg" alt="2d12">
{{/if}}
{{/if}}
</div>
{{!-- Item Name --}}
<span class="item-name">{{localize item.name}}</span>
{{!-- Tags Start --}}
{{#with item}}
<div class="item-labels">
<div class="label">
{{#each this._getLabels as |label|}}
{{ifThen label.value label.value label}}
{{#each label.icons as |icon|}}
<i class="fa-solid {{icon}}"></i>
{{/each}}
{{#if (not @last)}}
<span>-</span>
{{/if}}
{{/each}}
</div>
</div>
{{/with}}
{{!--Tags End --}}
{{!-- Controls --}}
{{#unless hideControls}}
<div class="controls">
{{#if isActor}}
<a data-action="editDoc" data-tooltip="DAGGERHEART.UI.Tooltip.openActorWorld">
<i class="fa-solid fa-fw fa-globe"></i>
</a>
{{#if (eq type 'adversary')}}
<a data-action='deleteAdversary' data-category="{{categoryAdversary}}" data-tooltip="CONTROLS.CommonDelete">
<i class='fas fa-fw fa-trash'></i>
</a>
{{/if}}
{{else}}
{{#if (eq type 'weapon')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.equipped 'unequip' 'equip' }}">
<i class="fa-solid fa-fw fa-hands"></i>
</a>
{{else if (eq type 'armor')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.equipped 'unequip' 'equip' }}">
<i class="fa-solid fa-fw fa-shield"></i>
</a>
{{else if (eq type 'domainCard')}}
<a data-action="toggleVault"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.inVault 'sendToLoadout' 'sendToVault' }}">
<i class="fa-solid fa-fw {{ifThen item.system.inVault 'fa-arrow-up' 'fa-arrow-down'}}"></i>
</a>
{{else if (eq type 'effect')}}
<a data-action="toggleEffect"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.disabled 'enableEffect' 'disableEffect' }}">
<i class="fa-solid fa-fw {{ifThen item.disabled 'fa-toggle-off' 'fa-toggle-on'}}"></i>
</a>
{{/if}}
{{#if (hasProperty item "toChat")}}
<a data-action="toChat" data-tooltip="DAGGERHEART.UI.Tooltip.sendToChat">
<i class="fa-regular fa-fw fa-message"></i>
</a>
{{/if}}
{{#unless hideContextMenu}}
<a data-action="triggerContextMenu" data-tooltip="DAGGERHEART.UI.Tooltip.moreOptions">
<i class="fa-solid fa-ellipsis-vertical"></i>
</a>
{{/unless}}
{{/if}}
</div>
{{/unless}}
</li>

View file

@ -0,0 +1,33 @@
<ul class="daggerheart chat damage-summary">
{{#each targets}}
<li class="token-target-container" data-token="{{this.token.id}}">
<header>
<img src="{{this.token.texture.src}}" />
<h2 class="actor-name">{{this.token.name}}</h2>
</header>
<ul class="damage-container">
{{#each this.updates}}
<li class="damage-row">
{{#if (gte this.value 0)}}
<span>
{{
localize "DAGGERHEART.UI.Chat.markResource"
quantity=this.value
resource=(localize (concat "DAGGERHEART.CONFIG.HealingType." this.key ".name"))
}}
</span>
{{else}}
<span>
{{
localize "DAGGERHEART.UI.Chat.clearResource"
quantity=(positive this.value)
resource=(localize (concat "DAGGERHEART.CONFIG.HealingType." this.key ".name"))
}}
</span>
{{/if}}
</li>
{{/each}}
</ul>
</li>
{{/each}}
</ul>

View file

@ -0,0 +1,33 @@
<div class="daggerheart chat effect-summary">
<div class="effect-header">
<span>{{localize "DAGGERHEART.GENERAL.Effect.plural"}}</span>
</div>
<div class="effects-container">
{{#each effects}}
<details class="effect-target-container">
<summary class="effect-label">
<img class="effect-img" src="{{this.img}}" />
<h2 class="title">{{this.name}}</h2>
<i class="fa-solid fa-chevron-down"></i>
</summary>
<div class="description">
{{{this.description}}}
</div>
</details>
{{/each}}
</div>
{{#if targets}}
<div class="actor-header">
<span>{{localize "DAGGERHEART.UI.Chat.appliedTo"}}</span>
</div>
<div class="targets-container">
{{#each targets}}
<div class="token-target-container" data-token="{{this.id}}">
<img src="{{this.texture.src}}" />
<h2 class="title">{{this.name}}</h2>
</div>
{{/each}}
</div>
{{/if}}
</div>