Lancer de sorts V2
This commit is contained in:
@@ -173,6 +173,8 @@ const ROLL_PARTS = [
|
||||
/* -------------------------------------------- */
|
||||
export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2)
|
||||
{
|
||||
static onCloseDoNothing() {
|
||||
}
|
||||
static onRollDoneDoNothing(dialog) {
|
||||
dialog.render()
|
||||
}
|
||||
@@ -181,7 +183,6 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
dialog.close()
|
||||
}
|
||||
|
||||
|
||||
static init() {
|
||||
}
|
||||
|
||||
@@ -236,6 +237,7 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
static async create(rollData, rollOptions = {}) {
|
||||
const rollDialog = new RollDialog(rollData, rollOptions)
|
||||
rollDialog.render(true)
|
||||
return rollDialog
|
||||
}
|
||||
|
||||
static get PARTS() {
|
||||
@@ -322,7 +324,8 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
...(rollOptions.callbacks ?? [])
|
||||
],
|
||||
customChatMessage: rollOptions.customChatMessage,
|
||||
onRollDone: rollOptions.onRollDone ?? RollDialog.onRollDoneDoNothing
|
||||
onRollDone: rollOptions.onRollDone ?? RollDialog.onRollDoneDoNothing,
|
||||
onClose: rollOptions.onClose ?? RollDialog.onCloseDoNothing
|
||||
}
|
||||
this.chatRollResult = new ChatRollResult();
|
||||
this.selectType()
|
||||
@@ -440,6 +443,13 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
return ALL_ROLL_TYPES.find(m => m.code == this.rollData.type.current)
|
||||
}
|
||||
|
||||
async close(options){
|
||||
if (this.rollOptions.onClose){
|
||||
this.rollOptions.onClose()
|
||||
}
|
||||
return await super.close(options)
|
||||
}
|
||||
|
||||
async roll() {
|
||||
|
||||
const roll = RollDialog.saveParts(this.rollData)
|
||||
|
Reference in New Issue
Block a user