Open JPMeehan opened 1 year ago
It seems I might need to do this as my own PR
For the attribute bars
TokenDocument5e._getTrackedAttributesFromSchema
getTrackedAttributes()
can call to insert extra bars or static properties. The obvious question is what's the label; having the full flags.module-id
seems unwieldy, so I think modules should have to provide their own labels?Sample typedef for the registration
/**
* @typedef {object} RegisteredAttributeFlag
* @param {boolean} isBar - Bar or Single Value
* @param {string} label - Unlocalized label that gets run through preLocalize
* @param {string} attribute - The full attribute path under `flags` - `["module-id"].myProp`
* If `isBar` is true, myProp is an object with a `value` and `max` field
* If `isBar` is false, myProp is numeric
*/
The consumable resources are a related issue; I'm unsure if I should stick them in the existing Attributes space or add a new entry to CONFIG.DND5E.abilityConsumptionTypes
; the latter is already doable on a module end and would mostly just exist to standardize the display but otherwise not add much.
- I think the "fix" is that there needs to be a CONFIG registration that
getTrackedAttributes()
can call to insert extra bars or static properties.
This is exists as CONFIG.Actor.trackableAttributes
, and we do use it in the dnd5e system. See here for information on the core API.
Reviving this in the wake of 3.0's deprecation of resources
Right now, the item-oriented resource tracking works well for resources that are scaled to a specific class or are a function of level (e.g. something that's usable 2x proficiency). It is NOT useful for something that has scaling that interacts with multiclassing, such as Spell Points or some third party psionics systems that have Psi Points or other such systems.
It would be useful if there was a way to have that kind of information provided to items that would be pulling from those pools as well as have it tracked on a token bar.
Hmm, looking I do see that flags
are included in roll data. That does offer an option for making it show on the resource bar at least by setting up an item and having its max uses tied to @flags.moduleID...
, although that still leaves some complications with "upcasting"
As a module developer, I would like to be able to add module-defined consumable attributes (e.g. Power Points) as consumable resources for actions and resource bars.
Currently, everything is assumed to be a property of
system
; I would appreciate handling that changes the context if an attribute starts withflags