add changelog

This commit is contained in:
2023-11-20 21:53:35 -06:00
parent 3996687ad5
commit de690b1451
2 changed files with 30 additions and 2 deletions
+19 -2
View File
@@ -1,3 +1,5 @@
const requestRollFromTokens = game.modules.get('swade-mb-helpers').api.requestRollFromTokens
async function main () {
let tokens = Array.from(game.user.targets)
if (tokens.length < 1) {
@@ -29,7 +31,7 @@ async function main () {
}
for (const attribute of ['Agility', 'Smarts', 'Spirit', 'Strength', 'Vigor']) {
menuData.inputs[1].options.push(
{ html: `Attribute | ${attribute}`, value: `a|${attribute.toLowerCase()}` }
{ html: `Attribute | ${attribute}`, value: `a|${attribute}` }
)
}
const skillSet = new Set()
@@ -42,12 +44,27 @@ async function main () {
}
for (const skill of Array.from(skillSet).sort()) {
menuData.inputs[1].options.push(
{ html: `Skill | ${skill}`, value: `s|${skill.toLowerCase()}` })
{ html: `Skill | ${skill}`, value: `s|${skill}` })
}
menuData.inputs[1].options.push(
{ html: 'Skill | Untrained', value: 's|NOSKILL' })
const result = await warpgate.menu(menuData, menuConfig)
if (result.buttons !== 'ok') {
return
}
console.log(result)
const rollMod = result.inputs[2]
const rollModDesc = result.inputs[3]
const rollParts = result.inputs[1].split('|')
const rollType = (rollParts[0] === 'a' ? 'attribute' : 'skill')
const rollDesc = rollParts[1]
const options = {}
if (rollMod !== 0) {
options.mods = [{ label: rollModDesc, value: rollMod }]
}
requestRollFromTokens(tokens, rollType, rollDesc, options)
}
main()