forked from crnormand/gurps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
speed-provider.js
28 lines (26 loc) · 892 Bytes
/
speed-provider.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
export const init = function () {
//Add support for the Drag Ruler module: https://foundryvtt.com/packages/drag-ruler
Hooks.once('dragRuler.ready', SpeedProvider => {
class GURPSSpeedProvider extends SpeedProvider {
get colors() {
return [
{ id: 'walk', default: 0x00ff00, name: 'GURPS.dragrulerWalk' },
{ id: 'sprint', default: 0xffff00, name: 'GURPS.dragrulerSprint' },
{ id: 'fly', default: 0xff8000, name: 'GURPS.dragrulerFly' },
]
}
/**
* @param {GurpsToken} token
*/
getRanges(token) {
const actordata = token.actor.data.data
const ranges = [
{ range: actordata.currentmove, color: 'walk' },
{ range: actordata.currentsprint, color: 'sprint' },
]
return ranges
}
}
dragRuler.registerSystem('gurps', GURPSSpeedProvider)
})
}