mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
.
This commit is contained in:
parent
d6049ed230
commit
50255b8cda
1 changed files with 20 additions and 16 deletions
|
|
@ -88,28 +88,32 @@ export default class DhSettingsActionView extends HandlebarsApplicationMixin(App
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectActionType() {
|
async selectActionType() {
|
||||||
(await foundry.applications.api.DialogV2.input({
|
return (
|
||||||
window: { title: game.i18n.localize('DAGGERHEART.CONFIG.SelectAction.selectType') },
|
(await foundry.applications.api.DialogV2.input({
|
||||||
content: await foundry.applications.handlebars.renderTemplate(
|
window: { title: game.i18n.localize('DAGGERHEART.CONFIG.SelectAction.selectType') },
|
||||||
'systems/daggerheart/templates/actionTypes/actionType.hbs',
|
content: await foundry.applications.handlebars.renderTemplate(
|
||||||
{ types: CONFIG.DH.ACTIONS.actionTypes }
|
'systems/daggerheart/templates/actionTypes/actionType.hbs',
|
||||||
),
|
{ types: CONFIG.DH.ACTIONS.actionTypes }
|
||||||
ok: {
|
),
|
||||||
label: game.i18n.format('DOCUMENT.Create', {
|
ok: {
|
||||||
type: game.i18n.localize('DAGGERHEART.GENERAL.Action.single')
|
label: game.i18n.format('DOCUMENT.Create', {
|
||||||
})
|
type: game.i18n.localize('DAGGERHEART.GENERAL.Action.single')
|
||||||
}
|
})
|
||||||
})) ?? {};
|
}
|
||||||
|
})) ?? {}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async addItem() {
|
static async addItem() {
|
||||||
const actionType = await this.selectActionType();
|
const { type: actionType } = await this.selectActionType();
|
||||||
const cls = actionsTypes[actionType?.type] ?? actionsTypes.attack,
|
if (!actionType) return;
|
||||||
|
|
||||||
|
const cls = actionsTypes[actionType] ?? actionsTypes.attack,
|
||||||
action = new cls(
|
action = new cls(
|
||||||
{
|
{
|
||||||
_id: foundry.utils.randomID(),
|
_id: foundry.utils.randomID(),
|
||||||
type: actionType.type,
|
type: actionType,
|
||||||
name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType.type].name),
|
name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType].name),
|
||||||
img: 'icons/magic/life/cross-worn-green.webp',
|
img: 'icons/magic/life/cross-worn-green.webp',
|
||||||
actionType: 'action',
|
actionType: 'action',
|
||||||
systemPath: this.actionsPath
|
systemPath: this.actionsPath
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue