mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
Compare commits
3 commits
17ec77a349
...
6cbe770880
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6cbe770880 | ||
|
|
95d4003045 | ||
|
|
fa19339868 |
12 changed files with 81 additions and 60 deletions
|
|
@ -243,14 +243,17 @@ Hooks.on('setup', () => {
|
|||
}))
|
||||
];
|
||||
|
||||
const actorCommon = {
|
||||
bar: ['resources.stress'],
|
||||
value: []
|
||||
};
|
||||
const damageThresholds = ['damageThresholds.major', 'damageThresholds.severe'];
|
||||
const traits = Object.keys(game.system.api.data.actors.DhCharacter.schema.fields.traits.fields).map(
|
||||
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 = {
|
||||
character: {
|
||||
bar: [...actorCommon.bar, 'resources.hitPoints', 'resources.hope'],
|
||||
|
|
|
|||
|
|
@ -2111,7 +2111,7 @@
|
|||
"thresholdImmunities": {
|
||||
"minor": {
|
||||
"label": "Threshold Immunities: Minor",
|
||||
"hint": "Automatically ignores minor damage"
|
||||
"hint": "Automatically ignores minor damage when set to 1"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -200,7 +200,6 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
|
|||
description: game.i18n.localize(this.selectedMove.description),
|
||||
result: result,
|
||||
open: autoExpandDescription ? 'open' : '',
|
||||
chevron: autoExpandDescription ? 'fa-chevron-up' : 'fa-chevron-down',
|
||||
showRiskItAllButton: this.showRiskItAllButton,
|
||||
riskItAllButtonLabel: this.riskItAllButtonLabel,
|
||||
riskItAllHope: this.riskItAllHope
|
||||
|
|
|
|||
|
|
@ -196,6 +196,9 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
|
|||
.filter(x => x.testUserPermission(game.user, 'LIMITED'))
|
||||
.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 msg = {
|
||||
user: game.user.id,
|
||||
|
|
@ -216,7 +219,8 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
|
|||
actor: { name: this.actor.name, img: this.actor.img },
|
||||
moves: moves,
|
||||
characters: characters,
|
||||
selfId: this.actor.uuid
|
||||
selfId: this.actor.uuid,
|
||||
open: autoExpandDescription ? 'open' : ''
|
||||
}
|
||||
),
|
||||
flags: {
|
||||
|
|
|
|||
|
|
@ -30,22 +30,27 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac
|
|||
const group = game.i18n.localize(model.metadata.label);
|
||||
const attributes = CONFIG.Token.documentClass.getTrackedAttributes(model.metadata.type);
|
||||
|
||||
const getLabel = path => {
|
||||
const label = model.schema.getField(path)?.label;
|
||||
return label ? game.i18n.localize(label) : path;
|
||||
const getTranslations = path => {
|
||||
if (path === 'resources.hope.max')
|
||||
return {
|
||||
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 joined = `${x.join('.')}.max`;
|
||||
const label =
|
||||
joined === 'resources.hope.max'
|
||||
? 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxHope.label'
|
||||
: getLabel(joined);
|
||||
return { value: joined, label, group };
|
||||
return { value: joined, ...getTranslations(joined), group };
|
||||
});
|
||||
const values = attributes.value.flatMap(x => {
|
||||
const joined = x.join('.');
|
||||
return { value: joined, label: getLabel(joined), group };
|
||||
return { value: joined, ...getTranslations(joined), group };
|
||||
});
|
||||
|
||||
const bonuses = getAllLeaves(model.schema.fields.bonuses, group);
|
||||
|
|
|
|||
|
|
@ -262,6 +262,9 @@ export function ActionMixin(Base) {
|
|||
}
|
||||
|
||||
async toChat(origin) {
|
||||
const autoExpandDescription = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance)
|
||||
.expandRollMessage?.desc;
|
||||
|
||||
const cls = getDocumentClass('ChatMessage');
|
||||
const systemData = {
|
||||
title: game.i18n.localize('DAGGERHEART.CONFIG.FeatureForm.action'),
|
||||
|
|
@ -290,7 +293,7 @@ export function ActionMixin(Base) {
|
|||
system: systemData,
|
||||
content: await foundry.applications.handlebars.renderTemplate(
|
||||
'systems/daggerheart/templates/ui/chat/action.hbs',
|
||||
systemData
|
||||
{ ...systemData, open: autoExpandDescription ? 'open' : '' }
|
||||
),
|
||||
flags: {
|
||||
daggerheart: {
|
||||
|
|
|
|||
|
|
@ -1,36 +1,39 @@
|
|||
#ui-left #ui-left-column-2 {
|
||||
flex: 0 0 230px;
|
||||
|
||||
.scene-navigation {
|
||||
.scene-wrapper {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
height: var(--control-size);
|
||||
width: 100%;
|
||||
.scene-wrapper {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
height: var(--control-size);
|
||||
width: 100%;
|
||||
|
||||
.scene-environment {
|
||||
padding: 0;
|
||||
> ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
border-radius: 4px;
|
||||
}
|
||||
.scene-environment {
|
||||
padding: 0;
|
||||
|
||||
img {
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.scene {
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
background: var(--control-bg-color);
|
||||
border: 1px solid var(--control-border-color);
|
||||
border-radius: 4px;
|
||||
color: var(--control-icon-color);
|
||||
pointer-events: all;
|
||||
transition:
|
||||
border 0.25s,
|
||||
color 0.25s;
|
||||
text-shadow: none;
|
||||
width: 200px;
|
||||
max-width: 200px;
|
||||
}
|
||||
.scene {
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
background: var(--control-bg-color);
|
||||
border: 1px solid var(--control-border-color);
|
||||
border-radius: 4px;
|
||||
color: var(--control-icon-color);
|
||||
pointer-events: all;
|
||||
transition:
|
||||
border 0.25s,
|
||||
color 0.25s;
|
||||
text-shadow: none;
|
||||
width: 200px;
|
||||
max-width: 200px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"id": "daggerheart",
|
||||
"title": "Daggerheart",
|
||||
"description": "An unofficial implementation of the Daggerheart system",
|
||||
"version": "1.7.0",
|
||||
"version": "1.7.1",
|
||||
"compatibility": {
|
||||
"minimum": "13.346",
|
||||
"verified": "13.351",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div class="daggerheart chat action">
|
||||
<details class="action-move">
|
||||
<details class="action-move" {{this.open}}>
|
||||
<summary class="action-section">
|
||||
<img class="action-img" src="{{action.img}}" />
|
||||
<div class="action-header">
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<h2 class="title">{{this.title}}</h2>
|
||||
<span class="label">{{localize 'DAGGERHEART.UI.Chat.deathMove.title'}}</span>
|
||||
</div>
|
||||
<i class="fa-solid {{this.chevron}}"></i>
|
||||
<i class="fa-solid fa-chevron-down"></i>
|
||||
</summary>
|
||||
<div class="description">
|
||||
{{{this.description}}}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="daggerheart chat downtime">
|
||||
<ul class="downtime-moves-list">
|
||||
{{#each moves as | move index |}}
|
||||
<details class="downtime-move">
|
||||
<details class="downtime-move" {{@root.open}}>
|
||||
<summary class="downtime-label">
|
||||
<img class="downtime-image" src="{{move.img}}" />
|
||||
<div class="header-label">
|
||||
|
|
|
|||
|
|
@ -7,17 +7,19 @@
|
|||
<menu id="scene-navigation-active" class="scene-navigation-menu flexcol">
|
||||
{{#each scenes.active as |scene|}}
|
||||
<li class="scene-wrapper">
|
||||
<div 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>
|
||||
{{#if scene.users}}
|
||||
<ul class="scene-players">
|
||||
{{#each scene.users as |user|}}
|
||||
<li class="scene-player" style="--color-bg:{{user.color}}; --color-border:{{user.border}}"
|
||||
data-tooltip aria-label="{{user.name}}">{{user.letter}}</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
<ul>
|
||||
<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>
|
||||
{{#if scene.users}}
|
||||
<ul class="scene-players">
|
||||
{{#each scene.users as |user|}}
|
||||
<li class="scene-player" style="--color-bg:{{user.color}}; --color-border:{{user.border}}"
|
||||
data-tooltip aria-label="{{user.name}}">{{user.letter}}</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</li>
|
||||
</ul>
|
||||
{{#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>
|
||||
{{/if}}
|
||||
|
|
@ -27,9 +29,11 @@
|
|||
<menu id="scene-navigation-inactive" class="scene-navigation-menu flexcol">
|
||||
{{#each scenes.inactive as |scene|}}
|
||||
<li class="scene-wrapper">
|
||||
<div class="ui-control scene {{scene.cssClass}}" data-scene-id="{{scene.id}}" data-action="viewScene" {{#if scene.tooltip}}data-tooltip-text="{{scene.tooltip}}"{{/if}}>
|
||||
<ul>
|
||||
<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>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
{{/each}}
|
||||
</menu>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue