[#4060] Add teleport activity#6904
Conversation
Co-authored-by: Jeff Hitchcock <github444@command-center.org>
Co-authored-by: Jeff Hitchcock <github444@command-center.org>
08f8c20 to
d6d7a34
Compare
arbron
left a comment
There was a problem hiding this comment.
Just a bit of clean up for the sheet but otherwise its looking good to me.
A few thoughts for future improvement to make things clearer when planning the teleport:
- Display icon underneath or outline around token to be teleported
- Add some way to cancel planned movement
- Add UI to indicate movement being planned like discussed in #6796 for placements
Co-authored-by: Jeff Hitchcock <github444@command-center.org>
A cancel option should be fairly easy to add. Maybe with an active listener on What kind of icon/outline did you have in mind? Maybe something like in Crucible where the selection frame rotates around the token while it's marked for teleportation? |
There was a problem hiding this comment.
Nice feature. I will get this merged into 6.0 and we can tackle any follow-up later.
A few thoughts for future improvement to make things clearer when planning the teleport:
- Display icon underneath or outline around token to be teleported
- Add some way to cancel planned movement
- Add UI to indicate movement being planned like discussed in #6796 for placements
For (1) we should hook into the turn marker machinery. We can pick some suitable asset to use here.
For (2) I observed that simply deselecting the controlled token is enough to cancel the teleport, which is good enough for now I think.
I also added the useRange property as I have to imagine that the targeting range will be the same as the teleport range most of the time (notable exceptions like Misty Step notwithstanding).
I used the opportunity to turn the new Foundry API from foundryvtt/foundryvtt#13935, specifically
token.planMovement, into a dedicated activity type for #4060Functionally, activating the activity lets the user drag the token to the desired destination. After the move is completed, the token returns to its default movement mode.
example_teleport.mov
Feel free to rate the implementation. I tried to stick as closely as possible to the standard system.