Files
itgmania212121/stepmania/Docs/LuaDocumentation.xml
T

397 lines
18 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<!-- Before checking the documentation in, make sure that it validates by
going to http://tools.decisionsoft.com/schemaValidate/ and using
Lua.xsd for the XML Schema and this file for the XML Instanace. -->
<!-- Using Link:
If you leave out the text (i.e., <Link ... />), it tries to output what
you would want.
To add a link to a function in the current class:
<Link function='addx'>addx()</Link>
To add a link to a function in another class:
<Link class='ActorFrame' function='propogate'>ActorFrame:propogate()</Link>
To add a link to a class:
<Link class='ActorFrame'>ActorFrame</Link>
To add a link to a global function:
<Link class='GLOBAL' function='Basename'>Basename()</Link>
To add a link to an Enum:
<Link class='ENUM' function='CoinMode'>CoinMode</Link> -->
<Documentation xmlns='http://www.stepmania.com' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.stepmania.com Lua.xsd'>
<!-- Global functions -->
<GlobalFunctions>
<Function name='Basename' return='string' arguments='string path'>
Returns the base name of file path.
</Function>
<Function name='DayOfMonth' return='int' arguments=''>
Returns the current day of the month.
</Function>
<Function name='DayOfYear' return='int' arguments=''>
Returns the current day of the year.
</Function>
<Function name='FormatNumberAndSuffix' return='string' arguments='int num'>
Returns the number passed to the function followed by its suffix (&quot;th&quot;, &quot;nd&quot;, and so on).
</Function>
<Function name='Hour' return='int' arguments=''>
Returns the current hour.
</Function>
<Function name='IsEventMode' return='bool' arguments=''>
Returns <code>true</code> if Event Mode is turned on.
</Function>
<Function name='LoadActor' return='ActorDef' arguments='string sPath, ...'>
Returns an Actor definition for the actor at <code>sPath</code>. If <code>sPath</code> points to a Lua file, any additional arguments will be passed to that script.
</Function>
<Function name='Minute' return='int' arguments=''>
Returns the current Minute.
</Function>
<Function name='MonthOfYear' return='int' arguments=''>
Returns the current month of the year.
</Function>
<Function name='Second' return='int' arguments=''>
Returns the current second.
</Function>
<Function name='SecondsToMSSMsMs' return='string' arguments='float fSecs'>
Converts <code>fSecs</code> to Minutes:Seconds.Milliseconds format.
</Function>
<Function name='Trace' return='void' arguments='string sString'>
Alias for <Link function='lua.Trace' />.
</Function>
<Function name='Warn' return='void' arguments='string sString'>
Alias for <Link function='lua.Warn' />.
</Function>
<Function name='lua.Trace' return='void' arguments='string sString'>
Writes <code>sString</code> to log.txt. Aliased by <Link function='Trace' />.
</Function>
<Function name='lua.Warn' return='void' arguments='string sString'>
Writes <code>sString</code> to info.txt and log.txt as a warning. Aliased by <Link function='Warn' />.
</Function>
<Function name='lua.Flush' return='void' arguments='' >
Flushes log files to disk.
</Function>
<Function name='mbstrlen' return='int' arguments='string sString'>
Returns the length of the multi-byte character string <code>sString</code>.
</Function>
</GlobalFunctions>
<!-- Classes -->
<Classes>
<Class name='Actor'>
<Function name='halign' return='void' arguments='float fAlign'>
Set the fractional horizontal alignment of the Actor according to <code>fAlign</code> which should be a float in the range 0..1. An alignment of 0 is left aligned while an alignment of 1 is right aligned. See <Link function='horizalign' /> for the common case.
</Function>
<Function name='horizalign' return='void' arguments='HorizAlign align'>
Set the horizontal alignment of the Actor according to <code>align</code>. See <Link function='halign' /> for fractional alignment.
</Function>
<Function name='valign' return='void' arguments='float fAlign'>
Set the fractional vertical alignment of the Actor according to <code>fAlign</code> which should be a float in the range 0..1. An alignment of 0 is top aligned while an alignment of 1 is bottom aligned. See <Link function="vertalign" /> for the common case.
</Function>
<Function name='vertalign' return='void' arguments='VertAlign align'>
Set the vertical alignment of the Actor according to <code>align</code>. See <Link function="valign" /> for fractional alignment.
</Function>
<Function name='x' return='void' arguments='float xPos'>
Set the x position of the Actor to <code>xPos</code>.
</Function>
<Function name='y' return='void' arguments='float yPos'>
Set the y position of the Actor to <code>yPos</code>.
</Function>
<Function name='z' return='void' arguments='float zPos'>
Set the z position of the Actor to <code>zPos</code>.
</Function>
</Class>
<Class name='ActorSound'>
<Description>
This Actor represents a playable sound. There are two attributes that can be set on load.<br />
* <code>SupportPan</code> - Let the sound pan from side to side.<br />
* <code>SupportRateChanging</code> - Let the sound change rate and pitch.
</Description>
<Function name='get' return='RageSound' arguments=''>
Returns the <Link class='RageSound' /> that can be played by this Actor.
</Function>
<Function name='load' return='void' arguments='string sPath'>
Loads the sound at <code>sPath</code>.
</Function>
<Function name='play' return='void' arguments=''>
Play the sound.
</Function>
<Function name='playforplayer' return='void' arguments='PlayerNumber pn'>
Play the sound on the given player's side. You must set <code>SupportPan = true</code> on load.
</Function>
</Class>
<Class name='BitmapText'>
<Function name='AddAttribute' return='void' arguments='int iPos, Attribute attr'>
Add the attribute <code>attr</code> to the string at position
<code>iPos</code>.<br />
The attribute is a table that must contain <code>Length</code>
which specifies how many (multi-byte) characters the attribute
is to apply. If <code>Length=-1</code>, then the attribute applies
until another attribute overrides it.<br />
If the table contains <code>Diffuse</code>, then the color value
is applied to the range of text.<br />
If the table contains <code>Diffuses</code>, then it should be
an array of 4 colors which specify the diffuse color for the
top left, top right, bottom left, and bottom right.<br />
If the table contains <code>Glow</code>, then the color value
is applied as a glow to the range of text.<br />
Example:<br />
<code>attr = { Length = 10; Diffuse = color("#AABBCC"); }</code>
</Function>
<Function name='ClearAttributes' return='void' arguments=''>
Clear all attributes associated with the BitmapText.
</Function>
<Function name='GetText' return='string' arguments=''>
Returns the text.
</Function>
<Function name='jitter' return='void' arguments='bool bJitter'>
If <code>bJitter</code> is <code>true</code>, move each character of the string around by a small random amount.
</Function>
<Function name='maxheight' return='void' arguments='float fHeight'>
Set the maximum height of the unzoomed text to <code>fHeight</code>. If <code>fHeight</code> is <code>0</code>, then there is no maximum height.
</Function>
<Function name='maxwidth' return='void' arguments='float hWidth'>
Set the maximum width of the unzoomed text to <code>fWidth</code>. If <code>fWidth</code> is <code>0</code>, then there is no maximum width.
</Function>
<Function name='rainbowscroll' return='void' arguments='bool bRainbowScroll'>
If <code>true</code>, set each character of the text in turn to the rainbow colors in the metrics <code>BitmapText::RainbowColor#</code>.
</Function>
<Function name='settext' return='void' arguments='string sText'>
Set the text to <code>sText</code>. This clears all attributes.
</Function>
<Function name='vertspacing' return='void' arguments='int iSpacing'>
Add <code>iSpacing</code> pixels of padding between lines of text.
</Function>
<Function name='wrapwidthpixels' return='void' arguments='int iWidth'>
Wrap the unzoomed text at <code>iWidth</code> pixels. If you <Link class='Actor' function='zoom' /> or <Link class='Actor' function='zoomx' /> by <code>x</code> and you want the text wrapped at <code>width</code>, then you should use <code>wrapwidthpixels(width/x)</code>.
</Function>
</Class>
<Class name='CharacterManager'>
<Function name='GetCharacter' return='Character' arguments='string sID'>
Return the <Link class='Character' /> corresponding to <code>sID</code>.
</Function>
</Class>
<Class name='Game'>
<Function name='GetName' return='string' arguments=''>
Returns the name of the game such as &quot;dance&quot; or &quot;pump&quot;.
</Function>
</Class>
<Class name='GameManager'>
<Function name='GetFirstStepsTypeForGame' return='StepsType' arguments='Game game'>
Return the first of the <Link class='StepsType' /> corresponding to <code>game</code>.
</Function>
<Function name='StepsTypeToLocalizedString' return='string' arguments='StepsType st'>
Return the localized string representation of <code>st</code>.
</Function>
</Class>
<Class name='GameSoundManager'>
<Function name='DimMusic' return='void' arguments='float fVolume, float fDuration'>
Set the music volume to <code>fVolume</code> for <code>fDuration</code> seconds.
</Function>
<Function name='GetPlayerBalance' return='float' arguments='PlayerNumber pn'>
<!-- XXX: Presumably, 0 is all the way to the left, and 1 is all the way
to the right. -->
Return the sound balance for <code>pn</code>.
</Function>
<Function name='PlayOnce' return='void' arguments='string sPath'>
Play the sound at <code>sPath</code> one time.
</Function>
</Class>
<Class name='GameState'>
<Function name='AnyPlayerHasRankingFeats' return='bool' arguments=''>
Returns <code>true</code> if any player has performed a feat worthy of ranking.
</Function>
<Function name='ApplyGameCommand' return='void' arguments='string sCommand, PlayerNumber pn'>
The second argument is optional. Apply the GameCommand represented by <code>sCommand</code>
for <code>pn</code>, if given. See <Link class='GameCommand' />.
</Function>
<Function name='EnoughCreditsToJoin' return='bool' arguments=''>
Returns <code>true</code> if enough credits have been inserted to join.
</Function>
<Function name='Env' return='table' arguments=''>
Returns the environment table. See <Link class='GameCommand' />.
</Function>
<Function name='GetCoinMode' return='CoinMode'>
Returns the current <Link class='ENUM' function='CoinMode' />.
</Function>
<Function name='GetCoins' return='int' arguments=''>
Return the number of inserted but unused coins. This number is
decremented when players join.
</Function>
<Function name='GetCoinsNeededToJoin' return='int' arguments=''>
Return the number of coins needed to join based on the current coin and premium modes
as well as the number of people joined, if that matters for the premium mode. See
<Link function='GetCoinMode' /> and <Link function='GetPremium' />.
</Function>
<Function name='GetCourseSongIndex' return='int' arguments=''>
The <Link class='Song' />s in a <Link class='Course' /> are numbered sequentially
starting from 0. Return the number of the current <Link class='Song' />.
</Function>
<Function name='GetCurrentCourse' return='Course' arguments=''>
Return the current <Link class='Course' />.
</Function>
<Function name='GetCurrentGame' return='Game' arguments=''>
Return the current <Link class='Game' />.
</Function>
<Function name='GetCurrentSong' return='Song' arguments=''>
Return the current <Link class='Song' />.
</Function>
<Function name='GetCurrentStage' return='Stage' arguments=''>
Return the current <Link class='Stage' />.
</Function>
<Function name='GetCurrentSteps' return='Steps' arguments=''>
Return the current <Link class='Steps' />.
</Function>
<Function name='GetCurrentStepsCredits' return='multiple' arguments=''>
Return a variable number of arguments based on the <Link class='Steps' /> being
played by all players. For each distinct <Link class='Steps' /> being played by
the players, in increasing <Link class='ENUM' function='PlayerNumber' /> order,
the difficulty and description of the <Link class='Steps' /> is returned as strings.
<br />For example,<br />
<code>local credits = {GAMESTATE:GetCurrentStepsCredits()};</code><br />
will make a table of the difficulties and descriptions.
</Function>
<Function name='GetCurrentStyle' return='Style' arguments=''>
Return the current <Link class='Style' />.
</Function>
<Function name='GetCurrentTrail' return='Trail' arguments=''>
Return the current <Link class='Trail' />.
</Function>
<Function name='GetDefaultSongOptions' return='string' arguments=''>
Return a string representation of the default song options.
</Function>
<Function name='GetEasiestStepsDifficulty' return='Difficulty' arguments=''>
Return the easiest <Link class='ENUM' function='Difficulty' /> of the
currently selected steps by all players. For example, if player 1 has
selected Hard steps and player 2 has selected Medium steps, Medium will
be returned.
</Function>
<Function name='GetEditCourseEntryIndex' return='int' arguments=''>
<!-- XXX: What is the edit course entry index? -->
</Function>
<Function name='GetEditLocalProfile' return='Profile' arguments=''>
<!-- XXX: What is the EditLocalProfile? -->
Return the Edit Local <Link class='Profile' /> or <code>nil</code> if
it does not exist.
</Function>
<Function name='GetEditLocalProfileID' return='string' arguments=''>
<!-- XXX: What is the EditLocalProfileID? -->
</Function>
<Function name='GetEditSourceSteps' return='Steps' arguments=''>
Return the source <Link class='Steps' /> for the editor or <code>nil</code>
if it does not exist.
</Function>
<Function name='GetGameSeed' return='int' arguments=''>
Return the current random seed for the game.
</Function>
<Function name='GetGameplayLeadIn' return='bool' arguments=''>
Return <code>true</code> if the gameplay lead in is enabled. If
<code>false</code>, gameplay begin immediately. <!-- XXX: I think. -->
</Function>
<Function name='GetHumanPlayers' return='{PlayerNumber}' arguments=''>
Returns an array of <Link class='PlayerNumber' />s corresponding to Human players.
</Function>
</Class>
<Class name='MemoryCardManager'>
<Function name='GetCardState' return='MemoryCardState' arguments='PlayerNumber pn'>
Return the state for <code>pn</code>.
</Function>
</Class>
<Class name='MessageManager'>
<Function name='Broadcast' return='void' arguments='string sMessage, table paramTable'>
Broadcast the message to all listeners subscribed to <code>sMessage</code>. The
second argument is an optional table of parameters. It may be omitted or explicitly
set to <code>nil</code>.
</Function>
</Class>
<Class name='PrefsManager'>
<Function name='GetPreference' return='various' arguments='string sPreference'>
Return the value of the preference <code>sPreference</code>.
</Function>
<Function name='SetPreference' return='void' arguments='string sPreference, various value'>
Set the value of the preference <code>sPreference</code> to <code>value</code>.
</Function>
<Function name='SetPreferenceToDefault' return='void' arguments='string sPreference'>
Reset preference <code>sPreference</code> to the default value.
</Function>
</Class>
<Class name='RageDisplay'>
<Function name='GetDisplayHeight' return='int' arguments=''>
Return the height of the display.
</Function>
<Function name='GetDisplayWidth' return='int' arguments=''>
Return the width of the display.
</Function>
</Class>
<Class name='RageInput'>
<Function name='GetDescriptions' return='{string}' arguments=''>
Return an array of connected input device descriptions.
</Function>
</Class>
<Class name='RageSound'>
<Description>
See <Link class='ActorSound' /> for loading a sound.
</Description>
<Function name='SetProperty' return='void' arguments='string sProperty, float fVal'>
Set the value of <code>sProperty</code> to <code>fVal</code>. The supported properties depend on how the associated <Link class='ActorSound' /> was loaded.
</Function>
<Function name='pitch' return='void' arguments='float fPitch'>
Set the pitch to <code>fPitch</code>. The associated <Link class='ActorSound' /> have <code>SupportsRateChanging = true</code> on load.
</Function>
<Function name='speed' return='void' arguments='float fSpeed'>
Set the speed (that is, the rate at which the sound plays) to <code>fSpeed</code>. The associated <Link class='ActorSound' /> must have <code>SupportsRateChanging = true</code> on load.
</Function>
</Class>
<Class name='ScreenGameplay'>
<Function name='Center1Player' return='bool' arguments=''>
Returns <code>true</code> if a single <Link class='Player' /> has its NoteField centered.
</Function>
<Function name='GetLifeMeter' return='LifeMeter' arguments='PlayerNumber pn'>
Returns the <Link class='LifeMeter' /> for the specified <Link class='ENUM' function='PlayerNumber' /> <code>pn</code>.
</Function>
<Function name='GetNextCourseSong' return='Song' arguments=''>
Returns the next <Link class='Song' /> in the current <Link class='Course' />.
</Function>
</Class>
<Class name='Song'>
<Function name='GetDisplayArtist' return='string' arguments=''>
Returns the displayed artist of the song.
</Function>
<Function name='GetDisplayFullTitle' return='string' arguments=''>
Returns the displayed full title of the song, including subtitle.
</Function>
<Function name='GetDisplayMainTitle' return='string' arguments=''>
Returns the displayed main title of the song.
</Function>
<Function name='GetTranslitArtist' return='string' arguments=''>
Returns the transliterated artist of the song.
</Function>
<Function name='GetTranslitFullTitle' return='string' arguments=''>
Returns the transliterated full title of the song, including subtitle.
</Function>
<Function name='GetTranslitMainTitle' return='string' arguments=''>
Returns the transliterated main title of the song.
</Function>
<Function name='IsLong' return='bool' arguments=''>
Returns <code>true</code> if the song meets the criteria for a &quot;Long Version&quot;.
</Function>
<Function name='IsMarathon' return='bool' arguments=''>
Returns <code>true</code> if the song meets the criteria for &quot;Marathon&quot; length.
</Function>
</Class>
</Classes>
<!-- Enums -->
<Enums>
<Enum name='HorizAlign'>
<Description>
Horizontal alignment. See <Link class='Actor' function='horizalign' />.
</Description>
</Enum>
<Enum name='VertAlign'>
<Description>
Vertical alignment. See <Link class='Actor' function='vertalign' />.
</Description>
</Enum>
</Enums>
</Documentation>