REFACTOR: rename dhpItem to DHItem

REFACTOR: improvement Item#isInventoryItem getter
REFACTOR: simplify Item's createDialog static method.
REFACTOR: remove documentCreate template
This commit is contained in:
Joaquin Pereyra 2025-06-28 15:37:04 -03:00
parent a4881854a3
commit 15b696398c
9 changed files with 61 additions and 115 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

@ -5,6 +5,7 @@
* @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;
@ -16,7 +17,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,9 +12,7 @@ export default class DHWeapon extends BaseDataItem {
type: 'weapon',
hasDescription: true,
isQuantifiable: true,
embedded: {
feature: 'featureTest'
}
isInventoryItem: true,
});
}