Feature/178 searchbar logic to items in character sheet (#209)

* REFACTOR: remove DhpApplicationMixin
REFACTOR: remove getEmbeddedDocument method from Item class
REFACTOR: remove prepareData method from Actor class
REFACTOR: remove _preUpdate method from Actor class

* REFACTOR: rename dhpItem to DHItem
REFACTOR: improvement Item#isInventoryItem getter
REFACTOR: simplify Item's createDialog static method.
REFACTOR: remove documentCreate template

* FEAT: add SearchFilter for character-sheet Inventory and DomainCards
FEAT: simplify the preparetion of inventory context

---------

Co-authored-by: Joaquin Pereyra <joaquinpereyra98@users.noreply.github.com>
This commit is contained in:
joaquinpereyra98 2025-06-28 23:44:57 -03:00 committed by GitHub
parent 7114a9e749
commit 7135716da9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 245 additions and 254 deletions

View file

@ -9,7 +9,8 @@ export default class DHArmor extends BaseDataItem {
label: 'TYPES.Item.armor',
type: 'armor',
hasDescription: true,
isQuantifiable: true
isQuantifiable: true,
isInventoryItem: true,
});
}

View file

@ -7,6 +7,7 @@ import { actionsTypes } from '../action/_module.mjs';
* @property {string} type - The system type that this data model represents.
* @property {boolean} hasDescription - Indicates whether items of this type have description field
* @property {boolean} isQuantifiable - Indicates whether items of this type have quantity field
* @property {boolean} isInventoryItem- Indicates whether items of this type is a Inventory Item
*/
const fields = foundry.data.fields;
@ -18,7 +19,8 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
label: 'Base Item',
type: 'base',
hasDescription: false,
isQuantifiable: false
isQuantifiable: false,
isInventoryItem: false,
};
}

View file

@ -8,7 +8,8 @@ export default class DHConsumable extends BaseDataItem {
label: 'TYPES.Item.consumable',
type: 'consumable',
hasDescription: true,
isQuantifiable: true
isQuantifiable: true,
isInventoryItem: true,
});
}

View file

@ -8,7 +8,8 @@ export default class DHMiscellaneous extends BaseDataItem {
label: 'TYPES.Item.miscellaneous',
type: 'miscellaneous',
hasDescription: true,
isQuantifiable: true
isQuantifiable: true,
isInventoryItem: true,
});
}

View file

@ -12,10 +12,8 @@ export default class DHWeapon extends BaseDataItem {
type: 'weapon',
hasDescription: true,
isQuantifiable: true,
embedded: {
feature: 'featureTest'
},
hasInitialAction: true
isInventoryItem: true,
hasInitialAction: true,
});
}