getAllMapDisplayNames: Difference between revisions
Jump to navigation
Jump to search
m (Conversion script moved page GetAllMapDisplayNames to getAllMapDisplayNames: Converting page titles to lowercase) |
m (Text replacement - "source>" to "syntaxhighlight>") |
||
Line 10: | Line 10: | ||
getAllMapDisplayNames() | getAllMapDisplayNames() | ||
getAllMapDisplayNames(delim) | getAllMapDisplayNames(delim) | ||
</ | </syntaxhighlight> | ||
'''Parameters''' | '''Parameters''' | ||
{{param|delim|The delimiter to use for the [[String List]]. If the value is {{code|json}} then a [[JSON Array]] is returned.}} | {{param|delim|The delimiter to use for the [[String List]]. If the value is {{code|json}} then a [[JSON Array]] is returned.}} | ||
Line 18: | Line 18: | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[h: maps = getAllMapDisplayNames()] | [h: maps = getAllMapDisplayNames()] | ||
</ | </syntaxhighlight> | ||
To get the display names of all of the maps in a [[JSON Array]] | To get the display names of all of the maps in a [[JSON Array]] | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[h: maps = getAllMapDisplayNames("json")] | [h: maps = getAllMapDisplayNames("json")] | ||
</ | </syntaxhighlight> | ||
|also= | |also= | ||
{{func|getMapDisplayName}} {{func|getVisibleMapDisplayNames}} | {{func|getMapDisplayName}} {{func|getVisibleMapDisplayNames}} |
Revision as of 17:04, 14 March 2023
getAllMapDisplayNames() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.9.0
Returns the display names of all of the maps as either a String List or JSON Array.
Usage
<source lang="mtmacro" line> getAllMapDisplayNames() getAllMapDisplayNames(delim) </syntaxhighlight> Parameters
delim
- The delimiter to use for the String List. If the value isjson
then a JSON Array is returned.
Examples
To get the display names of all of the maps in a String List.
<source lang="mtmacro" line> [h: maps = getAllMapDisplayNames()] </syntaxhighlight>
To get the display names of all of the maps in a JSON Array <source lang="mtmacro" line> [h: maps = getAllMapDisplayNames("json")]
</syntaxhighlight>