mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Feature/201 new roll type (#218)
* Action Roll DiceSet type * Fix * Remove console log * Tmp fix for non consistent resource * fix
This commit is contained in:
parent
22bf348c12
commit
19cc10a3c9
19 changed files with 283 additions and 156 deletions
|
|
@ -1,9 +1,10 @@
|
|||
const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api;
|
||||
|
||||
export default class DamageDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||
constructor(config={}, options={}) {
|
||||
constructor(roll, config={}, options={}) {
|
||||
super(options);
|
||||
|
||||
this.roll = roll;
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
|
|
@ -36,7 +37,7 @@ export default class DamageDialog extends HandlebarsApplicationMixin(Application
|
|||
async _prepareContext(_options) {
|
||||
const context = await super._prepareContext(_options);
|
||||
context.title = this.config.title;
|
||||
context.formula = this.config.formula;
|
||||
context.formula = this.config.roll.formula;
|
||||
return context;
|
||||
}
|
||||
|
||||
|
|
@ -49,9 +50,9 @@ export default class DamageDialog extends HandlebarsApplicationMixin(Application
|
|||
if ( !options.submitted ) this.config = false;
|
||||
}
|
||||
|
||||
static async configure(config={}) {
|
||||
static async configure(roll, config={}) {
|
||||
return new Promise(resolve => {
|
||||
const app = new this(config);
|
||||
const app = new this(roll, config);
|
||||
app.addEventListener("close", () => resolve(app.config), { once: true });
|
||||
app.render({ force: true });
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue