Changed to storing the reloadCheckValue. It's included in notification feedback

This commit is contained in:
WBHarry 2026-07-21 23:45:09 +02:00
parent cb0d22a9a0
commit b345db4f05
6 changed files with 38 additions and 13 deletions

View file

@ -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]
};