Function chaining for PlayerOptions and SongOptions APIs.

This commit is contained in:
Kyzentun
2014-12-02 19:58:52 -07:00
parent 4f95bf08ad
commit 7a585fcd38
3 changed files with 78 additions and 45 deletions
+8 -1
View File
@@ -3002,6 +3002,13 @@ save yourself some time, copy this for undocumented things:
</Class>
<Class name='PlayerOptions'>
<Description>
All these functions have an optional last argument: If the last argument is the boolean value true, then instead of returning the previous settings as normal, they will instead return the PlayerOptions object.<br />
This allows you to chain them like this:<br />
player_options:Twirl(5, 1, true):Roll(5, true):Dizzy(true):Twirl()<br />
<br />
Special note: Functions that take a bool as their arg must have true as the second arg to be used with chaining.<br />
"player_options:Backwards(true, true):Beat(5)" will chain, "player_options:Backwards(true):Beat(5)" will not chain.<br />
<br />
Most options fall into one of four types: float, int, bool, or enum.<br />
Float type options have this interface:<br />
Option(value, approach_speed)<br />
@@ -3121,7 +3128,7 @@ save yourself some time, copy this for undocumented things:
Changing the noteskin during a song is not supported.<br />
Example:<br />
note_name= options:NoteSkin() -- Sets note_name to the player's current noteskin.<br />
prev_note_name, succeeded= options:NoteSkin("cel") -- Sets prev_note_name to the noteskin the player had set, changes the current noteskin to "cel", sets succeeded to true if the the "cel" noteskin exists.<br />
prev_note_name, succeeded= options:NoteSkin("cel") -- Sets prev_note_name to the noteskin the player had set, changes the current noteskin to "cel", sets succeeded to true if the "cel" noteskin exists.<br />
</Function>
<Function name='Overhead' return='bool' arguments='bool'>
If the player is using Overhead (0 tilt, 0 skew), returns true.<br />