Fixed SelectActionType dialog

This commit is contained in:
WBHarry 2025-07-21 21:19:08 +02:00
parent c3d71f0c39
commit d6049ed230
2 changed files with 10 additions and 18 deletions

View file

@ -88,26 +88,18 @@ export default class DhSettingsActionView extends HandlebarsApplicationMixin(App
} }
async selectActionType() { async selectActionType() {
const content = await foundry.applications.handlebars.renderTemplate( (await foundry.applications.api.DialogV2.input({
window: { title: game.i18n.localize('DAGGERHEART.CONFIG.SelectAction.selectType') },
content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/actionTypes/actionType.hbs', 'systems/daggerheart/templates/actionTypes/actionType.hbs',
{ types: CONFIG.DH.ACTIONS.actionTypes } { types: CONFIG.DH.ACTIONS.actionTypes }
), ),
title = 'Select Action Type', ok: {
type = 'form', label: game.i18n.format('DOCUMENT.Create', {
data = {}; type: game.i18n.localize('DAGGERHEART.GENERAL.Action.single')
return Dialog.prompt({ })
title, }
label: title, })) ?? {};
content,
type,
callback: html => {
const form = html[0].querySelector('form'),
fd = new foundry.applications.ux.FormDataExtended(form);
foundry.utils.mergeObject(data, fd.object, { inplace: true });
return data;
},
rejectClose: false
});
} }
static async addItem() { static async addItem() {

View file

@ -440,7 +440,7 @@ export default function DHApplicationMixin(Base) {
if (type === 'action') { if (type === 'action') {
const { type: actionType } = const { type: actionType } =
(await foundry.applications.api.DialogV2.input({ (await foundry.applications.api.DialogV2.input({
window: { title: 'Select Action Type' }, window: { title: game.i18n.localize('DAGGERHEART.CONFIG.SelectAction.selectType') },
content: await foundry.applications.handlebars.renderTemplate( content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/actionTypes/actionType.hbs', 'systems/daggerheart/templates/actionTypes/actionType.hbs',
{ types: CONFIG.DH.ACTIONS.actionTypes } { types: CONFIG.DH.ACTIONS.actionTypes }