selectTokens: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: {{MacroFunction |name=selectTokens |version=1.3b68 |description= Selects one or more visible tokens on the map. |usage= <source lang="mtmacro"> selectTokens() </source> <source lang="mtm...)
 
No edit summary
Line 44: Line 44:


}}
}}
[[Category:State Function]]
[[Category:Token Function]]

Revision as of 17:17, 2 June 2010

selectTokens() Function

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

Usage

selectTokens()
selectTokens(id, add)
selectTokens(tokens, add, delim)

Parameter

  • id - the id string of a specific token to select; if left blank all visible tokens are selected.
  • add - if the value of add is true(1), the selections will be added to the current set of selected tokens; if the value is false(0) currently selected tokens will be deselected before new tokens are selected. Defaults to false.
  • tokens - a String List of tokens to select.
  • 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, both add and delim must be specified.

Example

To select a single token with the name "Adventurer":
[h:selectTokens("Adventurer")]

To select a list of Tokens using a String List, replacing the current selection

[h:selectTokens("Adventurer, Orc 2, Goblin 1", 0, ",")]

To select a list of Tokens using a JSON Array, adding the specified tokens to the current set of selected Tokens:

[h:selectTokens("['Adventurer', 'Orc 2', 'Goblin 1']", 1, "json")]


Version Changes

  • 1.3b68 - Function added.