Merged with main

This commit is contained in:
WBHarry 2025-11-20 11:13:07 +01:00
commit 30828cd6ee
11 changed files with 341 additions and 54 deletions

View file

@ -82,13 +82,6 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
return frame;
}
/**@inheritdoc */
async _onFirstRender(context, options) {
await super._onFirstRender(context, options);
this.toggleCollapsedPosition(undefined, !ui.sidebar.expanded);
}
/** Returns countdown data filtered by ownership */
#getCountdowns() {
const setting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns);
@ -153,14 +146,6 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
: playerOwnership;
}
toggleCollapsedPosition = async (_, collapsed) => {
if (!this.element) return;
this.sidebarCollapsed = collapsed;
if (!collapsed) this.element.classList.add('expanded');
else this.element.classList.remove('expanded');
};
cooldownRefresh = ({ refreshType }) => {
if (refreshType === RefreshType.Countdown) this.render();
};
@ -238,7 +223,6 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
}
setupHooks() {
Hooks.on('collapseSidebar', this.toggleCollapsedPosition.bind());
Hooks.on(socketEvent.Refresh, this.cooldownRefresh.bind());
}
@ -246,7 +230,6 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
/* Opt out of Foundry's standard behavior of closing all application windows marked as UI when Escape is pressed */
if (options.closeKey) return;
Hooks.off('collapseSidebar', this.toggleCollapsedPosition);
Hooks.off(socketEvent.Refresh, this.cooldownRefresh);
return super.close(options);
}
@ -290,5 +273,8 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
async _onRender(context, options) {
await super._onRender(context, options);
this.element.hidden = !game.user.isGM && this.#getCountdowns().length === 0;
if (options?.force) {
document.getElementById('ui-right-column-1')?.appendChild(this.element);
}
}
}

View file

@ -22,7 +22,7 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
/** @inheritDoc */
static DEFAULT_OPTIONS = {
id: 'itemBrowser',
classes: ['daggerheart', 'dh-style', 'dialog', 'compendium-browser', 'loader'],
classes: ['daggerheart', 'dh-style', 'dialog', 'compendium-browser', 'daggerheart-loader'],
tag: 'div',
window: {
frame: true,
@ -277,7 +277,7 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
toggleLoader(state) {
const container = this.element.querySelector('.item-list');
return setTimeout(() => {
container.classList.toggle('loader', state);
container.classList.toggle('daggerheart-loader', state);
}, 100);
}

View file

@ -260,7 +260,7 @@ export function ActionMixin(Base) {
origin: origin,
action: { name: this.name, img: this.img, tags: this.tags ? this.tags : ['Spell', 'Arcana', 'Lv 10'] },
itemOrigin: this.item,
description: this.description
description: this.description || (this.item instanceof Item ? this.item.system.description : '')
};
const msg = {
type: 'abilityUse',

View file

@ -115,7 +115,7 @@ export default class DHRoll extends Roll {
game.system.api.applications.dialogs.TagTeamDialog.assignRoll(message.speakerActor, message);
}
if (game.modules.get('dice-so-nice')?.active) {
if (roll.formula !== '' && game.modules.get('dice-so-nice')?.active) {
await game.dice3d.waitFor3DAnimationByMessageID(message.id);
}

View file

@ -8,23 +8,23 @@ export { DhDamageEnricher, DhDualityRollEnricher, DhEffectEnricher, DhTemplateEn
export const enricherConfig = [
{
pattern: /@Damage\[(.*)\]({.*})?/g,
pattern: /@Damage\[([^\[\]]*)\]({[^}]*})?/g,
enricher: DhDamageEnricher
},
{
pattern: /\[\[\/dr\s?(.*?)\]\]({.*})?/g,
pattern: /\[\[\/dr\s?(.*?)\]\]({[^}]*})?/g,
enricher: DhDualityRollEnricher
},
{
pattern: /@Effect\[(.*)\]({.*})?/g,
pattern: /@Effect\[([^\[\]]*)\]({[^}]*})?/g,
enricher: DhEffectEnricher
},
{
pattern: /@Template\[(.*)\]({.*})?/g,
pattern: /@Template\[([^\[\]]*)\]({[^}]*})?/g,
enricher: DhTemplateEnricher
},
{
pattern: /@Lookup\[(.*)\]({.*})?/g,
pattern: /@Lookup\[([^\[\]]*)\]({[^}]*})?/g,
enricher: DhLookupEnricher
}
];

View file

