deselectTokens: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page DeselectTokens to deselectTokens: Converting page titles to lowercase)
m (Text replacement - "source>" to "syntaxhighlight>")
Line 8: Line 8:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
deselectTokens()
deselectTokens()
</source>
</syntaxhighlight>
<source lang="mtmacro" line>
<source lang="mtmacro" line>
deselectTokens(id)
deselectTokens(id)
</source>
</syntaxhighlight>
<source lang="mtmacro" line>
<source lang="mtmacro" line>
deselectTokens(tokens, delim)
deselectTokens(tokens, delim)
</source>
</syntaxhighlight>


'''Parameter'''
'''Parameter'''
Line 25: Line 25:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h:deselectTokens("Adventurer")]
[h:deselectTokens("Adventurer")]
</source>
</syntaxhighlight>


To deselect a list of [[Token]]s using a [[String List]]:
To deselect a list of [[Token]]s using a [[String List]]:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h:deselectTokens("Adventurer, Orc 2, Goblin 1", 0, ",")]
[h:deselectTokens("Adventurer, Orc 2, Goblin 1", 0, ",")]
</source>
</syntaxhighlight>


|also=
|also=

Revision as of 17:12, 14 March 2023

deselectTokens() Function

Introduced in version 1.3b68
Deselects one or more visible tokens on the map.

Usage

<source lang="mtmacro" line> deselectTokens() </syntaxhighlight> <source lang="mtmacro" line> deselectTokens(id) </syntaxhighlight> <source lang="mtmacro" line> deselectTokens(tokens, delim) </syntaxhighlight>

Parameter

  • id - the id string or name of a specific 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 for list may be a JSON Array instead. Note: if using a JSON Array or String List, delim must be specified.

Example

To deselect a single token with the name "Adventurer":

<source lang="mtmacro" line> [h:deselectTokens("Adventurer")] </syntaxhighlight>

To deselect a list of Tokens using a String List: <source lang="mtmacro" line> [h:deselectTokens("Adventurer, Orc 2, Goblin 1", 0, ",")]

</syntaxhighlight>

See Also

Version Changes

  • 1.3b68 - Function added.