This commit is contained in:
WBHarry 2025-07-21 21:21:57 +02:00
parent d6049ed230
commit 50255b8cda

View file

@ -88,6 +88,7 @@ export default class DhSettingsActionView extends HandlebarsApplicationMixin(App
}
async selectActionType() {
return (
(await foundry.applications.api.DialogV2.input({
window: { title: game.i18n.localize('DAGGERHEART.CONFIG.SelectAction.selectType') },
content: await foundry.applications.handlebars.renderTemplate(
@ -99,17 +100,20 @@ export default class DhSettingsActionView extends HandlebarsApplicationMixin(App
type: game.i18n.localize('DAGGERHEART.GENERAL.Action.single')
})
}
})) ?? {};
})) ?? {}
);
}
static async addItem() {
const actionType = await this.selectActionType();
const cls = actionsTypes[actionType?.type] ?? actionsTypes.attack,
const { type: actionType } = await this.selectActionType();
if (!actionType) return;
const cls = actionsTypes[actionType] ?? actionsTypes.attack,
action = new cls(
{
_id: foundry.utils.randomID(),
type: actionType.type,
name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType.type].name),
type: actionType,
name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType].name),
img: 'icons/magic/life/cross-worn-green.webp',
actionType: 'action',
systemPath: this.actionsPath