Skip to content

Commit

Permalink
Added Jitter Setting
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Aug 7, 2023
1 parent d14e20e commit 864170e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"name": "% offset from top of token",
"hint": "Offset percentage from top of token, input as whole number (IE. 70 is 70%)"
},
"jitter": {
"name": "Jitter",
"hint": "How much the text will move around its spawn point (0 = doesn't move, 1 is it could spawn on the edges of the token)"
},
"number-scale-type": {
"name": "Number Scale Type",
"hint": "Scaling type for the size of the RPG Numbers",
Expand Down
12 changes: 11 additions & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@
"verified": "5.3.0"
}
}
]
],
"requires": [
{
"id": "sequencer",
"type": "module",
"compatibility": {
"minimum": "3.0.0",
"verified": "3.1.2"
}
}
]
},
"esmodules": [
"scripts/module.js",
Expand Down
3 changes: 2 additions & 1 deletion scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function generateDamageScroll(dmg_list, targets) {
const size = tok.document.texture.scaleY * tok.document.width;
const topOffset = size * (game.settings.get("pf2e-rpg-numbers", 'top-offset') / 100);
const fontSize = game.settings.get("pf2e-rpg-numbers", 'font-size');
const jitter = game.settings.get("pf2e-rpg-numbers", 'jitter');
const colors = {
acid: "0x56fc03",
bludgeoning: "0xc7c7c7",
Expand Down Expand Up @@ -78,7 +79,7 @@ export function generateDamageScroll(dmg_list, targets) {
seq.scrollingText()
.atLocation(tok, { offset: { y: topOffset }, gridUnits: true })
.text(`${dmg.value}`, style)
.jitter(1)
.jitter(jitter)
.anchor("TOP")
.waitUntilFinished(-1800)
}
Expand Down

0 comments on commit 864170e

Please sign in to comment.