getAllMapNames: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
m (Text replacement - "<source" to "<syntaxhighlight")
 
(5 intermediate revisions by 3 users not shown)
Line 7: Line 7:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
getAllMapNames()
getAllMapNames()
</source>
<source lang="mtmacro" line>
getAllMapNames(delim)
getAllMapNames(delim)
</source>
</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 16:
|examples=
|examples=
To get the names of all of the maps in a [[String List]].
To get the names of all of the maps in a [[String List]].
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: maps = getAllMapNames()]
[h: maps = getAllMapNames()]
</source>
</syntaxhighlight>


To get the names of all of the maps in a [[JSON Array]]
To get the names of all of the maps in a [[JSON Array]]
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: maps = getAllMapNames("json")]
[h: maps = getAllMapNames("json")]
</source>
</syntaxhighlight>
|also=
|also=
{{func|getCurrentMapName}} {{func|getVisibleMapNames}}
{{func|getCurrentMapName}} {{func|getVisibleMapNames}}


}}
}}
[[Category:Miscellaneous Function]]
[[Category:Map Function]]

Latest revision as of 17:57, 14 March 2023

getAllMapNames() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.3b55
Returns the names of all of the maps as either a String List or JSON Array.

Usage

getAllMapNames()
getAllMapNames(delim)

Parameters

Examples

To get the names of all of the maps in a String List.
[h: maps = getAllMapNames()]

To get the names of all of the maps in a JSON Array

[h: maps = getAllMapNames("json")]

See Also