Merge branch 'main' into feature/chat-message-styles

This commit is contained in:
WBHarry 2025-07-28 20:54:02 +02:00
commit 094e0740dd
270 changed files with 13798 additions and 982 deletions

View file

@ -123,13 +123,15 @@ export default class BeastformDialog extends HandlebarsApplicationMixin(Applicat
);
const compendiumBeastforms = await game.packs.get(`daggerheart.beastforms`)?.getDocuments();
const beastformTiers = [...(compendiumBeastforms ? compendiumBeastforms : []), ...game.items].reduce(
const beastformTiers = [...game.items, ...(compendiumBeastforms ? compendiumBeastforms : [])].reduce(
(acc, x) => {
const tier = CONFIG.DH.GENERAL.tiers[x.system.tier];
if (x.type !== 'beastform' || tier.id > this.configData.tierLimit) return acc;
if (!acc[tier.id]) acc[tier.id] = { label: game.i18n.localize(tier.label), values: {} };
if (Object.values(acc[tier.id].values).find(existing => existing.value.name === x.name)) return acc;
acc[tier.id].values[x.uuid] = {
selected: this.selected?.uuid == x.uuid,
value: x,

View file

@ -91,9 +91,10 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
context.roll = this.roll;
context.rollType = this.roll?.constructor.name;
context.rallyDie = this.roll.rallyChoices;
context.experiences = Object.keys(this.config.data.experiences).map(id => ({
const experiences = this.config.data?.experiences || {};
context.experiences = Object.keys(experiences).map(id => ({
id,
...this.config.data.experiences[id]
...experiences[id]
}));
context.selectedExperiences = this.config.experiences;
context.advantage = this.config.roll?.advantage;

View file

@ -38,17 +38,15 @@ export default class DamageDialog extends HandlebarsApplicationMixin(Application
};
get title() {
return game.i18n.localize('DAGGERHEART.EFFECTS.ApplyLocations.damageRoll.name');
return game.i18n.localize(`DAGGERHEART.EFFECTS.ApplyLocations.${this.config.isHealing ? 'healing' : 'damage'}Roll.name`);
}
async _prepareContext(_options) {
const context = await super._prepareContext(_options);
context.config = CONFIG.DH;
context.title = this.config.title
? this.config.title
: game.i18n.localize('DAGGERHEART.EFFECTS.ApplyLocations.damageRoll.name');
// context.extraFormula = this.config.extraFormula;
context.title = this.config.title ?? this.title;
context.formula = this.roll.constructFormula(this.config);
context.isHealing = this.config.isHealing;
context.directDamage = this.config.directDamage;
context.selectedRollMode = this.config.selectedRollMode;
context.rollModes = Object.entries(CONFIG.Dice.rollModes).map(([action, { label, icon }]) => ({

View file

@ -1,6 +1,6 @@
import { damageKeyToNumber, getDamageLabel } from '../../helpers/utils.mjs';
const { DialogV2, ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api;
const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api;
export default class DamageReductionDialog extends HandlebarsApplicationMixin(ApplicationV2) {
constructor(resolve, reject, actor, damage, damageType) {
@ -53,10 +53,6 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
);
}
get title() {
return game.i18n.localize('DAGGERHEART.APPLICATIONS.DamageReduction.title');
}
static DEFAULT_OPTIONS = {
tag: 'form',
classes: ['daggerheart', 'views', 'damage-reduction'],

View file

@ -1,3 +1,5 @@
// TO DELETE ?
const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api;
export default class DamageSelectionDialog extends HandlebarsApplicationMixin(ApplicationV2) {

View file

@ -13,8 +13,9 @@ export default class DhpDeathMove extends HandlebarsApplicationMixin(Application
}
static DEFAULT_OPTIONS = {
classes: ['daggerheart', 'views', 'death-move'],
position: { width: 800, height: 'auto' },
classes: ['daggerheart', 'dh-style', 'dialog', 'views', 'death-move'],
position: { width: 'auto', height: 'auto' },
window: { icon: 'fa-solid fa-skull' },
actions: {
selectMove: this.selectMove,
takeMove: this.takeMove
@ -32,6 +33,7 @@ export default class DhpDeathMove extends HandlebarsApplicationMixin(Application
const context = await super._prepareContext(_options);
context.selectedMove = this.selectedMove;
context.options = CONFIG.DH.GENERAL.deathMoves;
context.title = game.i18n.localize('DAGGERHEART.APPLICATIONS.DeathMove.takeMove');
return context;
}