Merged with main

This commit is contained in:
WBHarry 2025-07-25 01:14:41 +02:00
commit f0a809266d
70 changed files with 1245 additions and 881 deletions

View file

@ -47,13 +47,13 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
element.addEventListener('click', this.onToggleTargets)
);
html.querySelectorAll('.ability-use-button').forEach(element =>
element.addEventListener('click', event => this.abilityUseButton(this, event, data.message))
element.addEventListener('click', event => this.abilityUseButton(event, data.message))
);
html.querySelectorAll('.action-use-button').forEach(element =>
element.addEventListener('click', event => this.actionUseButton(this, event, data.message))
element.addEventListener('click', event => this.actionUseButton(event, data.message))
);
html.querySelectorAll('.reroll-button').forEach(element =>
element.addEventListener('click', event => this.rerollEvent(this, event, data.message))
element.addEventListener('click', event => this.rerollEvent(event, data.message))
);
};
@ -77,7 +77,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
? actor.system.attack
: item.system.attack?._id === actionId
? item.system.attack
: item?.system?.actions?.find(a => a._id === actionId);
: item?.system?.actions?.get(actionId);
return action;
}
@ -254,7 +254,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
const action = message.system.actions[Number.parseInt(event.currentTarget.dataset.index)];
const actor = game.actors.get(message.system.source.actor);
await actor.useAction(action);
await actor.use(action);
}
async actionUseButton(event, message) {
@ -271,6 +271,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
}
async rerollEvent(event, message) {
event.stopPropagation();
if (!event.shiftKey) {
const confirmed = await foundry.applications.api.DialogV2.confirm({
window: {
@ -287,6 +288,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
game.system.api.dice[
message.type === 'dualityRoll' ? 'DualityRoll' : target.dataset.type === 'damage' ? 'DHRoll' : 'D20Roll'
];
if (!game.modules.get('dice-so-nice')?.active) foundry.audio.AudioHelper.play({ src: CONFIG.sounds.dice });
const { newRoll, parsedRoll } = await rollClass.reroll(originalRoll_parsed, target, message);
await game.messages.get(message._id).update({

View file

@ -30,7 +30,7 @@ export default class DhHotbar extends foundry.applications.ui.Hotbar {
});
}
const action = item.system.actions.find(x => x.id === actionId);
const action = item.system.actions.get(actionId);
if (!action) {
return ui.notifications.warn('DAGGERHEART.UI.Notifications.actionIsMissing');
}