new Dialog({ title: 'Damage Roll Configuration', content: `
`, buttons: { ok: { label: 'Roll Damage', callback: (html) => { const damageRoll = html.find('input[name="damageRoll"]').val() let flavor = html.find('input[name="flavor"]').val() const ap = parseInt(html.find('input[name="ap"]').val()) || 0 const options = {} if (ap > 0) { flavor = `${flavor ? flavor + ' - ' : ''}AP: ${ap}` options.ap = ap } // Perform the damage roll and send the message new CONFIG.Dice.DamageRoll(damageRoll, null, options).toMessage({ flavor }) } }, cancel: { label: 'Cancel' } } }).render(true)