getAlwaysVisible: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Created page with "{{MacroFunction |name=getAlwaysVisible |version=1.4.2.0 |description=returns the value of the corresponding setting for the token. Always visible is a VBL setting which can be...")
 
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 2: Line 2:
|name=getAlwaysVisible
|name=getAlwaysVisible
|version=1.4.2.0
|version=1.4.2.0
|description=returns the value of the corresponding setting for the token. Always visible is a VBL setting which can be found in the edit menu of the token under the VBL tab.  
|description=
Returns the value of the corresponding setting for the token. '''Always Visible''' is a VBL setting which can be found in the '''Edit...''' menu of the token under the VBL tab.  


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
getAlwaysVisible([id])
getAlwaysVisible([tokenRef])
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
{{param|value|The value of the setting to set, {{code|true}}({{code|1}}) or {{code|false}}({{code|0}}).}}
{{param|value|The value of the setting to set, {{code|true}}({{code|1}}) or {{code|false}}({{code|0}}).}}
{{param|id|OPTIONAL: The token {{code|id}} of the token for which you want to set this setting, defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{param|tokenRef|OPTIONAL:Either the token [[getSelected|{{code|id}}]] or [[getTokenName|Token Name]] of the token for which you want to set this setting, defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{Note|Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.}}


|example=
|example=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
The Always Visible setting for Dragon is currently set to: [r: getAlwaysVisible("Dragon")]
The Always Visible setting for Dragon is currently set to: [r: getAlwaysVisible("Dragon")]
[h, token("Dragon"): isVisible = getAlwaysVisible()]
[h, token("Dragon"): isVisible = getAlwaysVisible()]
</source>
</syntaxhighlight>
}}
}}
[[Category:VBL Function]]
[[Category:VBL Function]]

Latest revision as of 23:59, 13 May 2024

getAlwaysVisible() Function

Introduced in version 1.4.2.0
Returns the value of the corresponding setting for the token. Always Visible is a VBL setting which can be found in the Edit... menu of the token under the VBL tab.

Usage

getAlwaysVisible([tokenRef])

Parameters

  • value - The value of the setting to set, true(1) or false(0).
  • tokenRef - OPTIONAL:Either the token id or Token Name of the token for which you want to set this setting, defaults to the Current Token.

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

Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.

Example

The Always Visible setting for Dragon is currently set to: [r: getAlwaysVisible("Dragon")]
[h, token("Dragon"): isVisible = getAlwaysVisible()]