mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 10:29:54 +02:00
Changed to storing the reloadCheckValue. It's included in notification feedback
This commit is contained in:
parent
cb0d22a9a0
commit
b345db4f05
6 changed files with 38 additions and 13 deletions
|
|
@ -139,7 +139,14 @@ export default class DHRoll extends BaseRoll {
|
|||
item?.system.hasReload &&
|
||||
action?.type === 'attack' &&
|
||||
reloadSetting === CONFIG.DH.SETTINGS.reloadChoices.auto.id;
|
||||
const needsReload = useReload ? await action?.handleReload?.() : false;
|
||||
const reloadResult = useReload ? await action?.handleReload?.() : {};
|
||||
|
||||
if (useReload) {
|
||||
if (reloadResult.needsReload)
|
||||
ui.notifications.info(_loc('DAGGERHEART.UI.Notifications.reloadRequiredRollResponse', { roll: reloadResult.rollValue }));
|
||||
else
|
||||
ui.notifications.info(_loc('DAGGERHEART.UI.Notifications.noReloadRequiredRollResponse', { roll: reloadResult.rollValue }));
|
||||
}
|
||||
|
||||
const cls = getDocumentClass('ChatMessage'),
|
||||
msgData = {
|
||||
|
|
@ -148,7 +155,11 @@ export default class DHRoll extends BaseRoll {
|
|||
title: roll.title,
|
||||
speaker: cls.getSpeaker({ actor: roll.data?.parent }),
|
||||
sound: config.mute ? null : CONFIG.sounds.dice,
|
||||
system: { ...config, actionDescription, needsReload },
|
||||
system: {
|
||||
...config,
|
||||
actionDescription,
|
||||
reloadCheckValue: reloadResult.rollValue
|
||||
},
|
||||
rolls: [roll]
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue