Merge branch 'main' into feature/Homebrew-Downtime-Actions

This commit is contained in:
WBHarry 2025-07-25 16:35:36 +02:00
commit 86ffca509f
13 changed files with 103 additions and 35 deletions

View file

@ -36,10 +36,37 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
}
};
/** @inheritdoc */
static TABS = {
diceSoNice: {
tabs: [
{ id: 'hope', label: 'DAGGERHEART.GENERAL.hope' },
{ id: 'fear', label: 'DAGGERHEART.GENERAL.fear' },
{ id: 'advantage', label: 'DAGGERHEART.GENERAL.Advantage.full' },
{ id: 'disadvantage', label: 'DAGGERHEART.GENERAL.Advantage.full' }
],
initial: 'hope'
}
};
changeTab(tab, group, options) {
super.changeTab(tab, group, options);
this.render();
}
async _prepareContext(_options) {
const context = await super._prepareContext(_options);
context.settingFields = this.settings;
context.diceSoNiceTextures = game.dice3d?.exports?.TEXTURELIST ?? {};
context.diceSoNiceColorsets = game.dice3d?.exports?.COLORSETS ?? {};
context.diceTab = {
key: this.tabGroups.diceSoNice,
source: this.settings._source.diceSoNice[this.tabGroups.diceSoNice],
fields: this.settings.schema.fields.diceSoNice.fields[this.tabGroups.diceSoNice].fields
};
return context;
}
@ -65,4 +92,13 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
this.close();
}
_getTabs(tabs) {
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] ? this.tabGroups[v.group] === v.id : v.active;
v.cssClass = v.active ? 'active' : '';
}
return tabs;
}
}

View file

@ -517,9 +517,10 @@ export default class CharacterSheet extends DHBaseActorSheet {
const item = getDocFromElement(event.currentTarget);
if (!item) return;
const max = item.system.resource.max ? itemAbleRollParse(item.system.resource.max, this.document, item) : null;
const max = event.currentTarget.max ? Number(event.currentTarget.max) : null;
const value = max ? Math.min(Number(event.currentTarget.value), max) : event.currentTarget.value;
await item.update({ 'system.resource.value': value });
this.render();
}
async updateItemQuantity(event) {
@ -527,6 +528,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
if (!item) return;
await item.update({ 'system.quantity': event.currentTarget.value });
this.render();
}
async updateArmorMarks(event) {