Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Add event for when tokens on hidden/object are clicked from the token layer #4766

Open
jfranciscoap opened this issue Apr 26, 2024 · 0 comments
Labels
feature Adding functionality that adds value

Comments

@jfranciscoap
Copy link

Describe the Problem

There is a very underutilized feature in the notes popup, in part because it has rigid styling and an outdated look, which can be improved with custom css (like the statsheet), but, I believe, mainly because it stems from a simpler MT time where there was far less automation. The ability to click on tokens that aren't in the token layer without risking moving them is actually quite powerful, as well as allowing a rectangle select on the token layer without adding them to the mix. This has the added benefit of allowing you to customize behavior between clicking tokens on the token layer (the onChangeSelection event) and a new one.

This would allow for much better separation of "play" tokens and "information" tokens for GMs.

The Solution you'd like

To have a specific event for this purpose that can trigger macros, something like onTokenPopup or onClickLayer, or even two events like onClickHidden and onClickObject to further customize the behavior (though that's not quite necessary). It could, then, pass event info similar to the newly implemented onMouseOver, including the tokenId, shift key state and control key state. It might also require a way to prevent the default behavior of opening the notes.

Alternatives that you've considered.

A suggested by Reverend on Discord you could have an overlay capture the mouse event, calculate tokens that are there and trigger it, but this seems overly computationally taxing and prone to some issues with overlapping tokens. There is also the possibility of styling the popup, but that still limits what can be achieved, especially considering maptool is already triggering an event on that click, it would be a sort of redirection.

Additional Context

Some applications I can envision

  • Interactions with doors, windows, traps, objects etc without leaving the token layer or polluting it with non PC/NPC tokens
  • Quick way to toggle tokens in and out of the hidden layer
  • Custom overlay menus like Jmr's onMouseOver and Action Pads libs
  • Using it for the classic notes display, but with much more control (opening in a frame or dialog, having a custom overlay, etc)

I often find myself dragging my notes tokens accidentally during play because I have everything in the token or background layers, leaving two whole (and very useful) layers wasted.

@jfranciscoap jfranciscoap added the feature Adding functionality that adds value label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding functionality that adds value
Projects
None yet
Development

No branches or pull requests

1 participant