[Feature] Reload Check#2051
Conversation
…actions button footer style
| if (!item || !item.system.resource?.max) | ||
| return; | ||
|
|
||
| await item.update({ 'system.resource.value': |
There was a problem hiding this comment.
I saw this come up in the damage roll code, but same line key in an object always seems a bit odd to me.
There was a problem hiding this comment.
Yah, it's not ideal, changed it.
Think I've done it a few times when I dislike how the line length limit forces things to be formated.
| export const reloadChoices = { | ||
| off: { | ||
| id: 'off', | ||
| label: 'Don\'t Use' |
There was a problem hiding this comment.
needs to be localized. Guessing these are settings?
| } | ||
|
|
||
| const needsToReload = true; | ||
| // const needsToReload = roll.total === 1; |
There was a problem hiding this comment.
what's happening here? Testing stuff?
There was a problem hiding this comment.
Yeah, annoying to try and get a 1 on a d6 to test it, so it's hardcoded until we're ready to merge 😆
| hasEffect: new fields.BooleanField({ initial: false }), | ||
| hasSave: new fields.BooleanField({ initial: false }), | ||
| hasTarget: new fields.BooleanField({ initial: false }), | ||
| needReload: new fields.BooleanField({ initial: false }), |
There was a problem hiding this comment.
should probably be "needsReload" to match the weapons getter. Or vice versa!
There was a problem hiding this comment.
Good catch, corrected to needsReload for consistance 👍
| speaker: cls.getSpeaker({ actor: roll.data?.parent }), | ||
| sound: config.mute ? null : CONFIG.sounds.dice, | ||
| system: { ...config, actionDescription }, | ||
| system: { ...config, actionDescription, needReload }, |
There was a problem hiding this comment.
does this needReload need to be needsReload as well, or separate?
There was a problem hiding this comment.
Dang it. Yup, import change there. ⭐
Fixed, and searched the project so there's no more remaining instances of needReoad

Added support for reload rules. The automation settings has a setting for how it's done. Either
Noneso we do nothing,buttonso that we display a button for the roll in the chat message orautoso that it's immediately rolled upon doing the attack.For easy testing it's currently set to always count as needing a reload regardless of the dice roll
The actual visual in the chat message could definately be improved. Currently:

Auto
Button
