mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
Corrected downtime buttons and actions
This commit is contained in:
parent
4b82169fbf
commit
82be5ecd0d
4 changed files with 35 additions and 21 deletions
|
|
@ -297,15 +297,16 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
|||
await actor.useAction(action);
|
||||
};
|
||||
|
||||
actionUseButton = async (_, message) => {
|
||||
actionUseButton = async (event, message) => {
|
||||
const { moveIndex, actionIndex } = event.currentTarget.dataset;
|
||||
const parent = await foundry.utils.fromUuid(message.system.actor);
|
||||
const actionType = Object.values(message.system.moves)[0].actions[0];
|
||||
const cls = CONFIG.DH.ACTIONS.actionTypes[actionType.type];
|
||||
const actionType = message.system.moves[moveIndex].actions[actionIndex];
|
||||
const cls = game.system.api.models.actions.actionsTypes[actionType.type];
|
||||
const action = new cls(
|
||||
{ ...actionType, _id: foundry.utils.randomID(), name: game.i18n.localize(actionType.name) },
|
||||
{ parent: parent }
|
||||
{ parent: parent.system }
|
||||
);
|
||||
|
||||
action.use();
|
||||
action.use(event);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue