mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Merge branch 'development' into feature/313-preset-measured-templates
This commit is contained in:
commit
bea6140c66
26 changed files with 700 additions and 154 deletions
|
|
@ -34,15 +34,6 @@ Hooks.once('init', () => {
|
|||
|
||||
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 = {
|
||||
DHRoll: DHRoll,
|
||||
DualityRoll: DualityRoll,
|
||||
|
|
@ -160,6 +151,17 @@ Hooks.once('init', () => {
|
|||
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 () => {
|
||||
ui.resources = new CONFIG.ui.resources();
|
||||
if (game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).displayFear !== 'hide')
|
||||
|
|
|
|||
13
lang/en.json
13
lang/en.json
|
|
@ -2309,6 +2309,9 @@
|
|||
"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."
|
||||
}
|
||||
},
|
||||
"summaryMessages": {
|
||||
"label": "Summary Messages"
|
||||
}
|
||||
},
|
||||
"defeated": {
|
||||
|
|
@ -2430,6 +2433,7 @@
|
|||
"action": {
|
||||
"title": "Action"
|
||||
},
|
||||
"appliedTo": "Applied To",
|
||||
"applyEffect": {
|
||||
"title": "Apply Effects - {name}"
|
||||
},
|
||||
|
|
@ -2439,6 +2443,11 @@
|
|||
"rollHealing": "Roll Healing",
|
||||
"applyEffect": "Apply Effects"
|
||||
},
|
||||
"clearResource": "Clear {quantity} {resource}",
|
||||
"damageSummary": {
|
||||
"title": "Damage Applied",
|
||||
"healingTitle": "Healing Applied"
|
||||
},
|
||||
"damageRoll": {
|
||||
"title": "Damage - {damage}",
|
||||
"dealDamageToTargets": "Damage Hit Targets",
|
||||
|
|
@ -2460,12 +2469,16 @@
|
|||
"dualityRoll": {
|
||||
"abilityCheckTitle": "{ability} Check"
|
||||
},
|
||||
"effectSummary": {
|
||||
"title": "Effects Applied"
|
||||
},
|
||||
"featureTitle": "Class Feature",
|
||||
"healingRoll": {
|
||||
"title": "Heal - {damage}",
|
||||
"heal": "Heal",
|
||||
"applyHealing": "Apply Healing"
|
||||
},
|
||||
"markResource": "Mark {quantity} {resource}",
|
||||
"refreshMessage": {
|
||||
"title": "Feature Refresh",
|
||||
"header": "Refreshed"
|
||||
|
|
|
|||
|
|
@ -164,28 +164,31 @@ export const healingTypes = {
|
|||
}
|
||||
};
|
||||
|
||||
export const defeatedConditions = {
|
||||
defeated: {
|
||||
id: 'defeated',
|
||||
name: 'DAGGERHEART.CONFIG.Condition.defeated.name',
|
||||
img: 'icons/magic/control/fear-fright-mask-orange.webp',
|
||||
description: 'DAGGERHEART.CONFIG.Condition.defeated.description'
|
||||
},
|
||||
unconscious: {
|
||||
id: 'unconscious',
|
||||
name: 'DAGGERHEART.CONFIG.Condition.unconscious.name',
|
||||
img: 'icons/magic/control/sleep-bubble-purple.webp',
|
||||
description: 'DAGGERHEART.CONFIG.Condition.unconscious.description'
|
||||
},
|
||||
dead: {
|
||||
id: 'dead',
|
||||
name: 'DAGGERHEART.CONFIG.Condition.dead.name',
|
||||
img: 'icons/magic/death/grave-tombstone-glow-teal.webp',
|
||||
description: 'DAGGERHEART.CONFIG.Condition.dead.description'
|
||||
}
|
||||
export const defeatedConditions = () => {
|
||||
const defeated = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).defeated;
|
||||
return {
|
||||
defeated: {
|
||||
id: 'defeated',
|
||||
name: 'DAGGERHEART.CONFIG.Condition.defeated.name',
|
||||
img: defeated.defeatedIcon,
|
||||
description: 'DAGGERHEART.CONFIG.Condition.defeated.description'
|
||||
},
|
||||
unconscious: {
|
||||
id: 'unconscious',
|
||||
name: 'DAGGERHEART.CONFIG.Condition.unconscious.name',
|
||||
img: defeated.unconsciousIcon,
|
||||
description: 'DAGGERHEART.CONFIG.Condition.unconscious.description'
|
||||
},
|
||||
dead: {
|
||||
id: 'dead',
|
||||
name: 'DAGGERHEART.CONFIG.Condition.dead.name',
|
||||
img: defeated.deadIcon,
|
||||
description: 'DAGGERHEART.CONFIG.Condition.dead.description'
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const conditions = {
|
||||
export const conditions = () => ({
|
||||
vulnerable: {
|
||||
id: 'vulnerable',
|
||||
name: 'DAGGERHEART.CONFIG.Condition.vulnerable.name',
|
||||
|
|
@ -204,8 +207,8 @@ export const conditions = {
|
|||
img: 'icons/magic/control/debuff-chains-shackle-movement-red.webp',
|
||||
description: 'DAGGERHEART.CONFIG.Condition.restrained.description'
|
||||
},
|
||||
...defeatedConditions
|
||||
};
|
||||
...defeatedConditions()
|
||||
});
|
||||
|
||||
export const defaultRestOptions = {
|
||||
shortRest: () => ({
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
import DHAbilityUse from './abilityUse.mjs';
|
||||
import DHActorRoll from './actorRoll.mjs';
|
||||
import DHSystemMessage from './systemMessage.mjs';
|
||||
|
||||
export const config = {
|
||||
abilityUse: DHAbilityUse,
|
||||
adversaryRoll: DHActorRoll,
|
||||
damageRoll: DHActorRoll,
|
||||
dualityRoll: DHActorRoll
|
||||
dualityRoll: DHActorRoll,
|
||||
systemMessage: DHSystemMessage
|
||||
};
|
||||
|
|
|
|||
9
module/data/chat-message/systemMessage.mjs
Normal file
9
module/data/chat-message/systemMessage.mjs
Normal 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 })
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -81,6 +81,9 @@ export default class DamageField extends fields.SchemaField {
|
|||
static async applyDamage(config, targets = null, force = false) {
|
||||
targets ??= config.targets.filter(target => target.hit);
|
||||
if (!config.damage || !targets?.length || (!DamageField.getApplyAutomation() && !force)) return;
|
||||
|
||||
const targetDamage = [];
|
||||
const damagePromises = [];
|
||||
for (let target of targets) {
|
||||
const actor = fromUuidSync(target.actorId);
|
||||
if (!actor) continue;
|
||||
|
|
@ -95,9 +98,45 @@ export default class DamageField extends fields.SchemaField {
|
|||
});
|
||||
}
|
||||
|
||||
if (config.hasHealing) actor.takeHealing(config.damage);
|
||||
else actor.takeDamage(config.damage, config.isDirect);
|
||||
if (config.hasHealing)
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -46,17 +46,48 @@ export default class EffectsField extends fields.ArrayField {
|
|||
*/
|
||||
static async applyEffects(targets) {
|
||||
if (!this.effects?.length || !targets?.length) return;
|
||||
|
||||
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 (!effects.length) return;
|
||||
|
||||
const token = canvas.tokens.get(baseToken.id);
|
||||
if (!token) return;
|
||||
messageTargets.push(token.document);
|
||||
|
||||
effects.forEach(async e => {
|
||||
const actor = canvas.tokens.get(token.id)?.actor,
|
||||
effect = this.item.effects.get(e._id);
|
||||
if (!actor || !effect) return;
|
||||
await EffectsField.applyEffect(effect, actor);
|
||||
const effect = this.item.effects.get(e._id);
|
||||
if (!token.actor || !effect) return;
|
||||
await EffectsField.applyEffect(effect, token.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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@ export default class DhAutomation extends foundry.abstract.DataModel {
|
|||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
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({
|
||||
gm: new fields.BooleanField({
|
||||
required: true,
|
||||
|
|
@ -64,21 +68,39 @@ export default class DhAutomation extends foundry.abstract.DataModel {
|
|||
}),
|
||||
characterDefault: new fields.StringField({
|
||||
required: true,
|
||||
choices: CONFIG.DH.GENERAL.defeatedConditions,
|
||||
initial: CONFIG.DH.GENERAL.defeatedConditions.unconscious.id,
|
||||
choices: () => CONFIG.DH.GENERAL.defeatedConditions(),
|
||||
initial: 'unconscious',
|
||||
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.characterDefault.label'
|
||||
}),
|
||||
adversaryDefault: new fields.StringField({
|
||||
required: true,
|
||||
choices: CONFIG.DH.GENERAL.defeatedConditions,
|
||||
initial: CONFIG.DH.GENERAL.defeatedConditions.defeated.id,
|
||||
choices: () => CONFIG.DH.GENERAL.defeatedConditions(),
|
||||
initial: 'defeated',
|
||||
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.adversaryDefault.label'
|
||||
}),
|
||||
companionDefault: new fields.StringField({
|
||||
required: true,
|
||||
choices: CONFIG.DH.GENERAL.defeatedConditions,
|
||||
initial: CONFIG.DH.GENERAL.defeatedConditions.defeated.id,
|
||||
choices: () => CONFIG.DH.GENERAL.defeatedConditions(),
|
||||
initial: 'defeated',
|
||||
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({
|
||||
|
|
|
|||
|
|
@ -599,6 +599,8 @@ export default class DhpActor extends Actor {
|
|||
await this.modifyResource(updates);
|
||||
|
||||
if (Hooks.call(`${CONFIG.DH.id}.postTakeDamage`, this, updates) === false) return null;
|
||||
|
||||
return updates;
|
||||
}
|
||||
|
||||
calculateDamage(baseDamage, type) {
|
||||
|
|
@ -647,6 +649,8 @@ export default class DhpActor extends Actor {
|
|||
await this.modifyResource(updates);
|
||||
|
||||
if (Hooks.call(`${CONFIG.DH.id}.postTakeHealing`, this, updates) === false) return null;
|
||||
|
||||
return updates;
|
||||
}
|
||||
|
||||
async modifyResource(resources) {
|
||||
|
|
@ -749,7 +753,7 @@ export default class DhpActor extends Actor {
|
|||
|
||||
async toggleDefeated(defeatedState) {
|
||||
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]);
|
||||
if (!defeatedState) {
|
||||
for (let defeatedId of defeatedConditions) {
|
||||
|
|
|
|||
|
|
@ -143,6 +143,12 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
|||
html.querySelectorAll('.button-target-selection').forEach(element => {
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ export default class RegisterHandlebarsHelpers {
|
|||
getProperty: foundry.utils.getProperty,
|
||||
setVar: this.setVar,
|
||||
empty: this.empty,
|
||||
pluralize: this.pluralize
|
||||
pluralize: this.pluralize,
|
||||
positive: this.positive
|
||||
});
|
||||
}
|
||||
static add(a, b) {
|
||||
|
|
@ -89,4 +90,8 @@ export default class RegisterHandlebarsHelpers {
|
|||
const key = isSingular ? `${baseKey}.single` : `${baseKey}.plural`;
|
||||
return game.i18n.localize(key);
|
||||
}
|
||||
|
||||
static positive(a) {
|
||||
return Math.abs(Number(a));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
export const preloadHandlebarsTemplates = async function () {
|
||||
foundry.applications.handlebars.loadTemplates({
|
||||
'daggerheart.inventory-item-compact': 'systems/daggerheart/templates/sheets/global/partials/inventory-item-compact.hbs',
|
||||
'daggerheart.inventory-items':
|
||||
'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items-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/dialogs/downtime/activities.hbs',
|
||||
'systems/daggerheart/templates/dialogs/dice-roll/costSelection.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/target-part.hbs',
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
}
|
||||
|
||||
.appTheme({}, {
|
||||
.inventory-item-header .img-portait .roll-img {
|
||||
.inventory-item .img-portait .roll-img {
|
||||
filter: invert(1);
|
||||
}
|
||||
});
|
||||
|
|
@ -25,14 +25,12 @@
|
|||
list-style-type: none;
|
||||
|
||||
&:not(.single-img) {
|
||||
.inventory-item-header:hover {
|
||||
.img-portait:has(.roll-img) {
|
||||
.roll-img {
|
||||
opacity: 1;
|
||||
}
|
||||
.item-img {
|
||||
opacity: 0;
|
||||
}
|
||||
.img-portait:has(.roll-img):hover {
|
||||
.roll-img {
|
||||
opacity: 1;
|
||||
}
|
||||
.item-img {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -68,18 +66,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
.inventory-item-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
cursor: pointer;
|
||||
border-radius: 3px;
|
||||
|
||||
.inventory-item-header,
|
||||
&.inventory-item-compact {
|
||||
.img-portait {
|
||||
flex: 0 0 40px;
|
||||
height: 40px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
&:has(.roll-img) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.item-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 {
|
||||
flex: 0 0 auto;
|
||||
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 {
|
||||
> *:not(:last-child) {
|
||||
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 {
|
||||
|
|
|
|||
87
styles/less/ui/chat/damage-summary.less
Normal file
87
styles/less/ui/chat/damage-summary.less
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
166
styles/less/ui/chat/effect-summary.less
Normal file
166
styles/less/ui/chat/effect-summary.less
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
@import './chat/ability-use.less';
|
||||
@import './chat/action.less';
|
||||
@import './chat/chat.less';
|
||||
@import './chat/damage-summary.less';
|
||||
@import './chat/downtime.less';
|
||||
@import './chat/effect-summary.less';
|
||||
@import './chat/refresh-message.less';
|
||||
@import './chat/sheet.less';
|
||||
|
||||
|
|
|
|||
|
|
@ -266,7 +266,8 @@
|
|||
"dualityRoll": {},
|
||||
"adversaryRoll": {},
|
||||
"damageRoll": {},
|
||||
"abilityUse": {}
|
||||
"abilityUse": {},
|
||||
"systemMessage": {}
|
||||
}
|
||||
},
|
||||
"background": "systems/daggerheart/assets/logos/FoundrybornBackgroundLogo.png",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,11 @@
|
|||
<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.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>
|
||||
{{formGroup settingFields.schema.fields.actionPoints value=settingFields._source.actionPoints localize=true}}
|
||||
{{formGroup settingFields.schema.fields.hordeDamage value=settingFields._source.hordeDamage localize=true}}
|
||||
|
|
|
|||
|
|
@ -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.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.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>
|
||||
</section>
|
||||
|
|
@ -78,13 +78,9 @@
|
|||
<side-line-div></side-line-div>
|
||||
</div>
|
||||
<ul class="items-sidebar-list">
|
||||
{{> 'daggerheart.inventory-item'
|
||||
{{> 'daggerheart.inventory-item-compact'
|
||||
item=document.system.attack
|
||||
type='action'
|
||||
hideTags=true
|
||||
hideDescription=true
|
||||
hideResources=true
|
||||
noExtensible=true
|
||||
noCompendiumEdit=true
|
||||
}}
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -116,24 +116,16 @@
|
|||
</div>
|
||||
<ul class="items-sidebar-list">
|
||||
{{#if document.system.usedUnarmed}}
|
||||
{{> 'daggerheart.inventory-item'
|
||||
{{> 'daggerheart.inventory-item-compact'
|
||||
item=document.system.usedUnarmed
|
||||
type='action'
|
||||
hideTags=true
|
||||
hideDescription=true
|
||||
hideResources=true
|
||||
noExtensible=true
|
||||
}}
|
||||
{{/if}}
|
||||
{{#each document.items as |item|}}
|
||||
{{#if item.system.equipped}}
|
||||
{{> 'daggerheart.inventory-item'
|
||||
{{> 'daggerheart.inventory-item-compact'
|
||||
item=item
|
||||
type=item.type
|
||||
hideTags=true
|
||||
hideDescription=true
|
||||
hideResources=true
|
||||
noExtensible=true
|
||||
}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
|
|
@ -147,13 +139,9 @@
|
|||
</div>
|
||||
<ul class="items-sidebar-list">
|
||||
{{#each document.system.domainCards.loadout as |card|}}
|
||||
{{> 'daggerheart.inventory-item'
|
||||
{{> 'daggerheart.inventory-item-compact'
|
||||
item=card
|
||||
type='domainCard'
|
||||
hideTags=true
|
||||
hideDescription=true
|
||||
hideResources=true
|
||||
noExtensible=true
|
||||
}}
|
||||
|
||||
{{/each}}
|
||||
|
|
|
|||
|
|
@ -8,11 +8,9 @@
|
|||
</div>
|
||||
{{#if document.system.partner}}
|
||||
<ul class="items-list">
|
||||
{{> 'daggerheart.inventory-item'
|
||||
{{> 'daggerheart.inventory-item-compact'
|
||||
item=document.system.partner
|
||||
type='companion'
|
||||
hideTags=true
|
||||
hideDescription=true
|
||||
isActor=true
|
||||
hideTooltip=true
|
||||
}}
|
||||
|
|
@ -28,11 +26,9 @@
|
|||
<side-line-div></side-line-div>
|
||||
</div>
|
||||
<ul class="items-list">
|
||||
{{> 'daggerheart.inventory-item'
|
||||
{{> 'daggerheart.inventory-item-compact'
|
||||
item=document.system.attack
|
||||
type='action'
|
||||
hideTags=true
|
||||
hideDescription=true
|
||||
hideTooltip=true
|
||||
}}
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -48,20 +48,6 @@ Parameters:
|
|||
</div>
|
||||
{{/each}}
|
||||
</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}}
|
||||
{{/with}}
|
||||
{{!--Tags End --}}
|
||||
|
|
|
|||
85
templates/sheets/global/partials/inventory-item-compact.hbs
Normal file
85
templates/sheets/global/partials/inventory-item-compact.hbs
Normal 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>
|
||||
33
templates/ui/chat/damageSummary.hbs
Normal file
33
templates/ui/chat/damageSummary.hbs
Normal 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>
|
||||
33
templates/ui/chat/effectSummary.hbs
Normal file
33
templates/ui/chat/effectSummary.hbs
Normal 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue