isBarVisible: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page IsBarVisible to isBarVisible: Converting page titles to lowercase)
No edit summary
Line 6: Line 6:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
isBarVisible(bar)
isBarVisible(bar)
isBarVisible(bar, id)
isBarVisible(bar, id)
isBarVisible(bar, id, mapname)
isBarVisible(bar, id, mapname)
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|bar|A string that contains the name of the bar that has its visibility checked.}}
{{param|bar|A string that contains the name of the bar that has its visibility checked.}}
Line 18: Line 18:
|examples=
|examples=
Displays {{code|The health bar is visible!}} if the bar named {{code|Health}} is set to visible; otherwise it displays {{code|The health bar is not visible!}}.
Displays {{code|The health bar is visible!}} if the bar named {{code|Health}} is set to visible; otherwise it displays {{code|The health bar is not visible!}}.
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[if(isBarVisible("Health")), code:
[if(isBarVisible("Health")), code:
{
{
Line 25: Line 25:
     The health bar is not visible!
     The health bar is not visible!
}]
}]
</source>
</syntaxhighlight>


Toggles the visibility of the bar named {{code|Fatigue}}.
Toggles the visibility of the bar named {{code|Fatigue}}.
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: setBarVisible("Fatigue", !isBarVisible("Fatigue"))]
[h: setBarVisible("Fatigue", !isBarVisible("Fatigue"))]
[h: abort(0)]
[h: abort(0)]
</source>
</syntaxhighlight>


|also=
|also=

Revision as of 20:21, 15 March 2023

isBarVisible() Function

Introduced in version 1.3b46
Returns true(1) if the specified Token Bar on the Current Token is visible, or false(0) if it is not.

Usage

isBarVisible(bar)
isBarVisible(bar, id)
isBarVisible(bar, id, mapname)

Parameters

  • bar - A string that contains the name of the bar that has its visibility checked.
  • id - The token id of the token which has its bar checked, defaults to the Current Token.

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

  • mapname - The name of the map to find the token. Defaults to the current map.

Examples

Displays The health bar is visible! if the bar named Health is set to visible; otherwise it displays The health bar is not visible!.
[if(isBarVisible("Health")), code:
{
    The health bar is visible!
};{
    The health bar is not visible!
}]

Toggles the visibility of the bar named Fatigue.

[h: setBarVisible("Fatigue", !isBarVisible("Fatigue"))]
[h: abort(0)]

See Also

Version Changes

  • 1.5.7 - Added id and mapname parameter options.

Related Pages