Merge branch 'main' of https://github.com/Foundryborne/daggerheart into feature/271-new-style-dialog-roll

This commit is contained in:
moliloo 2025-07-05 14:32:22 -03:00
commit b57706f715

View file

@ -211,17 +211,18 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
return { primary: primaryTabs, secondary: secondaryTabs };
}
/**@inheritdoc */
async _onFirstRender(context, options) {
await super._onFirstRender(context, options);
this._createContextMenues();
this._createFilterMenus();
}
/** @inheritDoc */
async _onRender(context, options) {
await super._onRender(context, options);
this._createFilterMenus();
this._createSearchFilter();
}
@ -409,6 +410,10 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
}
};
/* -------------------------------------------- */
/* Search Inputs */
/* -------------------------------------------- */
/**
* Create and initialize search filter instances for the inventory and loadout sections.
*
@ -572,6 +577,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
li.hidden = !(search.has(item.id) && matchesMenu);
}
}
/* -------------------------------------------- */
async mapFeatureType(data, configType) {
@ -594,6 +600,18 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
);
}
static async rollAttribute(event, button) {
const abilityLabel = game.i18n.localize(abilities[button.dataset.attribute].label);
const config = {
event: event,
title: game.i18n.format('DAGGERHEART.Chat.DualityRoll.AbilityCheckTitle', { ability: abilityLabel }),
roll: {
trait: button.dataset.attribute
}
};
this.document.diceRoll(config);
}
static async toggleMarks(_, button) {
const markValue = Number.parseInt(button.dataset.value);
const newValue = this.document.system.armor.system.marks.value >= markValue ? markValue - 1 : markValue;