mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Fix/857 generic roll buttons (#866)
* Action Macro working again * Remove buttons from generic roll for non-gm
This commit is contained in:
parent
e90355b08b
commit
f62e51c4f6
11 changed files with 27 additions and 69 deletions
|
|
@ -1,19 +1,13 @@
|
|||
import DHBaseAction from './baseAction.mjs';
|
||||
|
||||
export default class DHMacroAction extends DHBaseAction {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
...super.defineSchema(),
|
||||
documentUUID: new fields.DocumentUUIDField({ type: 'Macro' })
|
||||
};
|
||||
}
|
||||
static extraSchemas = [...super.extraSchemas, 'macro'];
|
||||
|
||||
async trigger(event, ...args) {
|
||||
const fixUUID = !this.documentUUID.includes('Macro.') ? `Macro.${this.documentUUID}` : this.documentUUID,
|
||||
const fixUUID = !this.macro.includes('Macro.') ? `Macro.${this.macro}` : this.macro,
|
||||
macro = await fromUuid(fixUUID);
|
||||
try {
|
||||
if (!macro) throw new Error(`No macro found for the UUID: ${this.documentUUID}.`);
|
||||
if (!macro) throw new Error(`No macro found for the UUID: ${this.macro}.`);
|
||||
macro.execute();
|
||||
} catch (error) {
|
||||
ui.notifications.error(error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue