mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
[Fix] ChatMessage Saves Pending Confirmation (#1963)
This commit is contained in:
parent
df4a2c5d57
commit
bcf274f1d0
2 changed files with 25 additions and 5 deletions
|
|
@ -711,9 +711,9 @@
|
||||||
},
|
},
|
||||||
"PendingReactionsDialog": {
|
"PendingReactionsDialog": {
|
||||||
"title": "Pending Reaction Rolls Found",
|
"title": "Pending Reaction Rolls Found",
|
||||||
"unfinishedRolls": "Some Tokens still need to roll their Reaction Roll.",
|
"unfinishedRolls": "Some Tokens have not finished their Reaction Rolls.",
|
||||||
"confirmation": "Are you sure you want to continue ?",
|
"warning": "Unfinished reaction rolls will be considered as failed.",
|
||||||
"warning": "Undone reaction rolls will be considered as failed"
|
"confirmation": "Are you sure you want to continue?"
|
||||||
},
|
},
|
||||||
"ReactionRoll": {
|
"ReactionRoll": {
|
||||||
"title": "Reaction Roll: {trait}"
|
"title": "Reaction Roll: {trait}"
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,11 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
if (pendingingSaves.length) {
|
if (pendingingSaves.length) {
|
||||||
const confirm = await foundry.applications.api.DialogV2.confirm({
|
const confirm = await foundry.applications.api.DialogV2.confirm({
|
||||||
window: { title: game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.title') },
|
window: { title: game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.title') },
|
||||||
content: `<p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.unfinishedRolls')}</p><p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.confirmation')}</p><p><i>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.warning')}</i></p>`
|
content: `
|
||||||
|
<p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.unfinishedRolls')}</p>
|
||||||
|
<p><i>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.warning')}</i></p>
|
||||||
|
<p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.confirmation')}</p>
|
||||||
|
`
|
||||||
});
|
});
|
||||||
if (!confirm) return;
|
if (!confirm) return;
|
||||||
}
|
}
|
||||||
|
|
@ -247,8 +251,24 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
const targets = this.filterPermTargets(this.system.hitTargets),
|
const targets = this.filterPermTargets(this.system.hitTargets),
|
||||||
config = foundry.utils.deepClone(this.system);
|
config = foundry.utils.deepClone(this.system);
|
||||||
config.event = event;
|
config.event = event;
|
||||||
|
|
||||||
if (targets.length === 0)
|
if (targets.length === 0)
|
||||||
ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelectedOrPerm'));
|
return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelectedOrPerm'));
|
||||||
|
else if (config.hasSave) {
|
||||||
|
const pendingingSaves = targets.filter(t => t.saved.success === null);
|
||||||
|
if (pendingingSaves.length) {
|
||||||
|
const confirm = await foundry.applications.api.DialogV2.confirm({
|
||||||
|
window: { title: game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.title') },
|
||||||
|
content: `
|
||||||
|
<p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.unfinishedRolls')}</p>
|
||||||
|
<p><i>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.warning')}</i></p>
|
||||||
|
<p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.confirmation')}</p>
|
||||||
|
`
|
||||||
|
});
|
||||||
|
if (!confirm) return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.consumeOnSuccess();
|
this.consumeOnSuccess();
|
||||||
this.system.action?.workflow.get('effects')?.execute(config, targets, true);
|
this.system.action?.workflow.get('effects')?.execute(config, targets, true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue