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

Extended getTokenByID to search other Maps #4296

Merged
merged 5 commits into from
Sep 22, 2023

Conversation

ColdAnkles
Copy link
Contributor

@ColdAnkles ColdAnkles commented Sep 21, 2023

… for tokenID if not found on current Map.

Identify the Bug or Feature request

Closes #3069

Description of the Change

Extends the functionality of the JS MapTool.Tokens.getTokenByID(id) function to attempt a search of other maps if token with id not found on the current map.

Possible Drawbacks

Not great if token on the last map and there's a large quantity of maps.

Documentation Notes

Attempts to get token from current map, if not found, searches all maps for token, returning null if not found at all.

Release Notes

  • Fixed an issue where MapTool.Tokens.getTokenByID(id) did not return token with id.

This change is Reviewable

Copy link
Member

@cwisniew cwisniew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a function that checks only the current map as well, maybe getMapTokenByID() that only searches the current map and returns null if the token is not on the current map.

@cwisniew
Copy link
Member

@ColdAnkles
I assume this is for issue #3069 and not 3609,

@ColdAnkles
Copy link
Contributor Author

Yeah, issue number was a typo.

token.isOnCurrentMap() as another option?

@cwisniew
Copy link
Member

Yeah, issue number was a typo.

token.isOnCurrentMap() as another option?

Might be worth adding that as well.
Sorry for asking now :)

@cwisniew cwisniew added the feature Adding functionality that adds value label Sep 22, 2023
@cwisniew cwisniew enabled auto-merge September 22, 2023 15:03
@cwisniew cwisniew added this pull request to the merge queue Sep 22, 2023
Merged via the queue into RPTools:develop with commit 9b7cb1d Sep 22, 2023
4 checks passed
@ColdAnkles ColdAnkles deleted the getTokenByID-searchMaps branch September 22, 2023 22:12
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
Status: Merged
2 participants