Skip to content

Commit

Permalink
[#893] Add system for selecting summoning placement
Browse files Browse the repository at this point in the history
The `TokenPlacement` class right now is small and only delegates
to the `TokenPlacementTemplate` which is responsible for rendering
and returning placement information. With the V12 improvements to
placeables hopefully we'll be able to shift more logic out of the
`MeasuredTemplate` subclass and into the `TokenPlacement` class.

The `TokenPlacementConfiguration` data structure currently just
includes the prototype token information, but will eventually have
quantity, origin, and range values to handle multiple summons and
restricting range from the summoner.

Works with tokens of any size or scale on the square grid. On hex
grids, it handles 1x1 tokens pretty good with only a bit of offset
on the final token placement. Stranger token sizes lead to some
issues with positioning, but I'm not sure how important those are
to fix before the other grid improvements in V12.
  • Loading branch information
arbron committed Mar 11, 2024
1 parent aa283cf commit fe71c7f
Show file tree
Hide file tree
Showing 3 changed files with 416 additions and 13 deletions.
1 change: 1 addition & 0 deletions module/canvas/_module.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * as detectionModes from "./detection-modes/_module.mjs";
export {measureDistances} from "./grid.mjs";
export {default as Note5e} from "./note.mjs";
export {default as Token5e} from "./token.mjs";
export {default as TokenPlacement} from "./token-placement.mjs";
export {default as TokenRing} from "./token-ring.mjs";
export {default as TokenRingSamplerShaderV11} from "./shaders/token-ring-shader-v11.mjs";
export {default as TokenRingSamplerShader} from "./shaders/token-ring-shader.mjs";
Loading

0 comments on commit fe71c7f

Please sign in to comment.