@ -33,7 +33,7 @@
"value": {
"custom": {
"enabled": true,
"formula": "(@prof+2)@basicAttackDamageDice"
"formula": "(@prof+2)@basicAttackDamageDice + 6"
},
"multiplier": "prof",
"flatMultiplier": 1,
@ -49,7 +49,8 @@
"dice": "d6",
"bonus": null,
"custom": {
"enabled": false
"enabled": false,
"formula": ""
}
}
}
@ -57,8 +58,8 @@
"includeBase": false
},
"target": {
"type": "self",
"amount": null
"type": "hostile",
"amount": 1
},
"effects": [],
"roll": {
@ -83,7 +84,7 @@
},
"name": "Attack",
"img": "icons/creatures/abilities/paw-print-orange.webp",
"range": "self"
"range": "melee"
}
},
"originItemType": null,
@ -150,12 +151,12 @@
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.347",
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.1.0",
"systemVersion": "1.2.3",
"createdTime": 1753621786000,
"modifiedTime": 1756041242273,
"lastModifiedBy": "vUIbuan0U50nfKBE"
"modifiedTime": 1763549111169,
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
},
"_id": "0ey4kM9ssj2otHvb",
"sort": 600000,

View file

@ -5,7 +5,7 @@
"_id": "6rlxhrRwFaVgq9fe",
"img": "icons/magic/nature/wolf-paw-glow-large-orange.webp",
"system": {
"description": "<p><strong>Spend 3 Hope</strong> to transform into a Beastform without marking a Stress. When you do, choose one trait to raise by +1 until you drop out of that Beastform.<br /><br /><strong>Note: Manually increase your trait on character sheet if this is in effect.</strong></p>",
"description": "<p><strong>Spend 3 Hope</strong> to transform into a Beastform without marking a Stress. When you do, choose one trait to raise by +1 until you drop out of that Beastform.<br /><br /><strong>Note: Toggle one of the Evolution Traits in the effects tab to raise a trait by 1, e.g. Evolution: Agility</strong></p>",
"resource": null,
"actions": {
"bj4m9E8ObFT0xDQ4": {
@ -46,7 +46,314 @@
"artist": ""
}
},
"effects": [],
"effects": [
{
"name": "Evolution: Agility",
"type": "base",
"system": {
"rangeDependence": {
"enabled": false,
"type": "withinRange",
"target": "hostile",
"range": "melee"
}
},
"_id": "vQOqLZAxOltAzsVv",
"img": "icons/magic/nature/wolf-paw-glow-large-orange.webp",
"changes": [
{
"key": "system.traits.agility.value",
"mode": 2,
"value": "1",
"priority": null
}
],
"disabled": true,
"duration": {
"startTime": null,
"combat": null,
"seconds": null,
"rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
},
"description": "<p>Toggle this for +1 to Agility when using Evolution. Turn it off when you leave Beastform.</p>",
"origin": null,
"tint": "#ffffff",
"transfer": true,
"statuses": [],
"sort": 0,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.2.3",
"createdTime": 1763444412215,
"modifiedTime": 1763444454384,
"lastModifiedBy": "9HOfUKAXuCu7hUPY"
},
"_key": "!items.effects!6rlxhrRwFaVgq9fe.vQOqLZAxOltAzsVv"
},
{
"name": "Evolution: Strength",
"type": "base",
"system": {
"rangeDependence": {
"enabled": false,
"type": "withinRange",
"target": "hostile",
"range": "melee"
}
},
"_id": "cwEsO1NZpkQHuoTT",
"img": "icons/magic/nature/wolf-paw-glow-large-orange.webp",
"changes": [
{
"key": "system.traits.strength.value",
"mode": 2,
"value": "1",
"priority": null
}
],
"disabled": true,
"duration": {
"startTime": null,
"combat": null,
"seconds": null,
"rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
},
"description": "<p>Toggle this for +1 to Strength when using Evolution. Turn it off when you leave Beastform.</p>",
"origin": null,
"tint": "#ffffff",
"transfer": true,
"statuses": [],
"sort": 0,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.2.3",
"createdTime": 1763444570591,
"modifiedTime": 1763444616465,
"lastModifiedBy": "9HOfUKAXuCu7hUPY"
},
"_key": "!items.effects!6rlxhrRwFaVgq9fe.cwEsO1NZpkQHuoTT"
},
{
"name": "Evolution: Finesse",
"type": "base",
"system": {
"rangeDependence": {
"enabled": false,
"type": "withinRange",
"target": "hostile",
"range": "melee"
}
},
"_id": "8P0nwRHNsVnHVPjq",
"img": "icons/magic/nature/wolf-paw-glow-large-orange.webp",
"changes": [
{
"key": "system.traits.finesse.value",
"mode": 2,
"value": "1",
"priority": null
}
],
"disabled": true,
"duration": {
"startTime": null,
"combat": null,
"seconds": null,
"rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
},
"description": "<p>Toggle this for +1 to Finesse when using Evolution. Turn it off when you leave Beastform.</p>",
"origin": null,
"tint": "#ffffff",
"transfer": true,
"statuses": [],
"sort": 0,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.2.3",
"createdTime": 1763444626581,
"modifiedTime": 1763444677228,
"lastModifiedBy": "9HOfUKAXuCu7hUPY"
},
"_key": "!items.effects!6rlxhrRwFaVgq9fe.8P0nwRHNsVnHVPjq"
},
{
"name": "Evolution: Instinct",
"type": "base",
"system": {
"rangeDependence": {
"enabled": false,
"type": "withinRange",
"target": "hostile",
"range": "melee"
}
},
"_id": "i2GhNGo5TnGtLuA0",
"img": "icons/magic/nature/wolf-paw-glow-large-orange.webp",
"changes": [
{
"key": "system.traits.instinct.value",
"mode": 2,
"value": "1",
"priority": null
}
],
"disabled": true,
"duration": {
"startTime": null,
"combat": null,
"seconds": null,
"rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
},
"description": "<p>Toggle this for +1 to Instinct when using Evolution. Turn it off when you leave Beastform.</p>",
"origin": null,
"tint": "#ffffff",
"transfer": true,
"statuses": [],
"sort": 0,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.2.3",
"createdTime": 1763444688167,
"modifiedTime": 1763444730192,
"lastModifiedBy": "9HOfUKAXuCu7hUPY"
},
"_key": "!items.effects!6rlxhrRwFaVgq9fe.i2GhNGo5TnGtLuA0"
},
{
"name": "Evolution: Presence",
"type": "base",
"system": {
"rangeDependence": {
"enabled": false,
"type": "withinRange",
"target": "hostile",
"range": "melee"
}
},
"_id": "APQF1in1LXjBZh9n",
"img": "icons/magic/nature/wolf-paw-glow-large-orange.webp",
"changes": [
{
"key": "system.traits.presence.value",
"mode": 2,
"value": "1",
"priority": null
}
],
"disabled": true,
"duration": {
"startTime": null,
"combat": null,
"seconds": null,
"rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
},
"description": "<p>Toggle this for +1 to Presence when using Evolution. Turn it off when you leave Beastform.</p>",
"origin": null,
"tint": "#ffffff",
"transfer": true,
"statuses": [],
"sort": 0,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.2.3",
"createdTime": 1763444736373,
"modifiedTime": 1763444776081,
"lastModifiedBy": "9HOfUKAXuCu7hUPY"
},
"_key": "!items.effects!6rlxhrRwFaVgq9fe.APQF1in1LXjBZh9n"
},
{
"name": "Evolution: Knowledge",
"type": "base",
"system": {
"rangeDependence": {
"enabled": false,
"type": "withinRange",
"target": "hostile",
"range": "melee"
}
},
"_id": "WwOvGJYJb4d37cOy",
"img": "icons/magic/nature/wolf-paw-glow-large-orange.webp",
"changes": [
{
"key": "system.traits.knowledge.value",
"mode": 2,
"value": "1",
"priority": null
}
],
"disabled": true,
"duration": {
"startTime": null,
"combat": null,
"seconds": null,
"rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
},
"description": "<p>Toggle this for +1 to Knowledge when using Evolution. Turn it off when you leave Beastform.</p>",
"origin": null,
"tint": "#ffffff",
"transfer": true,
"statuses": [],
"sort": 0,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.2.3",
"createdTime": 1763444779829,
"modifiedTime": 1763444825976,
"lastModifiedBy": "9HOfUKAXuCu7hUPY"
},
"_key": "!items.effects!6rlxhrRwFaVgq9fe.WwOvGJYJb4d37cOy"
}
],
"sort": 100000,
"ownership": {
"default": 0,
@ -57,12 +364,12 @@
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.347",
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.0.5",
"systemVersion": "1.2.3",
"createdTime": 1754221506611,
"modifiedTime": 1755391214500,
"lastModifiedBy": "VZIeX2YDvX338Zvr"
"modifiedTime": 1763444563650,
"lastModifiedBy": "9HOfUKAXuCu7hUPY"
},
"_key": "!items!6rlxhrRwFaVgq9fe"
}

View file

@ -24,7 +24,7 @@
}
}
.loader {
.daggerheart-loader {
position: relative;
overflow: hidden !important;

View file

@ -12,26 +12,18 @@
}
.daggerheart.dh-style.countdowns {
z-index: var(--z-index-ui) !important;
position: initial;
border: 0;
border-radius: 4px;
box-shadow: none;
width: 300px;
top: 16px;
right: calc(64px * var(--ui-scale));
transition:
right ease 250ms,
opacity var(--ui-fade-duration) ease,
opacity var(--ui-fade-duration);
pointer-events: all;
align-self: flex-end;
.window-title {
font-family: @font-body;
}
&.expanded {
right: calc(364px * var(--ui-scale));
}
&.icon-only {
width: 180px;
min-width: 180px;

View file

@ -53,6 +53,7 @@
collection=document.itemTypes.loot
isGlassy=true
canCreate=true
showActions=true
}}
</div>
</section>

View file

@ -139,7 +139,7 @@ Parameters:
{{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}}
{{/if}}
{{!-- Actions Buttons --}}
{{#if (and showActions (eq item.type 'feature'))}}
{{#if (and showActions item.system.actions.size)}}
<div class="item-buttons">
{{#each item.system.actions as | action |}}
<div class="item-button">