Closed Forien closed 3 weeks ago
Decided that at this point it is neither needed, nor practical, to have items of Equippable Model to be displayed on Combat tab of Actor's Sheet, so removed that from plan.
Also changing PR to "Ready for review" while I test it on my end.
Purpose of this Pull Request
Main purpose oif this PR is to add new layer of Data Model called
EquippableItemModel
, which is a subtype ofPhysicalItemModel
representing any and all physical items that can beequipped
. This should encompass everything, from accessories, through armour and clothing, to weapons etc. providing a standardized framework of handling those items, their state and operations on them (such as toggling equipped state, or checking if they are equipped).This is important step to unify all variations like
item.system.equipped
,item.system.equipped.value
,item.system.worn
and`item.system.worn.value
into one, cohesive system.What this Pull Request will allow
The "end game" of this change is to allow 3rd party (or even official) modules to easily expand on inventory and equipment system. This change follows my future idea of dynamically rendered Inventory based on Data Models, instead of hardcoded categories, and this is a step in achieving this.
This change would allow system to simply check the Data Model and it would know if the item can be equipped (so it can show the toggle) and what to call when the toggle is clicked. Think of it as "Interface".
Phase 1 (finished)
EquippableItemModel
Data Model, which works both as Interface and main implementation of "equippable logic"Armour
,Weapon
,Trapping
andContainer
type items to extend onEquippableItemModel
ActorSheetWfrp4e#_onItemToggle()
method to work with any and all Equippable itemsActorWfrp4e#equipPointsUsed
getter to count all Equippable items depending on their specific handling of "equipPoints".Phase 2 (to-do)