add changelog

This commit is contained in:
Mike Bloy 2023-11-20 21:53:35 -06:00
parent 3996687ad5
commit de690b1451
2 changed files with 30 additions and 2 deletions

View File

@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Added
- Power Effect for Havoc
- Power Effect Macro for Havoc
- Power Effect Action for Havoc
- New Macro: Request Roll
- NEW DEPENDENCY: socketlib
- Documentation:
- API Documentation
- Request Roll macro documentation
## 2.1.0 ## 2.1.0
### Changed ### Changed

View File

@ -1,3 +1,5 @@
const requestRollFromTokens = game.modules.get('swade-mb-helpers').api.requestRollFromTokens
async function main () { async function main () {
let tokens = Array.from(game.user.targets) let tokens = Array.from(game.user.targets)
if (tokens.length < 1) { if (tokens.length < 1) {
@ -29,7 +31,7 @@ async function main () {
} }
for (const attribute of ['Agility', 'Smarts', 'Spirit', 'Strength', 'Vigor']) { for (const attribute of ['Agility', 'Smarts', 'Spirit', 'Strength', 'Vigor']) {
menuData.inputs[1].options.push( menuData.inputs[1].options.push(
{ html: `Attribute | ${attribute}`, value: `a|${attribute.toLowerCase()}` } { html: `Attribute | ${attribute}`, value: `a|${attribute}` }
) )
} }
const skillSet = new Set() const skillSet = new Set()
@ -42,12 +44,27 @@ async function main () {
} }
for (const skill of Array.from(skillSet).sort()) { for (const skill of Array.from(skillSet).sort()) {
menuData.inputs[1].options.push( menuData.inputs[1].options.push(
{ html: `Skill | ${skill}`, value: `s|${skill.toLowerCase()}` }) { html: `Skill | ${skill}`, value: `s|${skill}` })
} }
menuData.inputs[1].options.push( menuData.inputs[1].options.push(
{ html: 'Skill | Untrained', value: 's|NOSKILL' }) { html: 'Skill | Untrained', value: 's|NOSKILL' })
const result = await warpgate.menu(menuData, menuConfig) const result = await warpgate.menu(menuData, menuConfig)
if (result.buttons !== 'ok') {
return
}
console.log(result) 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() main()