mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-09 06:08:10 +02:00
Restructured all the files
This commit is contained in:
parent
099a4576da
commit
ba3157a2fc
180 changed files with 722 additions and 1730 deletions
18
module/canvas/placeables/ruler.mjs
Normal file
18
module/canvas/placeables/ruler.mjs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import DhMeasuredTemplate from '../placeables/measuredTemplate.mjs';
|
||||
|
||||
export default class DhpRuler extends foundry.canvas.interaction.Ruler {
|
||||
_getWaypointLabelContext(waypoint, state) {
|
||||
const context = super._getWaypointLabelContext(waypoint, state);
|
||||
if (!context) return;
|
||||
|
||||
const range = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.RangeMeasurement);
|
||||
|
||||
if (range.enabled) {
|
||||
const distance = DhMeasuredTemplate.getDistanceLabel(waypoint.measurement.distance.toNearest(0.01), range);
|
||||
context.cost = { total: distance, units: null };
|
||||
context.distance = { total: distance, units: null };
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue