KayelGee / token-attacher

MIT License
11 stars 18 forks source link

Feature Request - Is it possible to extend the api token-target functionality to token-token ? #55

Closed p4535992 closed 3 years ago

p4535992 commented 3 years ago

I was updating my Mount UP module, but I noticed some strange behavior when using your macros here. It is almost certainly due to the fact that you expect a "UserTarget" element and I instead provide a "Token" for the second argument.

Before getting back to my code I wanted to know if on your side it was complicated to add the following methods to your api for accept the token element or simply accept the string id of the token

KayelGee commented 3 years ago

The api doesn't have any assumptions about anything being a target or not. In fact there's no difference between a target from Array.from(getGame().user.targets) and a token.

In the example macro I just used targets because that's how a user is able to select anything beside his own token. In your scripts you can actually do for example await window['tokenAttacher'].attachElementToToken(riderToken, mountToken, true); no problem.

Also what you're suggesting for the api to accept an id instead of a token is actually how it works. You can either pass a token or it's id.

So if some code of yours doesn't work, show me which part doesn't and I can maybe clear up your misunderstanding.

p4535992 commented 3 years ago

Ty for the clarification. It must be some mistake on my side