Releases: caewok/fvtt-elevation-ruler
Fix for speed highlighting
Fix for speed highlighting not working if the Token HUD has not been used. Closes #65.
Full Changelog: 0.8.11...0.8.12
Force to ground
New features
Add a keybinding ("g") to force the ruler to measure from ground terrain. Replaces "Prefer Token Elevation," which was removed. Closes #63, #64.
Bug fixes
Catch when a segment color is not defined, to avoid throwing an error.
Fix for incorrect combat speed movement highlighting after the first move. Closes #62.
Full Changelog: 0.8.10...0.8.11
Speed and Movement improvements
New features
Add indicator of past combat movement in the ruler.
Allow for unlimited number of speed categories, colors, along with custom speed functions in the CONFIG. Closes issue #58.
More aggressive path straightening using a reverse Ramer-Douglas-Peucker algorithm based on collision checking. Closes issue #48.
Add CONFIG settings to ignore tokens for pathfinding based on HP attribute or set of token statuses. Closes issue #55.
Add a keybind ("p") to temporarily toggle pathfinding.
Add rulerSegmentOrigin
and rulerSegmentDestination
to options passed to token update.
Bug fixes
Refactor physical and move distance measurement in anticipation of Foundry v12. Closes issue #59 (measurement near waypoints).
Refactor how segments are split for purposes of speed highlighting.
Fix for counting alternating diagonals across ruler segments/waypoints.
Fix for token stopping prematurely if the mouse is released after space bar pressed when using the Ruler.
Fix for "drunken token movement" in which a token would wander off the path when moving through several fake waypoints that were not centered on the grid.
Allow large tokens to move through triangle edge unless both vertices of the edge shares a blocking edge. This allows pathfinding to work for large tokens in more situations, while still not taking paths through narrow spaces constrained on both sides by walls.
BREAKING
Options for CONFIG.elevationruler.SPEED
have changed. To change the speed highlighting, you will need to change the array of speed categories in CONFIG.elevationruler.SPEED.CATEGORIES
. A speed category is defined as:
/**
* @typedef {object} SpeedCategory
*
* Object that stores the name, multiplier, and color of a given speed category.
* Custom properties are permitted. The SpeedCategory is passed to SPEED.maximumCategoryDistance,
* which in turn can be defined to use custom properties to calculate the maximum distance for the category.
*
* @prop {Color} color Color used with ruler highlighting
* @prop {string} name Unique name of the category (relative to other SpeedCategories)
* @prop {number} [multiplier] This times the token movement equals the distance for this category
*/
Full Changelog: 0.8.9...0.8.10
Combat movement history
New features
Track combat moves on a per-combat basis. Add settings toggle to have movement speed highlighting reflect sum of moves for that combat round.
Bug fixes
Fix errors thrown when using the ruler without a movement token with either Terrain Mapper or Elevated Vision modules active. Closes issue #51.
Display speed colors to other users who have the speed color setting enabled. Closes issue #53.
Add CONFIG options to set additional movement types to the token hud. Closes issue #50.
// Example: Add a swim movement to the api.
CONFIG.elevationruler.MOVEMENT_TYPES.SWIM = 3; // Increment by 1 from the highest-valued movement type
CONFIG.elevationruler.MOVEMENT_BUTTONS[CONFIG.elevationruler.MOVEMENT_TYPES.SWIM] = "person-swimming"; // From Font Awesome
CONFIG.elevationruler.SPEED.ATTRIBUTES.SWIM = "actor.system.attributes.movement.swim"; // dnd5e
Full Changelog: 0.8.8...0.8.9
Pathfinding improvements
Improvements to updating the scene graph. Avoid leaving unneeded vertices and split edges when a token or wall is removed. Fixes to handling overlapping edges to correctly reflect what objects make up the edge.
Update lib geometry to v0.2.18.
Full Changelog: 0.8.7...0.8.8
Pathfinding in the fog
New Features
GM can now set whether pathfinding should be limited for users to areas within the fog of war. FYI, testing fog of war in Foundry for canvas positions is a performance hit. Closes issue #47.
Bug fixes
Take the starting elevation of the path when testing whether tokens or walls block the path. Allows tokens or limited height walls to be ignored if no collision at the given elevation.
Fix for measuring elevation when Elevated Vision module is enabled. Closes issue #45.
Full Changelog: 0.8.6...0.8.7
You shall not pass!
Fix for pathfinding slipping through small cracks between walls. Unless the wall is a door, the path should be limited to half the token min(width, height).
Full Changelog: 0.8.5...0.8.6
Two steps forward, 1 step back
New Features
Added settings for selecting how terrain and other tokens are measured for grid squares. GM can choose to count difficult terrain if it covers the grid center, covers a fixed percentage of a grid square/hex, or by the percent for which it overlaps a line between the previous grid shape center to the current grid shape center ("euclidean").
Added selection in Drawings to treat a drawing as imposing a move bonus/penalty. May be changed or dropped to accommodate Foundry v12 scene regions in the future.
Bug fixes
Fix for the token apparent position disconnecting from actual token position when dragging or moving token with the ruler.
Fix for undefined constrainedTokenBounds.contains
. Closes issue #46.
Fix for highlighting incorrect squares with high elevation changes.
Refactor (again!) measurement of distances and move distances. Addresses issues with movement measurement calculating incorrectly when speed highlighting adds temporary waypoints. Now projects the elevation distance to the 2d canvas and uses the projected grid movement for the calculation with gridded scenes.
Update lib geometry to v0.2.17.
Full Changelog: 0.8.4...0.8.5
Fix the "elevation" in "elevation ruler"!
Improve path cleaning algorithm to remove multiple straight-line points. Closes issue #40.
Refactor measurement of distances and move distances to better account for 3d distance. Closes issue #41.
Remove animation easing for intermediate segments while keeping easing-in for the first segment and easing-out for the last segment.
Add CONFIG
settings to change the unicode symbol displayed when the ruler is over terrain (or tokens, if tokens count as difficult terrain). Thanks @Aedif for the Font Awesome code example!
CONFIG.elevationruler.SPEED.terrainSymbol
: You can use any text string here. Paste in a unicode symbol if you want a different symbol. For Font Awesome icons, use, e.g., "\uf0e7".CONFIG.elevationruler.SPEED.useFontAwesome
: Set to true to interpet theterrainSymbol
as FA unicode.
Update geometry lib to v0.2.15.
Breaking changes
The added methods Ruler.measureDistance
and Ruler.measureMoveDistance
were refactored and now take different parameters.
Full Changelog: 0.8.3...0.8.4
Movement choices and token avoidance
New features
- Add setting for pathfinder to avoid all tokens or hostile tokens. Closes issue #37.
- Add selector to Token HUD to choose between walk/fly/burrow movement types. Default is to automatically choose based on elevation. Closes issue #33.
- Add getter
Token.prototype.lastMoveDistance
that tracks the last token move. If combat is active, this returns 0 if the token has not yet moved this round. UseToken.prototype._lastMoveDistance
to find the actual last distance moved regardless of combat. - Add setting to round ruler measurements, for use with gridless scenes. Thanks @Larkinabout for the PR!
Bug fixes and other improvements
- Misc. fixes to pathfinding to reduce likelihood of it failing to find a path or finding an incorrect path.
- Fix for waypoint elevations not finite. Closes issue #38.
- Refactor of elevation handling to account for Token Ruler tokens versus primary ruler.
- Move settings related to speed properties to
CONFIG.elevationruler.SPEED
.
What's Changed
- Add Round to Multiple setting for Gridless by @Larkinabout in #39
New Contributors
- @Larkinabout made their first contribution in #39
Full Changelog: 0.8.2...0.8.3