mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 04:44:16 +02:00
Fixed Character base attack context menu
This commit is contained in:
parent
00e1c1181b
commit
f24bd23f1a
1 changed files with 45 additions and 0 deletions
|
|
@ -65,6 +65,14 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
fixed: true
|
fixed: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
handler: CharacterSheet.#getBaseAttackContextOptions,
|
||||||
|
selector: '[data-item-uuid][data-type="attack"]',
|
||||||
|
options: {
|
||||||
|
parentClassHooks: false,
|
||||||
|
fixed: true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
handler: CharacterSheet.#getDomainCardContextOptions,
|
handler: CharacterSheet.#getDomainCardContextOptions,
|
||||||
selector: '[data-item-uuid][data-type="domainCard"]',
|
selector: '[data-item-uuid][data-type="domainCard"]',
|
||||||
|
|
@ -380,6 +388,43 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the set of ContextMenu options for the base attack.
|
||||||
|
* @returns {import('@client/applications/ux/context-menu.mjs').ContextMenuEntry[]} - The Array of context options passed to the ContextMenu instance
|
||||||
|
* @this {CharacterSheet}
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
static #getBaseAttackContextOptions() {
|
||||||
|
/**@type {import('@client/applications/ux/context-menu.mjs').ContextMenuEntry[]} */
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'DAGGERHEART.CONFIG.RollTypes.attack.name',
|
||||||
|
icon: 'fa-solid fa-burst',
|
||||||
|
onClick: async (event, target) => (await getDocFromElement(target)).use(event)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'DAGGERHEART.GENERAL.damage',
|
||||||
|
icon: 'fa-solid fa-explosion',
|
||||||
|
onClick: async (event, target) => {
|
||||||
|
const doc = await getDocFromElement(target),
|
||||||
|
action = doc?.system?.attack ?? doc;
|
||||||
|
const config = action.prepareConfig(event);
|
||||||
|
config.effects = await game.system.api.data.actions.actionsTypes.base.getEffects(
|
||||||
|
this.document,
|
||||||
|
doc
|
||||||
|
);
|
||||||
|
config.hasRoll = false;
|
||||||
|
return action && action.workflow.get('damage').execute(config, null, true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'DAGGERHEART.APPLICATIONS.ContextMenu.sendToChat',
|
||||||
|
icon: 'fa-solid fa-message',
|
||||||
|
onClick: async (_, target) => (await getDocFromElement(target)).toChat(this.document.uuid)
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the set of ContextMenu options for DomainCards.
|
* Get the set of ContextMenu options for DomainCards.
|
||||||
* @returns {import('@client/applications/ux/context-menu.mjs').ContextMenuEntry[]} - The Array of context options passed to the ContextMenu instance
|
* @returns {import('@client/applications/ux/context-menu.mjs').ContextMenuEntry[]} - The Array of context options passed to the ContextMenu instance
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue