js:MapTool.clientInfo: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Created page with "Within the javascript environment used by {{code|js.eval}}, {{code|MapTool.clientInfo}} gives information about the client and user settings. {{MacroFunction |name=clientInfo...")
 
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Experimental}}
Within the javascript environment used by {{code|js.eval}}, {{code|MapTool.clientInfo}} gives information about the client and user settings.
Within the javascript environment used by {{code|js.eval}}, {{code|MapTool.clientInfo}} gives information about the client and user settings.


Line 4: Line 5:
|name=clientInfo.faceEdge
|name=clientInfo.faceEdge
|trusted=true
|trusted=true
|version=1.9.4
|version=1.10.0
|description=
|description=
Returns {{code|true}} if tokens face the edge.
Returns {{code|true}} if tokens face the edge.


|usage=
|usage=
<source lang="javascript" line>
<syntaxhighlight lang="javascript" line>
MapTool.clientInfo.faceEdge();
MapTool.clientInfo.faceEdge();
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 21: Line 22:
|name=clientInfo.faceVertex
|name=clientInfo.faceVertex
|trusted=true
|trusted=true
|version=1.9.4
|version=1.10.0
|description=
|description=
Opposite of faceEdge
Opposite of faceEdge


|usage=
|usage=
<source lang="javascript" line>
<syntaxhighlight lang="javascript" line>
MapTool.clientInfo.faceVertex();
MapTool.clientInfo.faceVertex();
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 37: Line 38:
|name=clientInfo.portraitSize
|name=clientInfo.portraitSize
|trusted=true
|trusted=true
|version=1.9.4
|version=1.10.0
|description=
|description=
Returns the number of pixels used to display portraits
Returns the number of pixels used to display portraits


|usage=
|usage=
<source lang="javascript" line>
<syntaxhighlight lang="javascript" line>
MapTool.clientInfo.portraitSize();
MapTool.clientInfo.portraitSize();
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 54: Line 55:
|name=clientInfo.showStatSheet
|name=clientInfo.showStatSheet
|trusted=true
|trusted=true
|version=1.9.4
|version=1.10.0
|description=
|description=
Returns true if the player has show stat sheet selected in preferences.
Returns true if the player has show stat sheet selected in preferences.


|usage=
|usage=
<source lang="javascript" line>
<syntaxhighlight lang="javascript" line>
MapTool.clientInfo.showStatSheet();
MapTool.clientInfo.showStatSheet();
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 72: Line 73:
|name=clientInfo.version
|name=clientInfo.version
|trusted=true
|trusted=true
|version=1.9.4
|version=1.10.0
|description=
|description=
Version string of maptool.
Version string of maptool.


|usage=
|usage=
<source lang="javascript" line>
<syntaxhighlight lang="javascript" line>
MapTool.clientInfo.version();
MapTool.clientInfo.version();
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 88: Line 89:
|name=clientInfo.fullScreen
|name=clientInfo.fullScreen
|trusted=true
|trusted=true
|version=1.9.4
|version=1.10.0
|description=
|description=
Returns if the current frame is fullscreen.
Returns if the current frame is fullscreen.


|usage=
|usage=
<source lang="javascript" line>
<syntaxhighlight lang="javascript" line>
MapTool.clientInfo.fullScreen();
MapTool.clientInfo.fullScreen();
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 105: Line 106:
|name=clientInfo.timeInMs
|name=clientInfo.timeInMs
|trusted=true
|trusted=true
|version=1.9.4
|version=1.10.0
|description=
|description=
Returns the current time with ms precision.
Returns the current time with ms precision.


|usage=
|usage=
<source lang="javascript" line>
<syntaxhighlight lang="javascript" line>
MapTool.clientInfo.timeInMs();
MapTool.clientInfo.timeInMs();
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 122: Line 123:
|name=clientInfo.timeDate
|name=clientInfo.timeDate
|trusted=true
|trusted=true
|version=1.9.4
|version=1.10.0
|description=
|description=
Returns the current time and date as an opaque object.
Returns the current time and date as an opaque object.
Line 128: Line 129:


|usage=
|usage=
<source lang="javascript" line>
<syntaxhighlight lang="javascript" line>
MapTool.clientInfo.timeDate();
MapTool.clientInfo.timeDate();
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 140: Line 141:
|name=clientInfo.libraryTokens
|name=clientInfo.libraryTokens
|trusted=true
|trusted=true
|version=1.9.4
|version=1.10.0
|description=
|description=
Returns a map of all library tokens.
Returns a map of all library tokens.


|usage=
|usage=
<source lang="javascript" line>
<syntaxhighlight lang="javascript" line>
MapTool.clientInfo.libraryTokens();
MapTool.clientInfo.libraryTokens();
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 157: Line 158:
|name=clientInfo.userDefinedFunctions
|name=clientInfo.userDefinedFunctions
|trusted=true
|trusted=true
|version=1.9.4
|version=1.10.0
|description=
|description=
Returns a list of user defined function aliases.
Returns a list of user defined function aliases.


|usage=
|usage=
<source lang="javascript" line>
<syntaxhighlight lang="javascript" line>
MapTool.clientInfo.userDefinedFunctions();
MapTool.clientInfo.userDefinedFunctions();
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 174: Line 175:
|name=clientInfo.getClientId
|name=clientInfo.getClientId
|trusted=true
|trusted=true
|version=1.9.4
|version=1.10.0
|description=
|description=
Returns the unique ID of the current client as a string.
Returns the unique ID of the current client as a string.


|usage=
|usage=
<source lang="javascript" line>
<syntaxhighlight lang="javascript" line>
MapTool.clientInfo.getClientId();
MapTool.clientInfo.clientId();
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''

Latest revision as of 23:59, 15 March 2023

 This article describes a feature or macro function that is experimental and may be subject to change.

Within the javascript environment used by js.eval, MapTool.clientInfo gives information about the client and user settings.


clientInfo.faceEdge() Function

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

Introduced in version 1.10.0
Returns true if tokens face the edge.

Usage

MapTool.clientInfo.faceEdge();

Parameters

  • return true if tokens face the edge, false otherwise.


clientInfo.faceVertex() Function

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

Introduced in version 1.10.0
Opposite of faceEdge

Usage

MapTool.clientInfo.faceVertex();

Parameters

  • return true if tokens face the vertex, false otherwise.


clientInfo.portraitSize() Function

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

Introduced in version 1.10.0
Returns the number of pixels used to display portraits

Usage

MapTool.clientInfo.portraitSize();

Parameters

  • return Number of pixels high and wide a portrait is.


clientInfo.showStatSheet() Function

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

Introduced in version 1.10.0
Returns true if the player has show stat sheet selected in preferences.

Usage

MapTool.clientInfo.showStatSheet();

Parameters

  • return true if the stat sheet is show.



clientInfo.version() Function

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

Introduced in version 1.10.0
Version string of maptool.

Usage

MapTool.clientInfo.version();

Parameters

  • return The version information of MapTool, as a string.


clientInfo.fullScreen() Function

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

Introduced in version 1.10.0
Returns if the current frame is fullscreen.

Usage

MapTool.clientInfo.fullScreen();

Parameters

  • return true if the current frame is fullscreen.


clientInfo.timeInMs() Function

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

Introduced in version 1.10.0
Returns the current time with ms precision.

Usage

MapTool.clientInfo.timeInMs();

Parameters

  • return System time in miliseconds as an integer.


clientInfo.timeDate() Function

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

Introduced in version 1.10.0
Returns the current time and date as an opaque object. Just use new Date() instead.

Usage

MapTool.clientInfo.timeDate();

Parameters

  • return System time as a java Date object. It can be converted to an integer or a string, but is otherwise opaque.


clientInfo.libraryTokens() Function

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

Introduced in version 1.10.0
Returns a map of all library tokens.

Usage

MapTool.clientInfo.libraryTokens();

Parameters

  • return Javascript object mapping library token names to library versions.


clientInfo.userDefinedFunctions() Function

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

Introduced in version 1.10.0
Returns a list of user defined function aliases.

Usage

MapTool.clientInfo.userDefinedFunctions();

Parameters

  • return A list of user defined function aliases.


clientInfo.getClientId() Function

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

Introduced in version 1.10.0
Returns the unique ID of the current client as a string.

Usage

MapTool.clientInfo.clientId();

Parameters

  • return Current client ID.


See Also

JS: MapTool