Compare commits

..

No commits in common. "6cbe7708801c0795d567fb1a544d19d0702cb95e" and "17ec77a3490cdad17abb86e09dbf17368f5cb5b9" have entirely different histories.

12 changed files with 60 additions and 81 deletions

View file

@ -243,17 +243,14 @@ Hooks.on('setup', () => {
})) }))
]; ];
const actorCommon = {
bar: ['resources.stress'],
value: []
};
const damageThresholds = ['damageThresholds.major', 'damageThresholds.severe']; const damageThresholds = ['damageThresholds.major', 'damageThresholds.severe'];
const traits = Object.keys(game.system.api.data.actors.DhCharacter.schema.fields.traits.fields).map( const traits = Object.keys(game.system.api.data.actors.DhCharacter.schema.fields.traits.fields).map(
trait => `traits.${trait}.value` trait => `traits.${trait}.value`
); );
const resistance = Object.values(game.system.api.data.actors.DhCharacter.schema.fields.resistance.fields).flatMap(
type => Object.keys(type.fields).map(x => `resistance.${type.name}.${x}`)
);
const actorCommon = {
bar: ['resources.stress'],
value: [...resistance]
};
CONFIG.Actor.trackableAttributes = { CONFIG.Actor.trackableAttributes = {
character: { character: {
bar: [...actorCommon.bar, 'resources.hitPoints', 'resources.hope'], bar: [...actorCommon.bar, 'resources.hitPoints', 'resources.hope'],

View file

@ -2111,7 +2111,7 @@
"thresholdImmunities": { "thresholdImmunities": {
"minor": { "minor": {
"label": "Threshold Immunities: Minor", "label": "Threshold Immunities: Minor",
"hint": "Automatically ignores minor damage when set to 1" "hint": "Automatically ignores minor damage"
} }
} }
}, },

View file

@ -200,6 +200,7 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
description: game.i18n.localize(this.selectedMove.description), description: game.i18n.localize(this.selectedMove.description),
result: result, result: result,
open: autoExpandDescription ? 'open' : '', open: autoExpandDescription ? 'open' : '',
chevron: autoExpandDescription ? 'fa-chevron-up' : 'fa-chevron-down',
showRiskItAllButton: this.showRiskItAllButton, showRiskItAllButton: this.showRiskItAllButton,
riskItAllButtonLabel: this.riskItAllButtonLabel, riskItAllButtonLabel: this.riskItAllButtonLabel,
riskItAllHope: this.riskItAllHope riskItAllHope: this.riskItAllHope

View file

@ -196,9 +196,6 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
.filter(x => x.testUserPermission(game.user, 'LIMITED')) .filter(x => x.testUserPermission(game.user, 'LIMITED'))
.filter(x => x.uuid !== this.actor.uuid); .filter(x => x.uuid !== this.actor.uuid);
const autoExpandDescription = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance)
.expandRollMessage?.desc;
const cls = getDocumentClass('ChatMessage'); const cls = getDocumentClass('ChatMessage');
const msg = { const msg = {
user: game.user.id, user: game.user.id,
@ -219,8 +216,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
actor: { name: this.actor.name, img: this.actor.img }, actor: { name: this.actor.name, img: this.actor.img },
moves: moves, moves: moves,
characters: characters, characters: characters,
selfId: this.actor.uuid, selfId: this.actor.uuid
open: autoExpandDescription ? 'open' : ''
} }
), ),
flags: { flags: {

View file

@ -30,27 +30,22 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
const group = game.i18n.localize(model.metadata.label); const group = game.i18n.localize(model.metadata.label);
const attributes = CONFIG.Token.documentClass.getTrackedAttributes(model.metadata.type); const attributes = CONFIG.Token.documentClass.getTrackedAttributes(model.metadata.type);
const getTranslations = path => { const getLabel = path => {
if (path === 'resources.hope.max') const label = model.schema.getField(path)?.label;
return { return label ? game.i18n.localize(label) : path;
label: game.i18n.localize('DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxHope.label'),
hint: ''
};
const field = model.schema.getField(path);
return {
label: field ? game.i18n.localize(field.label) : path,
hint: field ? game.i18n.localize(field.hint) : ''
};
}; };
const bars = attributes.bar.flatMap(x => { const bars = attributes.bar.flatMap(x => {
const joined = `${x.join('.')}.max`; const joined = `${x.join('.')}.max`;
return { value: joined, ...getTranslations(joined), group }; const label =
joined === 'resources.hope.max'
? 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxHope.label'
: getLabel(joined);
return { value: joined, label, group };
}); });
const values = attributes.value.flatMap(x => { const values = attributes.value.flatMap(x => {
const joined = x.join('.'); const joined = x.join('.');
return { value: joined, ...getTranslations(joined), group }; return { value: joined, label: getLabel(joined), group };
}); });
const bonuses = getAllLeaves(model.schema.fields.bonuses, group); const bonuses = getAllLeaves(model.schema.fields.bonuses, group);

View file

@ -262,9 +262,6 @@ export function ActionMixin(Base) {
} }
async toChat(origin) { async toChat(origin) {
const autoExpandDescription = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance)
.expandRollMessage?.desc;
const cls = getDocumentClass('ChatMessage'); const cls = getDocumentClass('ChatMessage');
const systemData = { const systemData = {
title: game.i18n.localize('DAGGERHEART.CONFIG.FeatureForm.action'), title: game.i18n.localize('DAGGERHEART.CONFIG.FeatureForm.action'),
@ -293,7 +290,7 @@ export function ActionMixin(Base) {
system: systemData, system: systemData,
content: await foundry.applications.handlebars.renderTemplate( content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/ui/chat/action.hbs', 'systems/daggerheart/templates/ui/chat/action.hbs',
{ ...systemData, open: autoExpandDescription ? 'open' : '' } systemData
), ),
flags: { flags: {
daggerheart: { daggerheart: {

View file

@ -1,39 +1,36 @@
#ui-left #ui-left-column-2 { #ui-left #ui-left-column-2 {
flex: 0 0 230px; flex: 0 0 230px;
.scene-wrapper { .scene-navigation {
display: flex; .scene-wrapper {
gap: 2px; display: flex;
height: var(--control-size); gap: 2px;
width: 100%; height: var(--control-size);
width: 100%;
> ul { .scene-environment {
margin: 0; padding: 0;
padding: 0;
}
.scene-environment { img {
padding: 0; border-radius: 4px;
}
img {
border-radius: 4px;
} }
} }
}
.scene { .scene {
justify-content: center; justify-content: center;
align-content: center; align-content: center;
background: var(--control-bg-color); background: var(--control-bg-color);
border: 1px solid var(--control-border-color); border: 1px solid var(--control-border-color);
border-radius: 4px; border-radius: 4px;
color: var(--control-icon-color); color: var(--control-icon-color);
pointer-events: all; pointer-events: all;
transition: transition:
border 0.25s, border 0.25s,
color 0.25s; color 0.25s;
text-shadow: none; text-shadow: none;
width: 200px; width: 200px;
max-width: 200px; max-width: 200px;
}
} }
} }

View file

@ -2,7 +2,7 @@
"id": "daggerheart", "id": "daggerheart",
"title": "Daggerheart", "title": "Daggerheart",
"description": "An unofficial implementation of the Daggerheart system", "description": "An unofficial implementation of the Daggerheart system",
"version": "1.7.1", "version": "1.7.0",
"compatibility": { "compatibility": {
"minimum": "13.346", "minimum": "13.346",
"verified": "13.351", "verified": "13.351",

View file

@ -1,5 +1,5 @@
<div class="daggerheart chat action"> <div class="daggerheart chat action">
<details class="action-move" {{this.open}}> <details class="action-move">
<summary class="action-section"> <summary class="action-section">
<img class="action-img" src="{{action.img}}" /> <img class="action-img" src="{{action.img}}" />
<div class="action-header"> <div class="action-header">

View file

@ -7,7 +7,7 @@
<h2 class="title">{{this.title}}</h2> <h2 class="title">{{this.title}}</h2>
<span class="label">{{localize 'DAGGERHEART.UI.Chat.deathMove.title'}}</span> <span class="label">{{localize 'DAGGERHEART.UI.Chat.deathMove.title'}}</span>
</div> </div>
<i class="fa-solid fa-chevron-down"></i> <i class="fa-solid {{this.chevron}}"></i>
</summary> </summary>
<div class="description"> <div class="description">
{{{this.description}}} {{{this.description}}}

View file

@ -1,7 +1,7 @@
<div class="daggerheart chat downtime"> <div class="daggerheart chat downtime">
<ul class="downtime-moves-list"> <ul class="downtime-moves-list">
{{#each moves as | move index |}} {{#each moves as | move index |}}
<details class="downtime-move" {{@root.open}}> <details class="downtime-move">
<summary class="downtime-label"> <summary class="downtime-label">
<img class="downtime-image" src="{{move.img}}" /> <img class="downtime-image" src="{{move.img}}" />
<div class="header-label"> <div class="header-label">

View file

@ -7,19 +7,17 @@
<menu id="scene-navigation-active" class="scene-navigation-menu flexcol"> <menu id="scene-navigation-active" class="scene-navigation-menu flexcol">
{{#each scenes.active as |scene|}} {{#each scenes.active as |scene|}}
<li class="scene-wrapper"> <li class="scene-wrapper">
<ul> <div class="ui-control scene {{scene.cssClass}}" data-scene-id="{{scene.id}}" data-action="viewScene" {{#if scene.tooltip}}data-tooltip-text="{{scene.tooltip}}"{{/if}}>
<li class="ui-control scene {{scene.cssClass}}" data-scene-id="{{scene.id}}" data-action="viewScene" {{#if scene.tooltip}}data-tooltip-text="{{scene.tooltip}}"{{/if}}> <span class="scene-name ellipsis">{{scene.name}}</span>
<span class="scene-name ellipsis">{{scene.name}}</span> {{#if scene.users}}
{{#if scene.users}} <ul class="scene-players">
<ul class="scene-players"> {{#each scene.users as |user|}}
{{#each scene.users as |user|}} <li class="scene-player" style="--color-bg:{{user.color}}; --color-border:{{user.border}}"
<li class="scene-player" style="--color-bg:{{user.color}}; --color-border:{{user.border}}" data-tooltip aria-label="{{user.name}}">{{user.letter}}</li>
data-tooltip aria-label="{{user.name}}">{{user.letter}}</li> {{/each}}
{{/each}} </ul>
</ul> {{/if}}
{{/if}} </div>
</li>
</ul>
{{#if scene.hasEnvironments}} {{#if scene.hasEnvironments}}
<button class="ui-control scene-environment {{#if (gt scene.environments.length 1)}}many-environments{{/if}}" data-action="openSceneEnvironment" data-scene-id="{{scene.id}}"><img src="{{scene.environmentImage}}" /> </button> <button class="ui-control scene-environment {{#if (gt scene.environments.length 1)}}many-environments{{/if}}" data-action="openSceneEnvironment" data-scene-id="{{scene.id}}"><img src="{{scene.environmentImage}}" /> </button>
{{/if}} {{/if}}
@ -29,11 +27,9 @@
<menu id="scene-navigation-inactive" class="scene-navigation-menu flexcol"> <menu id="scene-navigation-inactive" class="scene-navigation-menu flexcol">
{{#each scenes.inactive as |scene|}} {{#each scenes.inactive as |scene|}}
<li class="scene-wrapper"> <li class="scene-wrapper">
<ul> <div class="ui-control scene {{scene.cssClass}}" data-scene-id="{{scene.id}}" data-action="viewScene" {{#if scene.tooltip}}data-tooltip-text="{{scene.tooltip}}"{{/if}}>
<li class="ui-control scene {{scene.cssClass}}" data-scene-id="{{scene.id}}" data-action="viewScene" {{#if scene.tooltip}}data-tooltip-text="{{scene.tooltip}}"{{/if}}>
<span class="scene-name ellipsis">{{scene.name}}</span> <span class="scene-name ellipsis">{{scene.name}}</span>
</li> </div>
</ul>
</li> </li>
{{/each}} {{/each}}
</menu> </menu>