Bug/103 enrich htmlfield content before its used in applications (#369)

* FIX: Add enritch to HTMLField
FIX: Remove no-HTMLField from Manifest
FIX: Convert Scar's HTMLField to StringField
FIX: Remove unused HTMLField

* REMOVE unused hanldebars helpers

* FEAT: add inventory-fieldset-items-V2 and inventory-item-V2  partials for Actors

* FIX showLabels to hideTags

* FEAT: add template to items sheet

* FEAT: add effects tabs on ItemSheet

* FEAT: add context menus for all inventory-items

* FEAT: add resources to inventory-item template

* FEAT: add enritch on inventory-item description
FEAT: add extensible behavior on inventory-item-content
FEAT: add fade effect on item-img to roll-itmg

* FEAT: add eritch to NPC description
FIX: missing htmlFieldss on manfiest
FIX: add misisng localizations

* FIX_ minor fixes

* Little resource fix. Noone will notice ._.

* FIX: remove default list styles
FIX: .extended css reduce max-height, shorten animation duration to 0.5s, and set overflow to auto.
FIX: set enriched=notes.enriche on notes.hbs
FIX: set experience.value on sidebar.hbs
FIX: move tooltip from item-img to img-portrait on inventory-item-V2.hbs
REMOVE: unused files

---------

Co-authored-by: Joaquin Pereyra <joaquinpereyra98@users.noreply.github.com>
Co-authored-by: WBHarry <williambjrklund@gmail.com>
This commit is contained in:
joaquinpereyra98 2025-07-19 17:21:46 -03:00 committed by GitHub
parent 615df65415
commit b8930b18a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 1768 additions and 1434 deletions

View file

@ -10,10 +10,6 @@ export default class ClassSheet extends DHBaseItemSheet {
actions: {
removeItemFromCollection: ClassSheet.#removeItemFromCollection,
removeSuggestedItem: ClassSheet.#removeSuggestedItem,
viewDoc: ClassSheet.#viewDoc,
addFeature: this.addFeature,
editFeature: this.editFeature,
deleteFeature: this.deleteFeature
},
tagifyConfigs: [
{
@ -46,13 +42,17 @@ export default class ClassSheet extends DHBaseItemSheet {
settings: {
template: 'systems/daggerheart/templates/sheets/items/class/settings.hbs',
scrollable: ['.settings']
},
effects: {
template: 'systems/daggerheart/templates/sheets/global/tabs/tab-effects.hbs',
scrollable: ['.effects']
}
};
/** @inheritdoc */
static TABS = {
primary: {
tabs: [{ id: 'description' }, { id: 'features' }, { id: 'settings' }],
tabs: [{ id: 'description' }, { id: 'features' }, { id: 'settings' }, { id: 'effects' }],
initial: 'description',
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
}
@ -179,59 +179,4 @@ export default class ClassSheet extends DHBaseItemSheet {
const { target } = element.dataset;
await this.document.update({ [`system.characterGuide.${target}`]: null });
}
/**
* Open the sheet of a item by UUID.
* @param {PointerEvent} _event -
* @param {HTMLElement} button
*/
static async #viewDoc(_event, button) {
const doc = await fromUuid(button.dataset.uuid);
doc.sheet.render({ force: true });
}
static async addFeature(_, target) {
const feature = await game.items.documentClass.create({
type: 'feature',
name: game.i18n.format('DOCUMENT.New', { type: game.i18n.localize('TYPES.Item.feature') }),
system: {
subType:
target.dataset.type === 'hope'
? CONFIG.DH.ITEM.featureSubTypes.hope
: CONFIG.DH.ITEM.featureSubTypes.class
}
});
await this.document.update({
[`system.features`]: [...this.document.system.features.filter(x => x).map(x => x.uuid), feature.uuid]
});
}
static async editFeature(_, button) {
const target = button.closest('.feature-item');
const feature = this.document.system.features.find(x => x?.id === target.dataset.featureId);
if (!feature) {
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.featureIsMissing'));
return;
}
feature.sheet.render(true);
}
static async deleteFeature(event, button) {
event.stopPropagation();
const target = button.closest('.feature-item');
const feature = this.document.system.features.find(
feature => feature && feature.id === target.dataset.featureId
);
if (feature) {
await feature.update({ 'system.subType': null });
}
await this.document.update({
[`system.features`]: this.document.system.features
.filter(feature => feature && feature.id !== target.dataset.featureId)
.map(x => x.uuid)
});
}
}