Add support for map IDs in macro functions #4127
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Identify the Bug or Feature request
Implements #3852
Description of the Change
All map functions that accept a map name or display name now accept a map ID if it makes sense. Many other functions should also support map IDs now, though this was done by modifying common functionality and I have not exhaustively checked which are all affected (not all functions use common functionality to find maps).
The following new functions have been added to return map IDs similar to the existing functions that return map names:
getCurrentMapID()
getAllMapIDs([delim])
getMapIDs(mapName, [delim])
getVisibleMapIDs([delim])
getTokenMapIDs(name/ID, [delim])
Finally, a list of zone IDs has been added to the result of
getInfo("campaign")
, under the"zoneIDs"
keyPossible Drawbacks
In the edge case that someone has a map named with the GUID of another map, the lookup behaviour will be changed.
Documentation Notes
What follows is documentation for the new functions. Many existing functions will also need updating in the Wiki to add IDs to the set of possible parameters.
getCurrentMapID
Returns the unique ID of the current map.
Usage
getAllMapIDs
Returns the IDs of all maps in the campaign as either a String List of a JSON Array
Usage
Parameters
delim
The delimiter to use for a String List. If the value isjson
, then a JSON Array is returned.getMapIDs
Returns the IDs of all maps with the given name.
Usage
Parameters
name
The name of the map to finddelim
The delimiter to use for a String List. If the value isjson
, then a JSON Array is returned.getVisibleMapIDs
Returns the IDs of all visible maps in the campaign as either a String List of a JSON Array
Usage
Parameters
delim
The delimiter to use for a String List. If the value isjson
, then a JSON Array is returned.getTokenMapIDs
Gets the list of map(s) where a token resides. The list is returned either as a string list, or as a JSON Array.
Usage
Parameters
name/ID
Either the name of the token or the ID.delim
The delimiter used in the string list returned, defaults to","
. If set tojson
, then a JSON array is returned.Release Notes
getCurrentMapID()
,getAllMapIDs([delim])
,getMapIDs(mapName, [delim])
,getVisibleMapIDs([delim])
,getTokenMapIDs(name/ID, [delim])
"zoneIDs"
key ofgetInfo("campaign")
This change is