mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
47 lines
No EOL
1.3 KiB
JavaScript
47 lines
No EOL
1.3 KiB
JavaScript
const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api;
|
|
|
|
export default class DamageDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
|
constructor(config={}, options={}) {
|
|
super(options);
|
|
|
|
this.config = config;
|
|
}
|
|
|
|
static DEFAULT_OPTIONS = {
|
|
tag: 'form',
|
|
id: 'roll-selection',
|
|
classes: ['daggerheart', 'views', 'damage-selection'],
|
|
position: {
|
|
width: 400,
|
|
height: 'auto'
|
|
},
|
|
actions: {},
|
|
form: {
|
|
handler: this.updateRollConfiguration,
|
|
submitOnChange: true,
|
|
submitOnClose: false
|
|
}
|
|
};
|
|
|
|
/** @override */
|
|
static PARTS = {
|
|
damageSelection: {
|
|
id: 'damageSelection',
|
|
template: 'systems/daggerheart/templates/views/damageSelection.hbs'
|
|
}
|
|
};
|
|
|
|
async _prepareContext(_options) {
|
|
const context = await super._prepareContext(_options);
|
|
context.formula = this.config.formula;
|
|
return context;
|
|
}
|
|
|
|
static async configure(config={}) {
|
|
return new Promise(resolve => {
|
|
const app = new this(config);
|
|
app.addEventListener("close", () => resolve(app.config), { once: true });
|
|
app.render({ force: true });
|
|
});
|
|
}
|
|
} |