deselectTokens: Difference between revisions
Jump to navigation
Jump to search
(New page: {{MacroFunction |name=deselectTokens |version=1.3b68 |description= Deselects one or more visible tokens on the map. |usage= <source lang="mtmacro"> deselectTokens() </source> <source lan...) |
No edit summary |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 6: | Line 6: | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
deselectTokens() | deselectTokens() | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
deselectTokens( | deselectTokens(tokenRef) | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
deselectTokens(tokens, delim) | deselectTokens(tokens, delim) | ||
</ | </syntaxhighlight> | ||
'''Parameter''' | '''Parameter''' | ||
* {{code| | * {{code|tokenRef}} - Either the token [[getSelected|{{code|id}}]] or [[getTokenName|Token Name]] of the token to deselect (the examples below use the token name, but token IDs are also valid); if left blank all currently selected tokens are deselected. | ||
* {{code|tokens}} - a [[String List]] of tokens to deselect. | * {{code|tokens}} - a [[String List]] of tokens to deselect. | ||
* {{code|delim}} - Specifies the delimiter used in the string list that is supplied. If the delimiter is "json", then the value for {{code|list}} may be a [[JSON Array]] instead. '''Note: if using a JSON Array or String List, {{code|delim}} must be specified.''' | * {{code|delim}} - Specifies the delimiter used in the string list that is supplied. If the delimiter is "json", then the value for {{code|list}} may be a [[JSON Array]] instead. '''Note: if using a JSON Array or String List, {{code|delim}} must be specified.''' | ||
{{Note|Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.}} | |||
|example= | |example= | ||
To deselect a single token with the name "Adventurer": | To deselect a single token with the name "Adventurer": | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h:deselectTokens("Adventurer")] | [h:deselectTokens("Adventurer")] | ||
</ | </syntaxhighlight> | ||
To deselect a list of [[Token]]s using a [[String List]]: | To deselect a list of [[Token]]s using a [[String List]]: | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h:deselectTokens("Adventurer, Orc 2, Goblin 1", 0, ",")] | [h:deselectTokens("Adventurer, Orc 2, Goblin 1", 0, ",")] | ||
</ | </syntaxhighlight> | ||
|also= | |||
[[selectTokens|selectTokens()]], | |||
[[getSelected|getSelected()]], | |||
[[getSelectedNames|getSelectedNames()]] | |||
|changes= | |changes= |
Latest revision as of 23:59, 13 May 2024
deselectTokens() Function
• Introduced in version 1.3b68
Deselects one or more visible tokens on the map.
Usage
deselectTokens()
deselectTokens(tokenRef)
deselectTokens(tokens, delim)
Parameter
tokenRef
- Either the tokenid
or Token Name of the token to deselect (the examples below use the token name, but token IDs are also valid); if left blank all currently selected tokens are deselected.tokens
- a String List of tokens to deselect.delim
- Specifies the delimiter used in the string list that is supplied. If the delimiter is "json", then the value forlist
may be a JSON Array instead. Note: if using a JSON Array or String List,delim
must be specified.
Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.
Example
To deselect a single token with the name "Adventurer":
[h:deselectTokens("Adventurer")]
To deselect a list of Tokens using a String List:
[h:deselectTokens("Adventurer, Orc 2, Goblin 1", 0, ",")]
See Also
Version Changes
- 1.3b68 - Function added.