diff --git a/Docs/Luadoc/Lua.xsd b/Docs/Luadoc/Lua.xsd index a4103c434e..c6fb7a00e8 100644 --- a/Docs/Luadoc/Lua.xsd +++ b/Docs/Luadoc/Lua.xsd @@ -143,7 +143,6 @@ - diff --git a/Docs/Luadoc/Lua.xsl b/Docs/Luadoc/Lua.xsl index d7aabdfe4c..bf0562f25c 100644 --- a/Docs/Luadoc/Lua.xsl +++ b/Docs/Luadoc/Lua.xsl @@ -78,16 +78,6 @@ margin: 1px 2px 1px 2px; border: 1px solid #777; } - .sm-ssc{ - text-align: justify; - vertical-align: text-top; - background: #FFDDEE url(./bgline.png) repeat-x scroll 0 0; - padding: 1px; - } - fieldset div.sm-ssc{ - margin: 1px 2px 1px 2px; - border: 1px solid #777; - } ._fallbackTheme{ text-align: justify; vertical-align: text-top; @@ -243,9 +233,8 @@
Function Colors -
Available in SM4 alphas, sm-ssc, and StepMania 5
+
Available in sm-ssc and StepMania 5
Renamed or changed from StepMania 4 alphas
-
New bindings (since StepMania 4 alphas)
Defined in the _fallback theme
Defined in the default theme
@@ -487,7 +476,6 @@ renamed - sm-ssc _fallbackTheme defaultTheme descriptionCell @@ -524,7 +512,6 @@ - sm-ssc descriptionCell diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index a47d7541a4..b0bd9a2393 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -50,7 +50,7 @@ CLAMP is an all-female Japanese mangaka group that formed in the mid 1980s. Erm, I mean... Clamps fValue between fLow and fHigh. - + Closes any connection to an online server. @@ -110,7 +110,7 @@ Returns the current Life Difficulty. - + Returns a string representing the name of the operating system being used. (e.g. "Windows", "Linux", "Mac, "Unknown") @@ -119,7 +119,7 @@ [02 Utilities.lua] Returns a path to a random song background. - + Returns the name of the currently connected server. @@ -251,22 +251,22 @@ Returns the current second. - + Converts fSecs to Minutes:Seconds:Milliseconds format using two digits for each section. - + Converts fSecs to Minutes:Seconds.Milliseconds format using two digits for each section except Minutes (uses 1). - + Converts fSecs to Minutes:Seconds format. Converts fSecs to Minutes:Seconds.Milliseconds format. - + Converts fSecs to Minutes:Seconds.Milliseconds format using two digits for each section. - + Converts fSecs to Minutes:Seconds.Milliseconds format using two digits for each section except Milliseconds (uses 3). @@ -314,7 +314,7 @@ [00 init.lua] Alias for . - + Returns a string with characters escaped for URLs. (e.g. a space becomes '%20') @@ -490,13 +490,13 @@ Plays the commands that follow at an accelerated rate (fRate * fRate), where fRate is in seconds. - + Adds rot to the Actor's current x rotation. - + Adds rot to the Actor's current y rotation. - + Adds rot to the Actor's current z rotation. @@ -532,7 +532,7 @@ Sets the Actor's base Z rotation to rot. - + Sets the Actor's base zoom to zoom. @@ -541,7 +541,7 @@ Sets the Actor's base Y zoom to zoom. - + Sets the Actor's base Z zoom to zoom. @@ -667,16 +667,16 @@ Returns the Actor's base X zoom value. - + Returns the Actor's base Y zoom value. - + Returns the Actor's base Z zoom value. Returns true if the Actor has a command named sCmdName. - + Returns the Actor's current diffuse color. @@ -688,10 +688,10 @@ Returns the Actor's current effect magnitude as three floats (not one; I hate Lua.xsd). - + Returns the Actor's current glow color. - + Returns the Actor's horizontal alignment as a number in the range 0..1. @@ -703,13 +703,13 @@ Returns the Actor's current height. - + Returns the Actor's current X rotation. Returns the Actor's current Y rotation. - + Returns the Actor's current Z rotation. @@ -718,7 +718,7 @@ Returns how much time is remaining for the current tween. - + Returns the Actor's vertical alignment as a number in the range 0..1. @@ -733,7 +733,7 @@ Sets the Actor's glow color. - + @@ -838,7 +838,7 @@ Skews the Actor on the x axis by fAmount. - + Skews the Actor on the y axis by fAmount. @@ -970,10 +970,10 @@ Runs the commands in cmds on the ActorFrame's leaves. - + Sets the ActorFrame's ambient light color to c. - + Sets the ActorFrame's diffuse light color to c. @@ -985,10 +985,10 @@ Sets the field of view for the ActorFrame. - + Currently unimplemented since it does not handle errors correctly. Arguments must be passed in as a table. - + Sets the ActorFrame's specular light color to c. @@ -1024,16 +1024,16 @@ - + Returns the scroller's current item. - + Returns the item the scroller's going to. - + Returns how long it will take for the scroller to completely scroll through all its items. - + Returns the number of items in the ActorScroller. @@ -1075,7 +1075,7 @@ Sets the scroller's mask to a Quad that is fWidth by fHeight pixels. - + Sets the scroller to draw fNumItems items. @@ -1119,7 +1119,7 @@ Loads the sound at sPath. - + Pauses or unpauses the sound based on bPause. @@ -1128,29 +1128,29 @@ [02 Sound.lua] Plays the sound on the given player's side. You must set SupportPan = true on load. - + Stops the sound. - + Returns true if Announcer sAnnouncer exists. - + Returns a table of installed announcers. - + Returns the current announcer's name. - + Sets the announcer to sNewAnnouncer. - + Returns true if the Banner is currently scrolling. - + @@ -1186,7 +1186,7 @@ See . - + @@ -1247,7 +1247,7 @@ Sets the stroke color to c. - + If the text is glowing, specify if just the stroke layer, just the inner layer, or both are affected by the glow. @@ -1261,19 +1261,19 @@ - + Returns the text that is currently set at the exact moment you call it. This is likely only going to be useful in an Update command. - + Sets the BPMDisplay from the specified Course. Sets the BPMDisplay from the GameState. - + Sets the BPMDisplay from the specified Song. - + Sets the BPMDisplay from the specified Steps. @@ -1281,25 +1281,25 @@ Returns the path to the character's card graphic. - + Returns this character's directory. - + Returns this character's ID. - + Returns the path of the dancing animation of this character. - + Returns the character's display name. Returns the path to the character's icon. - + Returns the path of the model of this character. - + Returns the path of the rest animation of this character. @@ -1308,18 +1308,18 @@ Returns the path to the character's ScreenStage icon. - + Returns the path of the warm-up animation of this character. - + Returns a table of all characters installed. Return the corresponding to sID. - + Returns a random character. @@ -1343,16 +1343,16 @@ Returns a table of all the Trails in the Course. - + Returns the path to the Course's background. Returns the path to the Course's banner. - + Returns the Course's directory. - + Returns a table of CourseEntry items. @@ -1376,7 +1376,7 @@ Returns the Course's . (Returns PlayMode in sm-ssc; integer in SM4) - + Returns the name of the person who scripted the Course. @@ -1385,10 +1385,10 @@ Returns the full transliterated title of the Course. - + Returns true if the Course has a background. - + Returns true if the Course has a banner. @@ -1397,7 +1397,7 @@ Returns true if the Course has timed modifiers. - + Returns true if the Course is an edit. @@ -1406,10 +1406,10 @@ Returns true if the Course is Endless. - + Returns true if the Course is Nonstop. - + Returns true if the Course is Oni. @@ -1423,36 +1423,36 @@ Returns the Song that this CourseEntry corresponds to. - + Returns the number of lives gained after completing the song. - + Returns the number of seconds gained after completing the song. - + Returns any stage (non-timed) modifiers. - + Returns the number of modifier changes in this CourseEntry. - + Returns a comma-delimited string representing various facts about the CourseEntry. - + Returns true if this CourseEntry is a fixed song. - + Returns true if this CourseEntry is secret. - + Returns the MD5 hash for the file at sPath. - + Returns the MD5 hash for s. - + Returns the SHA-1 hash for s. @@ -1476,7 +1476,7 @@ - + Returns the index of the last banner loaded. @@ -1500,10 +1500,10 @@ - + Returns any Character associated with this item (or nil if there isn't one). - + Returns any Course that may have been set. @@ -1518,7 +1518,7 @@ Returns any Profile ID that may have been set. - + Returns any screen that may have been set as a string. @@ -1527,7 +1527,7 @@ Returns the name of any song group that may have been set. - + Returns any Steps that may have been set. @@ -1536,10 +1536,10 @@ Returns the display text. - + Returns any Trail that may have been set. - + Returns any Url that may have been set. @@ -1547,7 +1547,7 @@ Return the first for the specified game. - + Returns true if any noteskins exist for the specified Game s. @@ -1563,7 +1563,7 @@ to the right. --> Return the sound balance for pn. - + Plays a sound from the current announcer. @@ -1584,13 +1584,13 @@ Returns true if enough credits have been inserted to join. - + fishpolk.mid; See also: Rise of the Triad Returns the environment table. See . - + Returns the current for the specified . @@ -1609,7 +1609,7 @@ The s in a are numbered sequentially starting from 0. Return the number of the current . - + Return the current number of seconds that have passed in the current song. This value can be negative. @@ -1675,7 +1675,7 @@ Return true if the gameplay lead in is enabled. If false, gameplay begins immediately. - + Return the hardest of the currently selected steps by all players. For example, if player 1 has selected Hard steps and player 2 has selected Medium steps, Hard will @@ -1736,10 +1736,10 @@ Kind of does what it says on the tin. - + [01 compat.lua] Returns the current beat of the song. - + [01 compat.lua] Returns the current beat of the song without an offset. @@ -1760,10 +1760,10 @@ Returns the song options as a string. - + Returns how much of the song is through at beat fBeat. - + Returns the current SongPosition. @@ -1787,7 +1787,7 @@ Returns true if any human player is using a memory card. - + Returns true if playing in Battle mode. @@ -1823,7 +1823,7 @@ Returns true if player pn is the winner. - + Joins player pn. @@ -1838,7 +1838,7 @@ Saves the bookkeeping and machine profile data. - + Sets the current for the specified . @@ -1856,7 +1856,7 @@ Sets if the Jukebox should use modifiers. - + @@ -1880,7 +1880,7 @@ Determines if Judgment W1 should be shown based on bOn. - + Unjoins player pn. @@ -1918,6 +1918,9 @@ Returns two tables representing the tips and alternate tips in the HelpDisplay. + + [02 HelpDisplay.lua] Sets the tips from a Song or Course. + Sets the seconds between switches of tips to fSeconds. @@ -1935,10 +1938,10 @@ Returns the Grade of this high score. - + Return the number of HoldNoteScores that match hns. - + Returns the modifiers used for this HighScore. @@ -1947,7 +1950,7 @@ Returns the percentage of dance points associated with the high score. - + Returns the RadarValues for this HighScore. @@ -1956,7 +1959,7 @@ Returns the number of seconds survived associated with the high score. - + Return the number of TapNoteScores that match tns. @@ -1977,12 +1980,12 @@ - + - + Returns the X position of the mouse. - + Returns the Y position of the mouse. @@ -2001,29 +2004,29 @@ - + Returns the number of lives remaining. - + Returns the number of total lives. - + Returns true if player pn's card is locked. Return the state for player pn. - + Returns the name of the storage device. - + Returns true if player pn's name is available. - + Returns the current MenuTimer's value. @@ -2072,7 +2075,7 @@ Sets the model's default animation to sAnimation at fPlayRate speed (default 1.0). - + Returns the number of states the Model has. @@ -2119,39 +2122,39 @@ Returns the actor for the specified sButton sElement using NoteSkin sNoteSkin. - + Returns true if the strName noteskin exists in the current gametype. - + Returns a table of noteskin names for the current gametype. - + Returns true if the first item in the row goes down. - + Returns an index of the choice in the row that player pn is on. - + Returns the OptionRow's layout type. - + Returns the name of the OptionRow. - + Returns the number of choices in this OptionRow. - + Returns the row title string. - + Returns the OptionRow's select type. - + Returns true if this row is focused by player pn. - + Returns true if this row forces one choice on all players. @@ -2171,230 +2174,230 @@ Returns the of player pn. - + Returns the Steps located at index in the current steps queue. - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + Returns the current NoteSkin set in the PlayerOptions. - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + Changes the player's noteskin to noteskin. - + Returns true if the player is using reverse. (equivalent to GetReverse() == 1) @@ -2402,13 +2405,13 @@ Returns true if a full combo (TNS_W3 and up) was obtained. - + Returns true if a full combo (tns and up) was obtained. Returns the number of Dance Points obtained by the player. - + Returns how long the player has been alive. @@ -2417,7 +2420,7 @@ Returns the number of calories burned. - + Returns the current possible maximum score. @@ -2426,10 +2429,10 @@ Returns the player's current life from 0..1. - + Returns the player's current miss combo. - + Returns the number of Dance Points possible to be obtained by the player. @@ -2462,7 +2465,7 @@ Returns a table of played steps. - + Gets the percentage of taps that were scored as tns. @@ -2474,10 +2477,10 @@ Returns a table of possible steps. - + Returns a RadarValues object representing the player's actual performance. - + Returns a RadarValues object representing the total values for the song. @@ -2512,24 +2515,24 @@ Returns true if the player was disqualified from ranking. - + Sets the current possible maximum score. - + Sets the Player's score to iScore. - + Returns the current PlayerOptions for this PlayerState. - + Returns the HealthState for this PlayerState. - + Returns the multiplayer number for this PlayerState. - + Returns the PlayerController for this PlayerState. @@ -2538,13 +2541,13 @@ Returns a PlayerOptions object for the specified ModsLevel. - + Returns a string of player options for the specified ModsLevel. (was GetPlayerOptions in v1.2.2 and prior) Returns a table of strings, containing the player options for the specified ModsLevel. - + Returns the SongPosition for this PlayerState. @@ -2555,7 +2558,7 @@ Return the value of the preference sPreference. - + Return true if preference sPreference exists. @@ -2599,6 +2602,9 @@ Gets the profile's HighScoreList for a specified Song and Steps. (Alternate arguments for Courses: Course c, Trail t) + + Returns the last used high score name. + Returns the number of Toasties gotten using the specified profile. @@ -2638,7 +2644,7 @@ Returns the number of Jumps stepped on. - + Returns the number of successful Lifts. @@ -2668,7 +2674,7 @@ Returns true if the specified code sUnlockEntryID is unlocked. - + Sets the current for the Profile. @@ -2684,13 +2690,13 @@ Sets how much the player weighs (in pounds) to weightPounds. - + Returns the amount of time this profile has spent in gameplay (in seconds). - + Returns the number of sessions this profile has had. - + Returns the total session length (in seconds) of this profile. @@ -2708,19 +2714,19 @@ Returns the profile for player pn. - + Returns the profile directory of the specified ProfileSlot. Returns true if player pn's profile is persistent. - + Returns true if Song s has never been played before (according to the machine profile). - + Returns true if the last load of player pn's profile was a LastGood copy of the profile. - + Returns true if the last load of player pn's profile resulted in a tampered or corrupt profile. @@ -2745,7 +2751,7 @@ These commands require a RageFile handle. You can create one using . - + Returns true if the current position within the file is the end. (EOF = End of File) @@ -2774,13 +2780,13 @@ Returns a string containing the entire contents of the file. - + Returns length bytes from the RageFile's current position. Seeks to a position in the file and returns the new position. - + Returns the current position in the file. @@ -2788,16 +2794,16 @@ - + Returns true if a file exists at sPath. - + Returns a listing of files from sPath. The last two arguments are optional (and default to false). - + Returns a file's size in bytes. - + Returns the hash of the file at sPath. @@ -2819,7 +2825,7 @@ Sets the speed (that is, the rate at which the sound plays) to fSpeed. The associated must have SupportsRateChanging = true on load. - + Sets the volume to fVolume, which is between 0..1. @@ -2838,7 +2844,7 @@ - + Loads the metrics for this RollingNumbers from sGroupName. @@ -2849,7 +2855,7 @@ Returns the name of the next Screen. - + Returns the name of the previous Screen. @@ -2860,7 +2866,7 @@ - + Returns the current . @@ -2888,10 +2894,10 @@ Sets the next Screen to be loaded. - + Returns true if the game is paused. - + Pauses or unpauses the game, depending on the value of bPause. @@ -2901,13 +2907,13 @@ - + Adds a screen at the top of the screen stack. Gets the screen at the top of the screen stack. - + Reloads any loaded overlay screens. @@ -2952,21 +2958,21 @@ - + Returns the number of active players. - + Returns true if all active players are on the last options row. - + Returns true if the specified player is on an items that ends the screen. Returns the current row that player pn is on. (Was previously GetCurrentRow.) - + Returns the specified OptionRow. @@ -2992,7 +2998,7 @@ - + Returns player pn's current selected item as an integer. @@ -3000,10 +3006,10 @@ Returns true if the player is going to the options screen. - + Returns the MusicWheel used on this screen. - + Opens the OptionsList for Player pn @@ -3032,7 +3038,7 @@ See the Changelog for details on TextEntrySetting's format. - + Sets up a ScreenTextEntry's values. @@ -3051,13 +3057,13 @@ Returns the path to the song's banner. - + Gets the path to the CDTitle. Returns the displayed artist of the song. - + Returns a table of 2 floats containing the display BPMs. @@ -3081,28 +3087,28 @@ Returns the last beat of the song. - + Gets the path to the lyrics. - + Gets the path to the music file. Returns a Step object if the StepType and Difficulty exist. - + Gets the Song's origin. Returns the song's directory. - + Returns the songfile path. Returns a table of Steps that have StepsType st. - + Returns how long the longest stepchart is in seconds. @@ -3123,49 +3129,49 @@ Returns true if the song has steps for the specified difficulty in st. - + Returns true if the song has attacks. - + Returns true if the song has a background. - + Returns true if the song has a banner. - + Returns true if the song has BGChanges. - + Returns true if the song has a CDTitle. - + Returns true if the song has edits. - + Returns true if the song has lyrics. - + Returns true if the song has music. - + Returns true if the song has significant elephants or bison. - + Returns true if the song has . - + Returns true if the song's DisplayBPM is constant. - + Returns true if the song's DisplayBPM is random. - + Returns true if the song's DisplayBPM is secret. - + Returns true if the song is considered easy. - + Returns true if the song is enabled. @@ -3180,7 +3186,7 @@ Returns the length of the song in seconds. - + Returns true if the song is normally displayed. @@ -3200,7 +3206,7 @@ Returns the course color of Course c. - + Returns a table containing all of the course group names. @@ -3246,54 +3252,54 @@ Returns the song group color of sGroupName. - + Returns a table containing all of the song group names. - + Returns the rank (popularity) of Song s. - + Returns a table containing all of the songs in group sGroupName. - + Returns the shortened group name (based on entries in Translations.xml). - + Loads preferred courses from {theme}/Other/SongManager sListName.txt. - + Loads preferred songs from {theme}/Other/SongManager sListName.txt. - + Returns the current beats per second. - + Returns true if a Delay is active. - + Returns true if a Freeze is active. - + - + - + - + - + - + Returns the row where a warp appears. - + Returns the warp destination length. @@ -3301,10 +3307,10 @@ Returns the length of the animation in seconds. - + Return the number of states this Sprite has. - + Returns the Sprite's current state (frame number in a multi-frame sprite). @@ -3365,13 +3371,13 @@ Set the texture coordinate velocity which controls how the Sprite changes as it animates. - + Crops the Sprite to fWidthxfHeight. [01 alias.lua] Alias for CropTo. - + Sets all the state delays to fRate. Useful for Sprites that need to change by BPM (e.g. Tran from DDR 5th Mix, the cube from DS EuroMix 2). @@ -3439,7 +3445,7 @@ Returns the author that made that particular Steps pattern. - + Returns the Chart Style for this Steps. @@ -3451,14 +3457,14 @@ Returns the Steps filename from the Cache. - + Returns a hash of the Steps. Returns the numerical difficulty of the Steps. - - Returns true if the song has significant timing changes. + + returns true if the song has significant timing changes. Returns the complete list of RadarValues for player pn. Use to grab a specific value. @@ -3466,19 +3472,19 @@ Returns the Steps type. - + Returns the TimingData for the Steps. - + Returns true if the Steps are an edit. - + Returns true if the Steps are a player edit (loaded from a profile). Returns true if the steps were automatically generated. - + Returns true if the Steps use different TimingData from the Song. @@ -3500,7 +3506,7 @@ - + Returns the number of total tracks this Style contains (e.g. 4 for dance-versus, but 8 for dance-double). @@ -3512,7 +3518,7 @@ Returns the StyleType for this Style. - + Returns true if the Style needs to be zoomed out with two players. @@ -3528,10 +3534,10 @@ - + Returns the current language. - + Returns the theme's current directory. @@ -3552,75 +3558,75 @@ returns three strings: BGAnimation ResolvedPath, MatchingMetricsGroup, MatchingElement. Used in LoadFallbackB in themes/_fallback/02 Other.lua. (Lua.xsd sucks) - + Returns the path of an element in the Other folder. Returns the path of an element in the Sounds folder. - + Returns a table of selectable theme directories. Returns the value of Element in Class for the currently loaded language. - + Returns the author of the current theme or "[unknown author]". - + Returns the display name of the current theme. - + Reloads the current theme's metrics. - + Returns the minimum and maximum BPM of the song in a table (in that order). - + Returns the beat from fElapsedTime. - + Returns the BPM at fBeat. - + Returns a table of the BPMs as strings. - + Returns a table of the BPMs and the times they happen as strings with the format "beat=BPM". Returns the elapsed time from fBeat. - + Returns a table of the Stops and the times they happen as strings with the format "beat=stop seconds". - + Returns a table of the Delays and the times they happen as strings with the format "beat=stop seconds". - + Returns a table of the Labels and the times they happen as strings with the format "beat=label name." - + Returns true if the TimingData contains BPM changes. - + Returns true if the TimingData contains any BPM changes with a negative BPM. Returns true if the TimingData contains stops. - + Returns true if the TimingData contains warps. - - Returns true if the TimingData contains fake segments. + + returns true if the TimingData contains fake segments. - + Returns true if the TimingData contains speed scrolling changes. - + Returns true if the TimingData contains general scrolling changes. @@ -3631,7 +3637,7 @@ Returns the Trail's difficulty. - + Returns a table of TrailEntry items. @@ -3643,21 +3649,21 @@ Returns the Trail's StepsType. - + Returns the TrailEntry at index iEntry. - + Returns a string of modifiers used in this TrailEntry. Returns the Song used in this TrailEntry. - + Returns the Steps used in this TrailEntry. - + (why'd I think this was a good idea when we have ?) @@ -3669,10 +3675,10 @@ Sets the UnlockEntry's course to sCourseName.
Example: course,"Driven"
- + Returns the code for this unlock. - + Returns the Course for this unlock. @@ -3728,10 +3734,10 @@ Returns the number of all unlock items, regardless of status. - + Returns the number of points for the machine profile based on the specified UnlockRequirement. - + Returns the number of points for the specified profile based on the specified UnlockRequirement. @@ -3758,25 +3764,25 @@ - + Returns the wheel's current index. - + Returns the total number of items in the wheel. Returns the WheelItem at index iIndex. - + Returns true if the wheel is locked. - + Returns true if the wheel is settled/stopped moving. - + Moves the wheel by n. - + Attempts to set the open section to sSection. diff --git a/Docs/credits.txt b/Docs/credits.txt index 55c8ad396b..b7cb9c0177 100644 --- a/Docs/credits.txt +++ b/Docs/credits.txt @@ -68,7 +68,7 @@ David Santamar * Various patches (see Changelog_sm-ssc.txt for more details and links) Kita K./D. Trucks - * sm-ssc default theme music + * default theme music kurisu * Dance-threepanel gametype code (3.9; re-adapted for sm-ssc) diff --git a/Themes/default/Graphics/ScreenGameplay BPMDisplay.lua b/Themes/default/Graphics/ScreenGameplay BPMDisplay.lua index 3bed3203ec..11e8e0ee9a 100644 --- a/Themes/default/Graphics/ScreenGameplay BPMDisplay.lua +++ b/Themes/default/Graphics/ScreenGameplay BPMDisplay.lua @@ -1,8 +1,62 @@ -return Def.SongBPMDisplay { +-- check if players are playing steps with different timingdata. +local numPlayers = GAMESTATE:GetNumPlayersEnabled() + +local displaySingle = Def.SongBPMDisplay { File=THEME:GetPathF("BPMDisplay", "bpm"); Name="BPMDisplay"; InitCommand=cmd(zoom,0.675;shadowlength,1); SetCommand=function(self) self:SetFromGameState() end; CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); -}; \ No newline at end of file +}; + +if numPlayers == 1 then + return displaySingle +else + -- check if both players are playing the same steps + local stepsP1 = GAMESTATE:GetCurrentSteps(PLAYER_1) + local stepsP2 = GAMESTATE:GetCurrentSteps(PLAYER_2) + + local stP1 = stepsP1:GetStepsType() + local stP2 = stepsP2:GetStepsType() + + local diffP1 = stepsP1:GetDifficulty() + local diffP2 = stepsP2:GetDifficulty() + + if stP1 == stP2 and diffP1 == diffP2 then + -- both players are using the same steps; only need one. + return displaySingle + end + + -- otherwise, we have some more work to do. + local timingP1 = stepsP1:GetTimingData() + local timingP2 = stepsP2:GetTimingData() + + local function UpdateBPM(self) + local dispP1 = self:GetChild("DisplayP1") + local dispP2 = self:GetChild("DisplayP2") + + -- needs current bpm for p1 and p2 + for pn in ivalues(PlayerNumber) do + local bpmDisplay = (pn == PLAYER_1) and dispP1 or dispP2 + local pState = GAMESTATE:GetPlayerState(pn); + local songPosition = pState:GetSongPosition() + local bpm = songPosition:GetCurBPS() * 60 + bpmDisplay:SetText( string.format(%.2f,bpm) ) + end + end + + local displayTwoPlayers = Def.ActorFrame{ + -- manual bpm displays + LoadFont("BPMDisplay", "bpm")..{ + Name="DisplayP1"; + InitCommand=cmd(zoom,0.675;shadowlength,1); + }; + LoadFont("BPMDisplay", "bpm")..{ + Name="DisplayP2"; + InitCommand=cmd(zoom,0.675;shadowlength,1); + }; + }; + + displayTwoPlayers.InitCommand=cmd(SetUpdateFunction,UpdateBPM); +end \ No newline at end of file