You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is some duplicated logic between the two, and it is not clear which of them is ultimately responsible for configuring the resulting item use data. The proposed changes are as follows:
Refactor construction of the ItemUseConfiguration to a centralised location so that there is a single authoritative source for this logic, and it can be shared.
Item5e#use will use this method determine what the default configuration should be, and this can be overridden via the config parameter, or via the dnd5e.preUseItem hook.
AbilityUseDialog.create will use this method determine what values it needs to prompt the user for.
Refactor ability-use.hbs to allow for the checked states and default drop-down selections to be passed in via template data.
Item5e#use should pass its ItemUseConfiguration to AbilityUseDialog.create. This configuration will be used to determine the default state of the prompts that AbilityUseDialog will display to the user, per the changes to the template above.
When the user makes their final choices in AbilityUseDialog, this is fed back to Item5e#use, which updates the final ItemUseConfiguration.
Even though AbilityUseDialog.create is only ever called by Item5e#use within the system, it is public API so the change in behaviour here should be considered breaking.
There is some duplicated logic between the two, and it is not clear which of them is ultimately responsible for configuring the resulting item use data. The proposed changes are as follows:
ItemUseConfiguration
to a centralised location so that there is a single authoritative source for this logic, and it can be shared.Item5e#use
will use this method determine what the default configuration should be, and this can be overridden via theconfig
parameter, or via thednd5e.preUseItem
hook.AbilityUseDialog.create
will use this method determine what values it needs to prompt the user for.ability-use.hbs
to allow for the checked states and default drop-down selections to be passed in via template data.Item5e#use
should pass itsItemUseConfiguration
toAbilityUseDialog.create
. This configuration will be used to determine the default state of the prompts thatAbilityUseDialog
will display to the user, per the changes to the template above.AbilityUseDialog
, this is fed back toItem5e#use
, which updates the finalItemUseConfiguration
.Related:
Item#hasLimitedUses
being false, the charges still appear on the character sheet #2288The text was updated successfully, but these errors were encountered: