mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Action Roll DiceSet type
This commit is contained in:
parent
b25e1cec78
commit
4ffcd115e7
17 changed files with 256 additions and 134 deletions
|
|
@ -276,7 +276,8 @@ export default class DhpActor extends Actor {
|
|||
async diceRoll(config) {
|
||||
config.source = {...(config.source ?? {}), actor: this.uuid};
|
||||
config.data = this.getRollData();
|
||||
return await this.rollClass.build(config);
|
||||
const rollClass = config.roll.lite ? CONFIG.Dice.daggerheart['DHRoll'] : this.rollClass;
|
||||
return await rollClass.build(config);
|
||||
}
|
||||
|
||||
get rollClass() {
|
||||
|
|
|
|||
|
|
@ -104,20 +104,15 @@ export default class DhpItem extends Item {
|
|||
'systems/daggerheart/templates/views/actionSelect.hbs',
|
||||
{ actions: this.system.actions }
|
||||
),
|
||||
title = 'Select Action',
|
||||
type = 'div',
|
||||
data = {};
|
||||
return Dialog.prompt({
|
||||
title,
|
||||
// label: title,
|
||||
title = 'Select Action';
|
||||
|
||||
return foundry.applications.api.DialogV2.prompt({
|
||||
window: { title },
|
||||
content,
|
||||
type,
|
||||
callback: html => {
|
||||
const form = html[0].querySelector('form'),
|
||||
fd = new foundry.applications.ux.FormDataExtended(form);
|
||||
return this.system.actions.find(a => a._id === fd.object.actionId);
|
||||
},
|
||||
rejectClose: false
|
||||
ok: {
|
||||
label: title,
|
||||
callback: (event, button, dialog) => this.system.actions.find(a => a._id === button.form.elements.actionId.value)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue