mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Task/415 action refactor part 2 (#1094)
This commit is contained in:
parent
8e5dd22370
commit
1eb3ff11c0
47 changed files with 1244 additions and 641 deletions
|
|
@ -2,15 +2,4 @@ import DHBaseAction from './baseAction.mjs';
|
|||
|
||||
export default class DHMacroAction extends DHBaseAction {
|
||||
static extraSchemas = [...super.extraSchemas, 'macro'];
|
||||
|
||||
async trigger(event, ...args) {
|
||||
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.macro}.`);
|
||||
macro.execute();
|
||||
} catch (error) {
|
||||
ui.notifications.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue