mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
.
This commit is contained in:
parent
36eac51041
commit
8881f14153
8 changed files with 84 additions and 13 deletions
|
|
@ -15,7 +15,7 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
|
|||
|
||||
static DEFAULT_OPTIONS = {
|
||||
tag: 'form',
|
||||
classes: ['daggerheart', 'dh-style', 'dialog', 'max-800'],
|
||||
classes: ['daggerheart', 'dh-style', 'action-config', 'dialog', 'max-800'],
|
||||
window: {
|
||||
icon: 'fa-solid fa-wrench',
|
||||
resizable: false
|
||||
|
|
@ -126,6 +126,10 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
|
|||
context.baseAttackBonus = this.action.actor?.system.attack?.roll.bonus;
|
||||
context.hasRoll = this.action.hasRoll;
|
||||
context.triggerOptions = CONFIG.DH.TRIGGER.triggers;
|
||||
context.triggers = context.source.triggers.map(trigger => ({
|
||||
...trigger,
|
||||
hint: CONFIG.DH.TRIGGER.triggers[trigger.trigger].hint
|
||||
}));
|
||||
|
||||
const settingsTiers = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers).tiers;
|
||||
context.tierOptions = [
|
||||
|
|
@ -245,7 +249,19 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
|
|||
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
||||
}
|
||||
|
||||
static removeTrigger(_event, button) {
|
||||
static async removeTrigger(_event, button) {
|
||||
const trigger = CONFIG.DH.TRIGGER.triggers[this.action.triggers[button.dataset.index].trigger];
|
||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||
window: {
|
||||
title: game.i18n.localize('DAGGERHEART.ACTIONS.Config.deleteTriggerTitle')
|
||||
},
|
||||
content: game.i18n.format('DAGGERHEART.ACTIONS.Config.deleteTriggerContent', {
|
||||
trigger: game.i18n.localize(trigger.label)
|
||||
})
|
||||
});
|
||||
|
||||
if (!confirmed) return;
|
||||
|
||||
const data = this.action.toObject();
|
||||
data.triggers = data.triggers.filter((_, index) => index !== Number.parseInt(button.dataset.index));
|
||||
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue