diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index c853815376..e4c5a6d79e 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -5,7 +5,37 @@ from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt. ________________________________________________________________________________ ================================================================================ -StepMania 5.0 Preview 2 | 201107?? +StepMania 5.0 ????????? | 20110??? +-------------------------------------------------------------------------------- + +2011/07/05 +---------- +* [ScreenEdit] Restore dance-couple and pump-couple for editing purposes. + Saving should still work, but this was never tested yet. [Wolfman2000] +* [ScreenOptions] Mini is now ITG Mini, and Tiny is now Pump Pro Mini. + This will prevent many prior courses from breaking. [sharksoda, Wolfman2000] +* [CharacterManager] Add a lua function to check how many characters you have. + For an example of how this is used, check the default theme's scripts + folder, specifically 03 ThemePrefs.lua. [Wolfman2000] + +2011/07/04 +---------- +* [ScreenEdit] Add a function to switch the notes the routine players have to + hit. In simple terms, Player 1's notes are now Player 2's and vice~versa. + Check it out in the Alter Menu. [Wolfman2000] +* [ScreenEdit] Add two routine mirroring functions. Now you can build sections + of a chart for one player, and mirror the effect for the other player when + finished. For Pump players, it is not a straight mirror, but is more akin + to what is found via normal routine charts. In other words, you'll be happy. + Check it out in the Alter Menu. [Wolfman2000] + +2011/07/03 +---------- +* [ScreenEdit] Fix a crash if one tries to remove an attack that doesn't + exist at that time. [Wolfman2000] + +================================================================================ +StepMania 5.0 Preview 2 | 20110703 -------------------------------------------------------------------------------- 2011/07/03 diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml index ed192118a5..a3bf6efb82 100644 --- a/Docs/Luadoc/Lua.xml +++ b/Docs/Luadoc/Lua.xml @@ -153,6 +153,7 @@ + @@ -579,6 +580,7 @@ + @@ -932,6 +934,7 @@ + @@ -1477,8 +1480,8 @@ - + @@ -2130,9 +2133,9 @@ - + - StepMania 5 v5.0 Preview 1a - 2011-06-24 + StepMania 5 v5.0 Preview 2 + 2011-07-04 diff --git a/Docs/Luadoc/Lua.xsl b/Docs/Luadoc/Lua.xsl index 01f3657220..72271aec39 100644 --- a/Docs/Luadoc/Lua.xsl +++ b/Docs/Luadoc/Lua.xsl @@ -400,6 +400,7 @@ $type='LuaOptionRow' or $type='ActorDef' or $type='chunk' or + $type='unsigned' or $type='various'"> diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index 40d229921d..3163e5b0da 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -23,6 +23,9 @@ + + [03 HSV.lua] Returns a color with the specified alpha. + [02 StageMods.lua] @@ -36,10 +39,10 @@ Returns the base name of file path. - [02 Colors.lua] + [02 Colors.lua] Boosts the specified color by multiplying its values by fBoost. - [03 HSV.lua] + [03 HSV.lua] Modifies the brightness of the specified color. [03 ProductivityHelpers.lua] Returns true if Center 1P is being used. @@ -48,7 +51,8 @@ [03 Gameplay.lua] - CLAMP is an all-female Japanese mangaka group that formed in the mid 1980s. Erm, I mean... Clamps fValue between fLow and fHigh. + 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. @@ -59,6 +63,21 @@ Returns a color from a string. color can be in hex ("#FFFFFFFF") or 0..1 values ("1.0,1.0,1.0,1.0"), in RGBA order. + + [02 Colors.lua] Returns a darker tone of the color. (Specifically c[1]/2, c[2]/2, c[3]/2, c[4]) + + + [02 Colors.lua] Returns a lighter tone of the color. (Specifically c[1]+(c[1]/2), c[2]+(c[2]/2), c[3]+(c[3]/2), c[4]) + + + [02 Colors.lua] Returns a midtone of the color. (Specifically c[1]/1.5, c[2]/1.5, c[3]/1.5, c[4]) + + + [03 HSV.lua] Returns a hex representation for the specified color. + + + [03 HSV.lua] Takes in a color and returns a table with the HSV values. + [03 Gameplay.lua] Determines what TapNoteScore allows for continuing the combo. @@ -68,6 +87,12 @@ [03 Gameplay.lua] Determines if combo should be per row (Jump = 1) or per column (Jump = 2). + + [02 Other.lua] The combo trasform command. + + + [03 Gameplay.lua] Returns the UserPrefComboUnderField user preference value. + Tries to connect to the server at sAddress. @@ -77,14 +102,23 @@ Returns the current day of the year. + + [02 Serialize] Recursively deep-copy a table. + [01 base.lua] "Override Lua's dofile to use our loadfile." + + [02 Utilities.lua] + + + [02 Utilities.lua] Return the index of a true value in list. + [02 Utilities.lua] Find a key in tab with the given value. - - [02 Utilities.lua] Return the index of a true value in list. + + func takes a key and a value. Returns the number passed to the function followed by its suffix ("th", "nd", and so on). @@ -98,6 +132,12 @@ Returns the corresponding CustomDifficulty string for a StepsType/Difficulty (/optional CourseType) combination. + + [04 Scoring.lua] "Get the radar values directly. The individual steps aren't used much." + + + [02 Other.lua] Returns a string with the Edit Mode SubScreens. + [03 EnvUtils2.lua] Returns the value of name from the Env table. @@ -113,21 +153,45 @@ Returns a string representing the name of the operating system being used. (e.g. "Windows", "Linux", "Mac, "Unknown") + + [03 ProductivityHelpers.lua] "This returns a profile, preferably a player one. If there isn't one, [it falls] back on the machine profile." + [03 ThemePrefs.lua] Returns true if player pn is using ProTiming. [02 Utilities.lua] Returns a path to a random song background. + + [03 ProductivityHelpers.lua] + + + [03 ProductivityHelpers.lua] + + + Returns the display aspect ratio. + Returns the name of the currently connected server. [02 Utilities.lua] Returns a path to the current songs background. + + [03 Gameplay.lua] + Returns the theme's aspect ratio. + + [03 ThemePrefs.lua] (Alias for .) + + + Returns the current Timing difficulty. + + + [04 Scoring.lua] "Retrieve the amount of taps/holds/rolls involved." Used in some scoring formulas. + [03 UserPreferences2.lua] Themer-facing function for getting a user preference. @@ -140,9 +204,38 @@ [03 UserPreferences2.lua] Themer-facing function for getting a user preference as a number. + + [03 HSV.lua] Returns the color's alpha if it has any, otherwise returns 1. + + + [03 Gameplay.lua] Returns the value to start showing the combo at. + + + [03 Gameplay.lua] Returns true if you need to step on hold heads to activate them. + + + [03 Gameplay.lua] Returns 0 in pump mode, TimingWindowSecondsHold preference value in any other game mode. + Returns the current hour. + + [03 HSV.lua] Converts a color from HSV values to something StepMania can understand. + hue is from 0-360, saturation and value are 0..1 + + + [03 HSV.lua] Converts a color from HSV values with alpha to something StepMania can understand. + hue is from 0-360, saturation, value, and alpha are 0..1 + + + [03 HSV.lua] "Converts a set of HSV values to a color." + + + [03 HSV.lua] "Takes in a normal color and returns the hex representation. (Adapted from code in LuaBit)" + + + [03 HSV.lua] Changes the hue of the input color. + [03 ThemePrefs.lua] Initializes various user preferences. @@ -206,6 +299,12 @@ Returns the current Minute. + + [03 Gameplay.lua] Returns the value to start showing the miss combo at. + + + Creates a module. See the Lua manual for more details. + Returns the current month of the year. @@ -215,6 +314,20 @@ Returns Month m as a string. + + "Allows a program to traverse all fields of a table. Its first argument is a + table and its second argument is an index in this table. + next returns the next index of the table and its associated value." + See the Lua manual for more details. + + + [03 ThemePrefs.lua] Returns a Lua option row for ProTiming. + + + "Returns three values: the function, the table t, and nil, + so that the construction for k,v in pairs(t) do body end + will iterate over all key–value pairs of table t." + [03 ProductivityHelpers.lua] Converts a PlayerNumber into a short string (e.g. "P1", "P2"). @@ -233,6 +346,16 @@ Returns the product version. + + "Checks whether v1 is equal to v2, without invoking any metamethod." + + + "Gets the real value of t[index], without invoking any metamethod." + + + "Sets the real value of t[index] to value, without invoking any metamethod." + The modified t is then returned. + [02 ActorDef.lua] @@ -242,12 +365,27 @@ [03 UserPreferences2.lua] (internal) Reads the specified user preference from its config file. + + Sends the current style to the server. + + + Loads the specified module. See the Lua manual for more information. + [02 Utilities.lua] Round a number. + + [03 HSV.lua] Modifies the saturation of the specified color + [03 Gameplay.lua] Returns the primary ScoreKeeper class to use. + + [00 alias.lua, 02 Other.lua] alias for . + + + [00 alias.lua, 02 Other.lua] alias for . + Returns the current second. @@ -269,12 +407,20 @@ Converts fSecs to Minutes:Seconds.Milliseconds format using two digits for each section except Milliseconds (uses 3). + + "If index is a number, returns all arguments after argument + number index. Otherwise, index must be the string + "#", and [it] returns the total number of extra arguments it received." + [02 Branches.lua] Determines the correct music/course selection screen to use and returns it. [03 Gameplay.lua] (soon to be deprecated) Returns a list of codes to use on ScreenSelectProfile. + + [02 Serialize.lua] Serialize the table t. + [03 EnvUtils2.lua] Sets the value of name to value in the Env table. @@ -299,6 +445,12 @@ [02 ActorDef.lua] + + [02 Utilities.lua] Returns a shuffled version of t. + + + [02 Utilities.lua] Returns a slice of the specified table of size num. + [02 Utilities.lua] Look up each value in a table, returning a table with the resulting strings. @@ -308,42 +460,64 @@ [03 ProductivityHelpers.lua] Converts a string or number to a bool. + + Tries to convert e to a number. Returns nil if + it can't convert the input to a number. (base is optional.) + + + Converts e to a string. + [02 Enum.lua] Returns a string representing an enum starting from '_'. For example, passing PlayerNumber_P1 to this function will return P1. [00 init.lua] Alias for . + + Returns the type of the object as a string. See the Lua manual for valid return values. + + + "Returns the elements from the given table. + This function is equivalent to return list[i], list[i+1], ···, list[j]" + (i and j are optional; "by default, i is 1 and j is the length of the list.") + Returns a string with characters escaped for URLs. (e.g. a space becomes '%20') [01 base.lua] Alias for lua.GetThreadVariable. + + Returns the current version's build date. + + + Returns the current version's build time. + [00 init.lua] Alias for . [04 WidescreenHelpers.lua] Depending on the screen width, scales between ar43 (4:3; 640px) and ar169 (16:9; 854px). + + [02 Utilities.lua] + [02 ActorDef.lua] Wraps the children in an ActorFrame. [04 FileUtils.lua] Writes buf to the file at path. + + [03 GamePreferences.lua] + [03 UserPreferences2.lua] (internal) Writes user preference prefName to its config file with value being tostring'd. Returns the current year. - - - - [03 ThemePrefs.lua] Returns a Lua option row for ProTiming. - [03 ThemePrefs.lua] Returns a Lua option row for toggling AutoSetStyle. @@ -367,9 +541,16 @@ + + Returns the for the file at sPath. + Returns true if sClassName is a registered Class. + + Loads all commands and sets X and Y for the specified Actor. + + @@ -414,6 +595,20 @@ + + Returns true if the type of v is sType. + + + Flushes log files to disk. + + + + Tries to read the file at sPath. If successful, it returns the file's contents. + If unsuccessful, it returns two values: nil and "error". + + + Calls func(...) with two LuaThreadVariables set, and returns the return values of func(). + Writes sString to log.txt. Aliased by . @@ -422,9 +617,6 @@ Writes sString to info.txt and log.txt as a warning. Aliased by . - - Flushes log files to disk. - @@ -563,7 +755,21 @@ [02 Actor.lua] - [02 Actor.lua] Centers an Actor. + [02 Actor.lua] Centers an Actor on the screen. (equivalent to x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y) + + + [03 ProductivityHelpers.lua] Centers an Actor on the X axis. (equivalent to x,SCREEN_CENTER_X) + + + [03 ProductivityHelpers.lua] Centers an Actor on the y axis. (equivalent to y,SCREEN_CENTER_Y) + + + Determines if the z-buffer should be cleared or not. + + + [02 Actor.lua] Combines multiple interpolators for complex tweens. tweens + can either be a string like "linear,0.25,accelerate,0.75" or + a table with tween information { {Type="linear", Percent=0.25, Bezier=nil}, {Type="accelerate", Percent=0.75, Bezier=nil} } Crops percent of the Actor from the bottom, where percent is in the range 0..1. @@ -856,6 +1062,9 @@ Stops any effect the Actor has. + + Stops any tweening. + Stretches the Actor to a rectangle of a specific size. @@ -880,6 +1089,12 @@ Set the z position of the Actor to zPos. + + Sets the z bias to fBias. + + + Enables/disables z-buffer depending on bUse. + Zooms the Actor to zoom scale. @@ -901,19 +1116,19 @@ Zooms the Actor to zoom scale on the Z axis. + + Sets the z testing mode to write on pass if true, turns it off if false + + + Sets the z testing mode to testMode. + + + Sets z writing to true or false based on bWrite. + [02 Actor.lua] - - [02 Actor.lua] Centers an Actor on the screen. (equivalent to x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y) - - - [03 ProductivityHelpers.lua] Centers an Actor on the X axis. (equivalent to x,SCREEN_CENTER_X) - - - [03 ProductivityHelpers.lua] Centers an Actor on the y axis. (equivalent to y,SCREEN_CENTER_Y) - [02 Actor.lua] Stretches an Actor to cover the screen. (equivalent to stretchto,0,0,SCREEN_WIDTH,SCREEN_HEIGHT) @@ -1166,7 +1381,7 @@ Loads the card image from the specified Character. - + Loads the banner from the cache based on sPath (typically or ). Loads a Banner from a specified Course. @@ -1325,6 +1540,9 @@ Returns a random character. + + Returns the number of characters available. + @@ -1455,6 +1673,9 @@ Returns the MD5 hash for s. + + Returns the SHA-1 hash for the file at sPath. + Returns the SHA-1 hash for s. @@ -2007,6 +2228,9 @@ + + Changes the player's life by iNumLives. (Negative values subtract lives.) + Returns the number of lives remaining. @@ -2707,7 +2931,9 @@ - + + Returns the Profile for the specified profile ID. + @@ -2729,6 +2955,9 @@ Returns true if Song s has never been played before (according to the machine profile). + + Returns true if pn's Profile was loaded from a memory card. + Returns true if the last load of player pn's profile was a LastGood copy of the profile. @@ -2864,12 +3093,21 @@ Returns the name of the previous Screen. + + Returns the ScreenType for this Screen. + Locks input for f seconds. + + [02 Other.lua] Gets a metric from the current Screen. + Posts a message with the text sScreenMsg to the Screen. + + [02 Other.lua] Gets a string from the current Screen in the current language. + @@ -3340,6 +3578,9 @@ Load the song banner texture at sPath. + + [02 Sprite.lua] Loads the background from the current Song or the first Trail entry. + [02 Sprite.lua] Load the texture for song's background. @@ -3352,6 +3593,9 @@ Set the to mode. + + Sets the number of seconds into the animation to fSeconds. + Set the texture to texture. @@ -3797,7 +4041,9 @@ Returns the UnlockEntry index to celebrate. - + + Sets the preferred Song/Course to the specified sUnlockEntryID + Unlocks an entry by ID. diff --git a/NoteSkins/pump/default/UpLeft Explosion.lua b/NoteSkins/pump/default/UpLeft Explosion.lua index 9127b0764b..a6e9d779ee 100644 --- a/NoteSkins/pump/default/UpLeft Explosion.lua +++ b/NoteSkins/pump/default/UpLeft Explosion.lua @@ -15,10 +15,9 @@ return Def.ActorFrame { --tap NOTESKIN:LoadActor(Var "Button", "Ready Receptor")..{ Name="Tap"; - Frames = { { Frame = 2 } }; + --Frames = { { Frame = 2 ; Delay = 1 } }; TapCommand=cmd(finishtweening;diffusealpha,1;zoom,1;linear,0.2;diffusealpha,0;zoom,1.2); - - InitCommand=cmd(playcommand,"Tap"); + InitCommand=cmd(pause;setstate,2;playcommand,"Tap"); HeldCommand=cmd(playcommand,"Tap"); ColumnJudgmentMessageCommand=cmd(playcommand,"Tap"); --TapNoneCommand=cmd(playcommand,"Tap"); diff --git a/Themes/_fallback/BGAnimations/ScreenCredits overlay.lua b/Themes/_fallback/BGAnimations/ScreenCredits overlay.lua index 57eea2c09a..e1a275011b 100644 --- a/Themes/_fallback/BGAnimations/ScreenCredits overlay.lua +++ b/Themes/_fallback/BGAnimations/ScreenCredits overlay.lua @@ -25,7 +25,8 @@ local ssc = { } local sm_ssc = { - "Jason Felds (wolfman2000)", + "Jason Felds (wolfman2000)", -- Timing Segments, Split Timing, optimization + "Thai Pangsakulyanont (theDtTvB)", -- BMS, Split Timing, optimization "Alberto Ramos (Daisuke Master)", "Jack Walstrom (FSX)", } @@ -39,9 +40,10 @@ local stepmania = { local contrib = { "Aldo Fregoso (Aldo_MX)", -- delays - "Chris Eldridge (kurisu)", -- dance-threepanel "cerbo", "cesarmades", -- pump/cmd* noteskins + "Chris Eldridge (kurisu)", -- dance-threepanel + "Christophe Goulet-LeBlanc (Kommisar)", "corec", -- various fixes "galopin", -- piu PlayStation2 usb mat support "gholms", -- automake 1.11 support @@ -49,9 +51,8 @@ local contrib = { "Kaox", -- pump/default noteskin "NitroX72", -- pump/frame noteskin "sy567", -- beginner helper fix - "Thai Pangsakulyanont (theDtTvB)", "v1toko", -- x-mode from StepNXA - "Christophe Goulet-LeBlanc (Kommisar)", + "waiei", -- custom scoring fixes + Hybrid scoring } local thanks = { @@ -71,7 +72,7 @@ local thanks = { local shoutout = { "The Lua team", -- lua project lead or some shit. super nerdy but oh hell. - "Mojang", -- minecraft forever -freem + "Mojang AB", -- minecraft forever -freem "NAKET Coder", "Ciera Boyd", -- you bet your ass I'm putting my girlfriend in the credits --Image(), -- we should have some logos probably to look super pro diff --git a/Themes/_fallback/Fonts/frutiger 24px [main-stroke] 16x16.png b/Themes/_fallback/Fonts/frutiger 24px [main-stroke] 16x16.png index 66f6fd79b3..cc9d1d62af 100644 Binary files a/Themes/_fallback/Fonts/frutiger 24px [main-stroke] 16x16.png and b/Themes/_fallback/Fonts/frutiger 24px [main-stroke] 16x16.png differ diff --git a/Themes/_fallback/Fonts/frutiger 24px [main] 16x16.png b/Themes/_fallback/Fonts/frutiger 24px [main] 16x16.png index 1963076070..bf737d6d3e 100644 Binary files a/Themes/_fallback/Fonts/frutiger 24px [main] 16x16.png and b/Themes/_fallback/Fonts/frutiger 24px [main] 16x16.png differ diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index adbb6deadc..3029e65fda 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -914,6 +914,7 @@ Insert=Insert Insert Credit=Insert Credit Insert beat and shift down=Insert beat and shift down Insert Entry=Insert Entry +Invert notes' player=Invert player notes (routine only) Jumps=Jumps Key Joy Mappings=Config Key/Joy Mappings Language=Language @@ -931,6 +932,8 @@ MenuTimer=Menu Timer Meter=Meter Min BPM=Min Specified BPM Mines=Mines +Mirror Player 1 to 2=Mirror P1's notes to P2 (routine only) +Mirror Player 2 to 1=Mirror P2's notes to P1 (routine only) MoveRandomToEnd=Random At End More Options=More Options MovieColorDepth=Movie Color diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index f7dea506c8..af2595f13a 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -200,8 +200,8 @@ DrunkOffsetFrequency=10 DrunkArrowMagnitude=0.5 BeatOffsetHeight=15 BeatPIHeight=2 -MiniPercentBase=0.5 -MiniPercentGate=1 +TinyPercentBase=0.5 +TinyPercentGate=1 DizzyHoldHeads=false QuantizeArrowYPosition=false @@ -2199,22 +2199,23 @@ Accel,5="mod,boomerang;name,Boomerang" # Accel,5="mod,expand;name,Expand" # Accel,6="mod,boomerang;name,Boomerang" -Effect="14;selectmultiple" +Effect="15;selectmultiple" EffectDefault="mod,no drunk,no dizzy,,no twirl,no roll,no confusion,no mini,no tiny,no flip,no invert,no tornado,no tipsy,no bumpy,no beat,no xmode" Effect,1="mod,drunk;name,Drunk" Effect,2="mod,dizzy;name,Dizzy" Effect,3="mod,twirl;name,Twirl" Effect,4="mod,roll;name,Roll" Effect,5="mod,confusion;name,Confusion" -Effect,6="mod,tiny;name,Tiny" -Effect,7="mod,-100% mini;name,Big" -Effect,8="mod,flip;name,Flip" -Effect,9="mod,invert;name,Invert" -Effect,10="mod,tornado;name,Tornado" -Effect,11="mod,tipsy;name,Tipsy" -Effect,12="mod,bumpy;name,Bumpy" -Effect,13="mod,beat;name,Beat" -Effect,14="mod,45% xmode;name,XMode" +Effect,6="mod,mini;name,Mini" +Effect,7="mod,tiny;name,Tiny" +Effect,8="mod,-100% mini;name,Big" +Effect,9="mod,flip;name,Flip" +Effect,10="mod,invert;name,Invert" +Effect,11="mod,tornado;name,Tornado" +Effect,12="mod,tipsy;name,Tipsy" +Effect,13="mod,bumpy;name,Bumpy" +Effect,14="mod,beat;name,Beat" +Effect,15="mod,45% xmode;name,XMode" EffectsReceptor="selectmultiple" EffectsReceptorDefault="" @@ -2388,12 +2389,6 @@ Persp,3="mod,space;name,Space" Persp,4="mod,hallway;name,Hallway" Persp,5="mod,distant;name,Distant" -ScoreDisplay="3" -ScoreDisplayDefault="mod,addscore" -ScoreDisplay,1="mod,addscore;name,Add" -ScoreDisplay,2="mod,subtractscore;name,Subtract" -ScoreDisplay,3="mod,averagescore;name,Average" - # Song options # LifeType="3;together" LifeType=(GAMESTATE:IsCourseMode() and 3 or 2)..";together" @@ -3659,7 +3654,7 @@ SelectionBeatBeginFormat="%s:\n %.6f" SelectionBeatUnfinishedFormat=" ...\n" SelectionBeatEndFormat="-%.6f\n" DifficultyFormat="%s:\n %s\n" -RoutinePlayerFormat="%s:\n %d\n" +RoutinePlayerFormat="%s: %d\n" DescriptionFormat="%s:\n %s\n" StepAuthorFormat="%s:\n %s\n" ChartStyleFormat="%s:\n %s\n" diff --git a/Themes/default/BGAnimations/ScreenCredits overlay.lua b/Themes/default/BGAnimations/ScreenCredits overlay.lua index d9addb448a..6d9b73f724 100644 --- a/Themes/default/BGAnimations/ScreenCredits overlay.lua +++ b/Themes/default/BGAnimations/ScreenCredits overlay.lua @@ -40,9 +40,10 @@ local stepmania = { local contrib = { "Aldo Fregoso (Aldo_MX)", -- delays - "Chris Eldridge (kurisu)", -- dance-threepanel "cerbo", "cesarmades", -- pump/cmd* noteskins + "Chris Eldridge (kurisu)", -- dance-threepanel + "Christophe Goulet-LeBlanc (Kommisar)", "corec", -- various fixes "galopin", -- piu PlayStation2 usb mat support "gholms", -- automake 1.11 support @@ -50,9 +51,8 @@ local contrib = { "Kaox", -- pump/default noteskin "NitroX72", -- pump/frame noteskin "sy567", -- beginner helper fix - "Thai Pangsakulyanont (theDtTvB)", "v1toko", -- x-mode from StepNXA - "Christophe Goulet-LeBlanc (Kommisar)", + "waiei", -- custom scoring fixes + Hybrid scoring } local thanks = { @@ -72,7 +72,7 @@ local thanks = { local shoutout = { "The Lua team", -- lua project lead or some shit. super nerdy but oh hell. - "Mojang", -- minecraft forever -freem + "Mojang AB", -- minecraft forever -freem "Wolfire Games", -- piles of inspiration "NAKET Coder", "Ciera Boyd", -- you bet your ass I'm putting my girlfriend in the credits diff --git a/Themes/default/Graphics/CombinedLifeMeterTug separator.redir b/Themes/default/Graphics/CombinedLifeMeterTug separator.redir index 04b2ead777..65de2f434b 100644 --- a/Themes/default/Graphics/CombinedLifeMeterTug separator.redir +++ b/Themes/default/Graphics/CombinedLifeMeterTug separator.redir @@ -1 +1 @@ -_blank \ No newline at end of file +_CombinedLifeMeterTug separator \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenMapControllers exit.lua b/Themes/default/Graphics/ScreenMapControllers exit.lua new file mode 100644 index 0000000000..dda8c0fd5c --- /dev/null +++ b/Themes/default/Graphics/ScreenMapControllers exit.lua @@ -0,0 +1,10 @@ +return LoadFont("Common Normal") .. { + Text="Exit"; + InitCommand=cmd(x,SCREEN_CENTER_X;zoom,0.75;shadowlength,0;diffuse,color("#880000");NoStroke); + OnCommand=cmd(diffusealpha,0;decelerate,0.5;diffusealpha,1); + OffCommand=cmd(stoptweening;accelerate,0.3;diffusealpha,0;queuecommand,"Hide"); + HideCommand=cmd(hidden,true); + + GainFocusCommand=cmd(diffuseshift;effectcolor1,color("#FF2222");effectcolor2,color("#880000");); + LoseFocusCommand=cmd(stopeffect); +}; diff --git a/Themes/default/Graphics/ScreenMapControllers exit.redir b/Themes/default/Graphics/ScreenMapControllers exit.redir deleted file mode 100644 index 04b2ead777..0000000000 --- a/Themes/default/Graphics/ScreenMapControllers exit.redir +++ /dev/null @@ -1 +0,0 @@ -_blank \ No newline at end of file diff --git a/Themes/default/Scripts/03 ThemePrefs.lua b/Themes/default/Scripts/03 ThemePrefs.lua index d7c1555728..221ced5288 100644 --- a/Themes/default/Scripts/03 ThemePrefs.lua +++ b/Themes/default/Scripts/03 ThemePrefs.lua @@ -231,9 +231,9 @@ function UserPrefShowLotsaOptions() end function GetDefaultOptionLines() - local LineSets = { - "1,8,14,2,3,4,5,6,R,7,9,10,11,12,13,16,17,18", -- All - "1,8,14,2,7,13,16,17,18", -- DDR Essentials ( no turns, fx ) + local LineSets = { -- none of these include characters yet. + "1,8,14,2,3,4,5,6,R,7,9,10,11,12,13,16,17", -- All + "1,8,14,2,7,13,16,17", -- DDR Essentials ( no turns, fx ) }; local function IsExtra() if GAMESTATE:IsExtraStage() or GAMESTATE:IsExtraStage2() then @@ -242,15 +242,22 @@ function GetDefaultOptionLines() return false end end - if not IsExtra() then - if GetUserPrefB("UserPrefShowLotsaOptions") then - return GetUserPrefB("UserPrefShowLotsaOptions") and LineSets[1] or LineSets[2]; - else - return LineSets[2]; -- Just make sure! + + local function CheckCharacters(mods) + if CHARMAN:GetCharacterCount() > 0 then + return mods .. ",18"; --TODO: Better line name. end - else - return "1,8,14,2,7,13,16,17,18" -- "failsafe" list + return mods; end + + modLines = LineSets[2]; + + if not IsExtra() then + modLines = GetUserPrefB("UserPrefShowLotsaOptions") + and LineSets[1] or LineSets[2]; + end + + return CheckCharacters(modLines); end; function UserPrefAutoSetStyle() diff --git a/Utils/CreatePackage.pl b/Utils/CreatePackage.pl index 81457e0f87..37881fd1e7 100755 --- a/Utils/CreatePackage.pl +++ b/Utils/CreatePackage.pl @@ -173,6 +173,7 @@ my @files = ( "NoteSkins/pump/default", "NoteSkins/pump/frame5p", "NoteSkins/pump/newextra", + "NoteSkins/pump/pad", "NoteSkins/pump/rhythm", "NoteSkins/pump/simple", # kb7 noteskins diff --git a/src/ArrowEffects.cpp b/src/ArrowEffects.cpp index 5b6dd64b08..a01f30d11d 100644 --- a/src/ArrowEffects.cpp +++ b/src/ArrowEffects.cpp @@ -56,8 +56,8 @@ static ThemeMetric DRUNK_OFFSET_FREQUENCY( "ArrowEffects", "DrunkOffsetFr static ThemeMetric DRUNK_ARROW_MAGNITUDE( "ArrowEffects", "DrunkArrowMagnitude" ); static ThemeMetric BEAT_OFFSET_HEIGHT( "ArrowEffects", "BeatOffsetHeight" ); static ThemeMetric BEAT_PI_HEIGHT( "ArrowEffects", "BeatPIHeight" ); -static ThemeMetric MINI_PERCENT_BASE( "ArrowEffects", "MiniPercentBase" ); -static ThemeMetric MINI_PERCENT_GATE( "ArrowEffects", "MiniPercentGate" ); +static ThemeMetric TINY_PERCENT_BASE( "ArrowEffects", "TinyPercentBase" ); +static ThemeMetric TINY_PERCENT_GATE( "ArrowEffects", "TinyPercentGate" ); static ThemeMetric DIZZY_HOLD_HEADS( "ArrowEffects", "DizzyHoldHeads" ); float ArrowGetPercentVisible( const PlayerState* pPlayerState, float fYPosWithoutReverse ); @@ -345,8 +345,8 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float static void ArrowGetReverseShiftAndScale( const PlayerState* pPlayerState, int iCol, float fYReverseOffsetPixels, float &fShiftOut, float &fScaleOut ) { // XXX: Hack: we need to scale the reverse shift by the zoom. - float fTinyPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_TINY]; - float fZoom = 1 - fTinyPercent*0.5f; + float fMiniPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_MINI]; + float fZoom = 1 - fMiniPercent*0.5f; // don't divide by 0 if( fabsf(fZoom) < 0.01 ) @@ -489,12 +489,12 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float fPixelOffsetFromCenter += pCols[iColNum].fXOffset; - if( fEffects[PlayerOptions::EFFECT_MINI] != 0 ) + if( fEffects[PlayerOptions::EFFECT_TINY] != 0 ) { - // Allow Mini to pull tracks together, but not to push them apart. - float fMiniPercent = fEffects[PlayerOptions::EFFECT_MINI]; - fMiniPercent = min( powf(MINI_PERCENT_BASE, fMiniPercent), (float)MINI_PERCENT_GATE ); - fPixelOffsetFromCenter *= fMiniPercent; + // Allow Tiny to pull tracks together, but not to push them apart. + float fTinyPercent = fEffects[PlayerOptions::EFFECT_TINY]; + fTinyPercent = min( powf(TINY_PERCENT_BASE, fTinyPercent), (float)TINY_PERCENT_GATE ); + fPixelOffsetFromCenter *= fTinyPercent; } return fPixelOffsetFromCenter; @@ -565,7 +565,7 @@ static float GetCenterLine( const PlayerState* pPlayerState ) { /* Another mini hack: if EFFECT_MINI is on, then our center line is at * eg. 320, not 160. */ - const float fMiniPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_TINY]; + const float fMiniPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_MINI]; const float fZoom = 1 - fMiniPercent*0.5f; return CENTER_LINE_Y / fZoom; } @@ -741,11 +741,11 @@ float ArrowEffects::GetZoom( const PlayerState* pPlayerState ) (GAMESTATE->GetNumSidesJoined()==2 || GAMESTATE->AnyPlayersAreCpu()) ) fZoom *= 0.6f; - float fMiniPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_MINI]; - if( fMiniPercent != 0 ) + float fTinyPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_TINY]; + if( fTinyPercent != 0 ) { - fMiniPercent = powf( 0.5f, fMiniPercent ); - fZoom *= fMiniPercent; + fTinyPercent = powf( 0.5f, fTinyPercent ); + fZoom *= fTinyPercent; } return fZoom; } diff --git a/src/CharacterManager.cpp b/src/CharacterManager.cpp index 10cf6a26d6..8b70d9139f 100644 --- a/src/CharacterManager.cpp +++ b/src/CharacterManager.cpp @@ -89,7 +89,7 @@ Character* CharacterManager::GetDefaultCharacter() } /* We always have the default character. */ - ASSERT(0); + FAIL_M("There must be a default character available!"); return NULL; } @@ -152,6 +152,13 @@ public: LuaHelpers::CreateTableFromArray(vChars, L); return 1; } + static int GetCharacterCount(T* p, lua_State *L) + { + vector chars; + p->GetCharacters(chars); + lua_pushnumber(L, chars.size()); + return 1; + } LunaCharacterManager() { @@ -159,6 +166,7 @@ public: // sm-ssc adds: ADD_METHOD( GetRandomCharacter ); ADD_METHOD( GetAllCharacters ); + ADD_METHOD( GetCharacterCount ); } }; diff --git a/src/CharacterManager.h b/src/CharacterManager.h index bd49c20c5e..4a687ee9d3 100644 --- a/src/CharacterManager.h +++ b/src/CharacterManager.h @@ -1,19 +1,24 @@ -/* CharacterManager - Manage characters. */ - #ifndef CHARACTER_MANAGER_H #define CHARACTER_MANAGER_H class Character; struct lua_State; +/** @brief Manage all of the Characters. */ class CharacterManager { public: + /** @brief Set up the character manager. */ CharacterManager(); + /** @brief Destroy the character manager. */ ~CharacterManager(); void GetCharacters( vector &vpCharactersOut ); + /** @brief Get one installed character at random. + * @return The random character. */ Character* GetRandomCharacter(); + /** @brief Get the character assigned as the default. + * @return The default character. */ Character* GetDefaultCharacter(); Character* GetCharacterFromID( RString sCharacterID ); diff --git a/src/GameManager.cpp b/src/GameManager.cpp index c974491c31..a9178b5433 100644 --- a/src/GameManager.cpp +++ b/src/GameManager.cpp @@ -332,7 +332,7 @@ static const Style g_Style_Dance_Couple_Edit = false, // m_bUsedForHowToPlay "couple-edit", // m_szName StepsType_dance_couple, // m_StepsType - StyleType_OnePlayerOneSide, // m_StyleType + StyleType_OnePlayerTwoSides, // m_StyleType 8, // m_iColsPerPlayer { // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER]; { // PLAYER_1 @@ -357,8 +357,8 @@ static const Style g_Style_Dance_Couple_Edit = }, }, { // m_iInputColumn[NUM_GameController][NUM_GameButton] - { 0, 1, 2, 3, 4, 5, 6, 7, Style::END_MAPPING }, - { 0, 1, 2, 3, 4, 5, 6, 7, Style::END_MAPPING }, + { 0, 3, 2, 1, Style::END_MAPPING }, + { 4, 7, 6, 5, Style::END_MAPPING }, }, { // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER]; 0,1,2,3,4,5,6,7 @@ -770,7 +770,7 @@ static const Style g_Style_Pump_Couple_Edit = false, // m_bUsedForHowToPlay "couple-edit", // m_szName StepsType_pump_couple, // m_StepsType - StyleType_OnePlayerOneSide, // m_StyleType + StyleType_OnePlayerTwoSides, // m_StyleType 10, // m_iColsPerPlayer { // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER]; { // PLAYER_1 @@ -786,19 +786,24 @@ static const Style g_Style_Pump_Couple_Edit = { TRACK_10, +PUMP_COL_SPACING*5.0f+4, NULL }, }, { // PLAYER_2 - { TRACK_1, -PUMP_COL_SPACING*2.0f, NULL }, - { TRACK_2, -PUMP_COL_SPACING*1.0f, NULL }, - { TRACK_3, +PUMP_COL_SPACING*0.0f, NULL }, - { TRACK_4, +PUMP_COL_SPACING*1.0f, NULL }, - { TRACK_5, +PUMP_COL_SPACING*2.0f, NULL }, + { TRACK_1, -PUMP_COL_SPACING*5.0f-4, NULL }, + { TRACK_2, -PUMP_COL_SPACING*4.0f-4, NULL }, + { TRACK_3, -PUMP_COL_SPACING*3.0f-4, NULL }, + { TRACK_4, -PUMP_COL_SPACING*2.0f-4, NULL }, + { TRACK_5, -PUMP_COL_SPACING*1.0f-4, NULL }, + { TRACK_6, +PUMP_COL_SPACING*1.0f+4, NULL }, + { TRACK_7, +PUMP_COL_SPACING*2.0f+4, NULL }, + { TRACK_8, +PUMP_COL_SPACING*3.0f+4, NULL }, + { TRACK_9, +PUMP_COL_SPACING*4.0f+4, NULL }, + { TRACK_10, +PUMP_COL_SPACING*5.0f+4, NULL }, }, }, { // m_iInputColumn[NUM_GameController][NUM_GameButton] - { 1, 3, 2, 0, 4, 6, 8, 7, 5, 9, Style::END_MAPPING }, - { 1, 3, 2, 0, 4, 6, 8, 7, 5, 9, Style::END_MAPPING }, + { 1, 3, 2, 0, 4, Style::END_MAPPING }, + { 6, 8, 7, 5, 9, Style::END_MAPPING }, }, { // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER]; - 2,1,3,0,4 + 2,1,3,0,4, 2+5,1+5,3+5,0+5,4+5 }, false, // m_bNeedsZoomOutWith2Players false, // m_bCanUseBeginnerHelper diff --git a/src/NoteField.cpp b/src/NoteField.cpp index e97ca24225..3acfb3ea5e 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -817,7 +817,7 @@ void NoteField::DrawPrimitives() float fDrawScale = 1; fDrawScale *= 1 + 0.5f * fabsf( current_po.m_fPerspectiveTilt ); - fDrawScale *= 1 + fabsf( current_po.m_fEffects[PlayerOptions::EFFECT_TINY] ); + fDrawScale *= 1 + fabsf( current_po.m_fEffects[PlayerOptions::EFFECT_MINI] ); iDrawDistanceAfterTargetsPixels = (int)(iDrawDistanceAfterTargetsPixels * fDrawScale); iDrawDistanceBeforeTargetsPixels = (int)(iDrawDistanceBeforeTargetsPixels * fDrawScale); diff --git a/src/Player.cpp b/src/Player.cpp index fd3a2202e0..5dfed3e310 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -867,7 +867,7 @@ void Player::Update( float fDeltaTime ) Actor::TweenState::MakeWeightedAverage( m_pActorWithComboPosition->DestTweenState(), ts1, ts2, fPercentCentered ); } - float fNoteFieldZoom = 1 - fTinyPercent*0.5f; + float fNoteFieldZoom = 1 - fMiniPercent*0.5f; if( m_pNoteField ) m_pNoteField->SetZoom( fNoteFieldZoom ); if( m_pActorWithJudgmentPosition != NULL ) @@ -1488,7 +1488,7 @@ void Player::DrawPrimitives() float fTiltDegrees = SCALE(fTilt,-1.f,+1.f,+30,-30) * (bReverse?-1:1); - float fZoom = SCALE( m_pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_TINY], 0.f, 1.f, 1.f, 0.5f ); + float fZoom = SCALE( m_pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_MINI], 0.f, 1.f, 1.f, 0.5f ); if( fTilt > 0 ) fZoom *= SCALE( fTilt, 0.f, 1.f, 1.f, 0.9f ); else diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp index 3f577a17d3..a6f279a107 100644 --- a/src/PlayerOptions.cpp +++ b/src/PlayerOptions.cpp @@ -61,7 +61,7 @@ void PlayerOptions::Approach( const PlayerOptions& other, float fDeltaSeconds ) APPROACH( fTimeSpacing ); APPROACH( fScrollSpeed ); - APPROACH( fMaxScrollBPM ); + //APPROACH( fMaxScrollBPM ); fapproach( m_fScrollBPM, other.m_fScrollBPM, fDeltaSeconds * other.m_SpeedfScrollBPM*150 ); for( int i=0; i= 0, ssprintf("to_move: %f", to_move) ); + ASSERT_M( to_move >= 0, ssprintf("to_move: %f < 0", to_move) ); if( val == other_val ) return; float fDelta = other_val - val; diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 36d2f01907..0d14921700 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -568,6 +568,12 @@ static MenuDef g_AlterMenu( MenuRowDef(ScreenEdit::convert_to_warp, "Convert selection to warp", true, EditMode_Full, true, true, 0, NULL ), MenuRowDef(ScreenEdit::convert_to_fake, "Convert selection to fake", true, + EditMode_Full, true, true, 0, NULL ), + MenuRowDef(ScreenEdit::routine_invert_notes, "Invert notes' player", true, + EditMode_Full, true, true, 0, NULL ), + MenuRowDef(ScreenEdit::routine_mirror_1_to_2, "Mirror Player 1 to 2", true, + EditMode_Full, true, true, 0, NULL ), + MenuRowDef(ScreenEdit::routine_mirror_2_to_1, "Mirror Player 2 to 1", true, EditMode_Full, true, true, 0, NULL ) ); @@ -1759,6 +1765,10 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) } else { + bool isRoutine = (m_InputPlayerNumber != PLAYER_INVALID); + g_AlterMenu.rows[routine_invert_notes].bEnabled = isRoutine; + g_AlterMenu.rows[routine_mirror_1_to_2].bEnabled = isRoutine; + g_AlterMenu.rows[routine_mirror_2_to_1].bEnabled = isRoutine; EditMiniMenu(&g_AlterMenu, SM_BackFromAlterMenu); } break; @@ -2723,7 +2733,7 @@ void ScreenEdit::TransitionEditState( EditState em ) Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; ASSERT( pSteps ); pSteps->SetNoteData( m_NoteDataEdit ); - m_pSong->ReCalculateRadarValuesAndLastBeat(); + m_pSong->ReCalculateRadarValuesAndLastSecond(); m_Background.Unload(); m_Background.LoadFromSong( m_pSong ); @@ -3128,8 +3138,8 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) if (ScreenMiniMenu::s_iLastRowCode == ScreenEdit::remove ) { - ASSERT(iAttack >= 0); - attacks.erase(attacks.begin() + iAttack); + if (iAttack > 0) + attacks.erase(attacks.begin() + iAttack); } else { @@ -4059,7 +4069,78 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector &iAn SetDirty(true); break; } - + case routine_invert_notes: + { + NoteData &nd = this->m_NoteDataEdit; + NoteField &nf = this->m_NoteFieldEdit; + FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE(nd, r, + nf.m_iBeginMarker, + nf.m_iEndMarker) + { + for (int t = 0; t < nd.GetNumTracks(); t++) + { + const TapNote &tn = nd.GetTapNote(t, r); + if (tn.type != TapNote::empty) + { + TapNote nTap = tn; + nTap.pn = (tn.pn == PLAYER_1 ? + PLAYER_2 : PLAYER_1); + m_NoteDataEdit.SetTapNote(t, r, nTap); + } + } + } + break; + } + case routine_mirror_1_to_2: + case routine_mirror_2_to_1: + { + PlayerNumber oPN = (c == routine_mirror_1_to_2 ? + PLAYER_1 : PLAYER_2); + PlayerNumber nPN = (c == routine_mirror_1_to_2 ? + PLAYER_2 : PLAYER_1); + int nTrack = -1; + NoteData &nd = this->m_NoteDataEdit; + NoteField &nf = this->m_NoteFieldEdit; + int tracks = nd.GetNumTracks(); + FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE(nd, r, + nf.m_iBeginMarker, + nf.m_iEndMarker) + { + for (int t = 0; t < tracks; t++) + { + const TapNote &tn = nd.GetTapNote(t, r); + if (tn.type != TapNote::empty && tn.pn == oPN) + { + TapNote nTap = tn; + nTap.pn = nPN; + StepsType curType = GAMESTATE->m_pCurSteps[PLAYER_1]->m_StepsType; + if (curType == StepsType_dance_routine) + { + nTrack = tracks - t - 1; + } + else if (curType == StepsType_pump_routine) + { + switch (t) + { + case 0: nTrack = 8; break; + case 1: nTrack = 9; break; + case 2: nTrack = 7; break; + case 3: nTrack = 5; break; + case 4: nTrack = 6; break; + case 5: nTrack = 3; break; + case 6: nTrack = 4; break; + case 7: nTrack = 2; break; + case 8: nTrack = 0; break; + case 9: nTrack = 1; break; + default: FAIL_M(ssprintf("Invalid column %d for pump-routine", t)); break; + } + } + m_NoteDataEdit.SetTapNote(nTrack, r, nTap); + } + } + } + break; + } } } diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index a2392a83e6..38f0a4bbad 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -390,23 +390,27 @@ public: void HandleMainMenuChoice( MainMenuChoice c ) { const vector v; HandleMainMenuChoice( c, v ); } MainMenuChoice m_CurrentAction; + /** @brief How does one alter a selection of NoteData? */ enum AlterMenuChoice { - cut, - copy, - clear, - quantize, - turn, - transform, - alter, - tempo, - play, - record, - preview_designation, - convert_to_pause, - convert_to_delay, - convert_to_warp, - convert_to_fake, + cut, /**< Cut the notes. */ + copy, /**< Copy the notes. */ + clear, /**< Erase the notes, without putting them in the clipboard. */ + quantize, /**< Sync the notes to an exact level. */ + turn, /**< Rotate the notes. */ + transform, /**< Activate a specific mod. */ + alter, /**< Perform other transformations. */ + tempo, /**< Modify the tempo of the notes. */ + play, /**< Play the notes in the range. */ + record, /**< Record new notes in the range. */ + preview_designation, /**< Set the area as the music preview. */ + convert_to_pause, /**< Convert the range into a StopSegment. */ + convert_to_delay, /**< Convert the range into a DelaySegment. */ + convert_to_warp, /**< Convert the range into a WarpSegment. */ + convert_to_fake, /**< Convert the range into a FakeSegment. */ + routine_invert_notes, /**< Switch which player hits the note. */ + routine_mirror_1_to_2, /**< Mirror Player 1's notes for Player 2. */ + routine_mirror_2_to_1, /**< Mirror Player 2's notes for Player 1. */ NUM_ALTER_MENU_CHOICES }; diff --git a/src/ScreenJukebox.cpp b/src/ScreenJukebox.cpp index eb1769c040..5059d2ecf1 100644 --- a/src/ScreenJukebox.cpp +++ b/src/ScreenJukebox.cpp @@ -194,7 +194,7 @@ void ScreenJukebox::Init() PO_GROUP_CALL( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, Init ); PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_fScrollSpeed, .25f ); PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_fPerspectiveTilt, -1.0f ); - PO_GROUP_ASSIGN_N( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_fEffects, PlayerOptions::EFFECT_MINI, 1.0f ); + PO_GROUP_ASSIGN_N( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_fEffects, PlayerOptions::EFFECT_TINY, 1.0f ); } SO_GROUP_ASSIGN( GAMESTATE->m_SongOptions, ModsLevel_Stage, m_LifeType, SongOptions::LIFE_BATTERY ); } diff --git a/src/Song.cpp b/src/Song.cpp index 87eaf91058..97d62a728b 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -283,7 +283,11 @@ bool Song::LoadFromSongDir( RString sDir ) if( bUseCache ) { -// LOG->Trace( "Loading '%s' from cache file '%s'.", m_sSongDir.c_str(), GetCacheFilePath().c_str() ); + /* + LOG->Trace("Loading '%s' from cache file '%s'.", + m_sSongDir.c_str(), + GetCacheFilePath().c_str()); + */ SSCLoader loaderSSC; bool bLoadedFromSSC = loaderSSC.LoadFromSimfile( sCacheFilePath, *this, true ); if( !bLoadedFromSSC ) @@ -379,13 +383,13 @@ bool Song::ReloadFromSongDir( RString sDir ) FOREACH_ENUM( StepsType, i ) m_vpStepsByType[i].clear(); - // Then we copy as many Steps as possible on top of the old pointers. - // The only pointers that change are pointers to Steps that are not in the - // reverted file, which we delete, and pointers to Steps that are in the - // reverted file but not the original *this, which we create new copies of. - // We have to go through these hoops because many places assume the Steps - // pointers don't change - even though there are other ways they can change, - // such as deleting a Steps via the editor. + /* Then we copy as many Steps as possible on top of the old pointers. + * The only pointers that change are pointers to Steps that are not in the + * reverted file, which we delete, and pointers to Steps that are in the + * reverted file but not the original *this, which we create new copies of. + * We have to go through these hoops because many places assume the Steps + * pointers don't change - even though there are other ways they can change, + * such as deleting a Steps via the editor. */ for( vector::const_iterator itOld = vOldSteps.begin(); itOld != vOldSteps.end(); ++itOld ) { StepsID id; @@ -512,12 +516,18 @@ void Song::TidyUpData( bool bFromCache ) else // ! HasMusic() { m_fMusicLengthSeconds = 100; // guess - LOG->UserLog( "Song", GetSongDir(), "has no music file; guessing at %f seconds", m_fMusicLengthSeconds ); + LOG->UserLog("Song", + GetSongDir(), + "has no music file; guessing at %f seconds", + m_fMusicLengthSeconds); } if( m_fMusicLengthSeconds < 0 ) { - LOG->UserLog( "Sound file", GetMusicPath(), "has a negative length %f.", m_fMusicLengthSeconds ); + LOG->UserLog("Sound file", + GetMusicPath(), + "has a negative length %f.", + m_fMusicLengthSeconds); m_fMusicLengthSeconds = 0; } @@ -530,7 +540,7 @@ void Song::TidyUpData( bool bFromCache ) /* Generate these before we autogen notes, so the new notes can inherit * their source's values. */ - ReCalculateRadarValuesAndLastBeat( bFromCache ); + ReCalculateRadarValuesAndLastSecond( bFromCache ); Trim( m_sMainTitle ); Trim( m_sSubTitle ); @@ -538,7 +548,8 @@ void Song::TidyUpData( bool bFromCache ) // Fall back on the song directory name. if( m_sMainTitle == "" ) - NotesLoader::GetMainAndSubTitlesFromFullTitle( Basename(this->GetSongDir()), m_sMainTitle, m_sSubTitle ); + NotesLoader::GetMainAndSubTitlesFromFullTitle(Basename(this->GetSongDir()), + m_sMainTitle, m_sSubTitle ); if( m_sArtist == "" ) m_sArtist = "Unknown artist"; @@ -652,7 +663,8 @@ void Song::TidyUpData( bool bFromCache ) m_sLyricsFile = arrayLyricFiles[0]; } - // Now, For the images we still haven't found, look at the image dimensions of the remaining unclassified images. + /* Now, For the images we still haven't found, + * look at the image dimensions of the remaining unclassified images. */ vector arrayImages; GetImageDirListing( m_sSongDir + "*", arrayImages ); @@ -763,7 +775,12 @@ void Song::TidyUpData( bool bFromCache ) /* Use this->GetBeatFromElapsedTime(0) instead of 0 to start when the * music starts. */ if( arrayPossibleMovies.size() == 1 ) - this->AddBackgroundChange( BACKGROUND_LAYER_1, BackgroundChange(0,arrayPossibleMovies[0],"",1.f,SBE_StretchNoLoop) ); + this->AddBackgroundChange(BACKGROUND_LAYER_1, + BackgroundChange(0, + arrayPossibleMovies[0], + "", + 1.f, + SBE_StretchNoLoop)); } @@ -836,12 +853,14 @@ void Song::TranslateTitles() static TitleSubst tsub("Songs"); TitleFields title; - title.LoadFromStrings( m_sMainTitle, m_sSubTitle, m_sArtist, m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit ); + title.LoadFromStrings(m_sMainTitle, m_sSubTitle, m_sArtist, + m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit ); tsub.Subst( title ); - title.SaveToStrings( m_sMainTitle, m_sSubTitle, m_sArtist, m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit ); + title.SaveToStrings(m_sMainTitle, m_sSubTitle, m_sArtist, + m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit ); } -void Song::ReCalculateRadarValuesAndLastBeat( bool bFromCache ) +void Song::ReCalculateRadarValuesAndLastSecond( bool bFromCache ) { if( bFromCache && this->GetFirstSecond() >= 0 && this->GetLastSecond() > 0 ) { @@ -852,7 +871,8 @@ void Song::ReCalculateRadarValuesAndLastBeat( bool bFromCache ) } float localFirst = FLT_MAX; // inf - float localLast = this->specifiedLastSecond; // Make sure we're at least as long as the specified amount. + // Make sure we're at least as long as the specified amount below. + float localLast = this->specifiedLastSecond; for( unsigned i=0; iTrace( "Song::SaveToSongFile()" ); - ReCalculateRadarValuesAndLastBeat(); + ReCalculateRadarValuesAndLastSecond(); TranslateTitles(); // TODO: Figure out a better way to save to Song's timing data. @@ -1222,14 +1242,26 @@ bool Song::HasMusic() const return m_sMusicFile != "" && IsAFile(GetMusicPath()); } -bool Song::HasBanner() const {return m_sBannerFile != "" && IsAFile(GetBannerPath()); } +bool Song::HasBanner() const +{ + return m_sBannerFile != "" && IsAFile(GetBannerPath()); +} bool Song::HasInstrumentTrack( InstrumentTrack it ) const { - return m_sInstrumentTrackFile[it] != "" && IsAFile(GetInstrumentTrackPath(it)); + return m_sInstrumentTrackFile[it] != "" && IsAFile(GetInstrumentTrackPath(it)); +} +bool Song::HasLyrics() const +{ + return m_sLyricsFile != "" && IsAFile(GetLyricsPath()); +} +bool Song::HasBackground() const +{ + return m_sBackgroundFile != "" && IsAFile(GetBackgroundPath()); +} +bool Song::HasCDTitle() const +{ + return m_sCDTitleFile != "" && IsAFile(GetCDTitlePath()); } -bool Song::HasLyrics() const {return m_sLyricsFile != "" && IsAFile(GetLyricsPath()); } -bool Song::HasBackground() const {return m_sBackgroundFile != "" && IsAFile(GetBackgroundPath()); } -bool Song::HasCDTitle() const {return m_sCDTitleFile != "" && IsAFile(GetCDTitlePath()); } bool Song::HasBGChanges() const { FOREACH_BackgroundLayer( i ) @@ -1526,16 +1558,46 @@ bool Song::IsMarathon() const class LunaSong: public Luna { public: - static int GetDisplayFullTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetDisplayFullTitle() ); return 1; } - static int GetTranslitFullTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetTranslitFullTitle() ); return 1; } - static int GetDisplayMainTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetDisplayMainTitle() ); return 1; } - static int GetTranslitMainTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetTranslitMainTitle() ); return 1; } - static int GetDisplaySubTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetDisplaySubTitle() ); return 1; } - static int GetTranslitSubTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetTranslitSubTitle() ); return 1; } - static int GetDisplayArtist( T* p, lua_State *L ) { lua_pushstring(L, p->GetDisplayArtist() ); return 1; } - static int GetTranslitArtist( T* p, lua_State *L ) { lua_pushstring(L, p->GetTranslitArtist() ); return 1; } - static int GetGenre( T* p, lua_State *L ) { lua_pushstring(L, p->m_sGenre ); return 1; } - static int GetOrigin( T* p, lua_State *L ) { lua_pushstring(L, p->m_sOrigin ); return 1; } + static int GetDisplayFullTitle( T* p, lua_State *L ) + { + lua_pushstring(L, p->GetDisplayFullTitle() ); return 1; + } + static int GetTranslitFullTitle( T* p, lua_State *L ) + { + lua_pushstring(L, p->GetTranslitFullTitle() ); return 1; + } + static int GetDisplayMainTitle( T* p, lua_State *L ) + { + lua_pushstring(L, p->GetDisplayMainTitle() ); return 1; + } + static int GetTranslitMainTitle( T* p, lua_State *L ) + { + lua_pushstring(L, p->GetTranslitMainTitle() ); return 1; + } + static int GetDisplaySubTitle( T* p, lua_State *L ) + { + lua_pushstring(L, p->GetDisplaySubTitle() ); return 1; + } + static int GetTranslitSubTitle( T* p, lua_State *L ) + { + lua_pushstring(L, p->GetTranslitSubTitle() ); return 1; + } + static int GetDisplayArtist( T* p, lua_State *L ) + { + lua_pushstring(L, p->GetDisplayArtist() ); return 1; + } + static int GetTranslitArtist( T* p, lua_State *L ) + { + lua_pushstring(L, p->GetTranslitArtist() ); return 1; + } + static int GetGenre( T* p, lua_State *L ) + { + lua_pushstring(L, p->m_sGenre ); return 1; + } + static int GetOrigin( T* p, lua_State *L ) + { + lua_pushstring(L, p->m_sOrigin ); return 1; + } static int GetAllSteps( T* p, lua_State *L ) { const vector &v = p->GetAllSteps(); @@ -1549,9 +1611,29 @@ public: LuaHelpers::CreateTableFromArray( v, L ); return 1; } - static int GetSongDir( T* p, lua_State *L ) { lua_pushstring(L, p->GetSongDir() ); return 1; } - static int GetMusicPath( T* p, lua_State *L ) { RString s = p->GetMusicPath(); if( s.empty() ) return 0; lua_pushstring(L, s); return 1; } - static int GetBannerPath( T* p, lua_State *L ) { RString s = p->GetBannerPath(); if( s.empty() ) return 0; LuaHelpers::Push(L, s); return 1; } + static int GetSongDir( T* p, lua_State *L ) + { + lua_pushstring(L, p->GetSongDir() ); + return 1; + } + static int GetMusicPath( T* p, lua_State *L ) + { + RString s = p->GetMusicPath(); + if( !s.empty() ) + lua_pushstring(L, s); + else + lua_pushnil(L); + return 1; + } + static int GetBannerPath( T* p, lua_State *L ) + { + RString s = p->GetBannerPath(); + if( !s.empty() ) + lua_pushstring(L, s); + else + lua_pushnil(L); + return 1; + } static int GetBackgroundPath( T* p, lua_State *L ) { RString s = p->GetBackgroundPath(); @@ -1561,15 +1643,59 @@ public: lua_pushnil(L); return 1; } - static int GetCDTitlePath( T* p, lua_State *L ) { RString s = p->GetCDTitlePath(); if( s.empty() ) return 0; LuaHelpers::Push(L, s); return 1; } - static int GetLyricsPath( T* p, lua_State *L ) { RString s = p->GetLyricsPath(); if( s.empty() ) return 0; lua_pushstring(L, s); return 1; } - static int GetSongFilePath( T* p, lua_State *L ) { lua_pushstring(L, p->GetSongFilePath() ); return 1; } - static int IsTutorial( T* p, lua_State *L ) { lua_pushboolean(L, p->IsTutorial()); return 1; } - static int IsEnabled( T* p, lua_State *L ) { lua_pushboolean(L, p->GetEnabled()); return 1; } - static int GetGroupName( T* p, lua_State *L ) { lua_pushstring(L, p->m_sGroupName); return 1; } - static int MusicLengthSeconds( T* p, lua_State *L ) { lua_pushnumber(L, p->m_fMusicLengthSeconds); return 1; } - static int IsLong( T* p, lua_State *L ) { lua_pushboolean(L, p->IsLong()); return 1; } - static int IsMarathon( T* p, lua_State *L ) { lua_pushboolean(L, p->IsMarathon()); return 1; } + static int GetCDTitlePath( T* p, lua_State *L ) + { + RString s = p->GetCDTitlePath(); + if( !s.empty() ) + lua_pushstring(L, s); + else + lua_pushnil(L); + return 1; + } + static int GetLyricsPath( T* p, lua_State *L ) + { + RString s = p->GetLyricsPath(); + if( !s.empty() ) + lua_pushstring(L, s); + else + lua_pushnil(L); + return 1; + } + static int GetSongFilePath( T* p, lua_State *L ) + { + lua_pushstring(L, p->GetSongFilePath() ); + return 1; + } + static int IsTutorial( T* p, lua_State *L ) + { + lua_pushboolean(L, p->IsTutorial()); + return 1; + } + static int IsEnabled( T* p, lua_State *L ) + { + lua_pushboolean(L, p->GetEnabled()); + return 1; + } + static int GetGroupName( T* p, lua_State *L ) + { + lua_pushstring(L, p->m_sGroupName); + return 1; + } + static int MusicLengthSeconds( T* p, lua_State *L ) + { + lua_pushnumber(L, p->m_fMusicLengthSeconds); + return 1; + } + static int IsLong( T* p, lua_State *L ) + { + lua_pushboolean(L, p->IsLong()); + return 1; + } + static int IsMarathon( T* p, lua_State *L ) + { + lua_pushboolean(L, p->IsMarathon()); + return 1; + } static int HasStepsType( T* p, lua_State *L ) { StepsType st = Enum::Check(L, 1); @@ -1583,7 +1709,8 @@ public: lua_pushboolean( L, p->HasStepsTypeAndDifficulty(st, dc) ); return 1; } - // TODO: HasStepsTypeAndDifficulty and GetOneSteps should be in a SongUtil Lua table and a method of Steps. + /* TODO: HasStepsTypeAndDifficulty and GetOneSteps should be in + * a SongUtil Lua table and a method of Steps. */ static int GetOneSteps( T* p, lua_State *L ) { StepsType st = Enum::Check(L, 1); @@ -1601,14 +1728,42 @@ public: return 1; } // has functions - static int HasMusic( T* p, lua_State *L ) { lua_pushboolean(L, p->HasMusic()); return 1; } - static int HasBanner( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBanner()); return 1; } - static int HasBackground( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBackground()); return 1; } - static int HasCDTitle( T* p, lua_State *L ) { lua_pushboolean(L, p->HasCDTitle()); return 1; } - static int HasBGChanges( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBGChanges()); return 1; } - static int HasLyrics( T* p, lua_State *L ) { lua_pushboolean(L, p->HasLyrics()); return 1; } + static int HasMusic( T* p, lua_State *L ) + { + lua_pushboolean(L, p->HasMusic()); + return 1; + } + static int HasBanner( T* p, lua_State *L ) + { + lua_pushboolean(L, p->HasBanner()); + return 1; + } + static int HasBackground( T* p, lua_State *L ) + { + lua_pushboolean(L, p->HasBackground()); + return 1; + } + static int HasCDTitle( T* p, lua_State *L ) + { + lua_pushboolean(L, p->HasCDTitle()); + return 1; + } + static int HasBGChanges( T* p, lua_State *L ) + { + lua_pushboolean(L, p->HasBGChanges()); + return 1; + } + static int HasLyrics( T* p, lua_State *L ) + { + lua_pushboolean(L, p->HasLyrics()); + return 1; + } // functions that AJ loves - static int HasSignificantBPMChangesOrStops( T* p, lua_State *L ) { lua_pushboolean(L, p->HasSignificantBpmChangesOrStops()); return 1; } + static int HasSignificantBPMChangesOrStops( T* p, lua_State *L ) + { + lua_pushboolean(L, p->HasSignificantBpmChangesOrStops()); + return 1; + } static int HasEdits( T* p, lua_State *L ) { StepsType st = Enum::Check(L, 1); @@ -1621,8 +1776,16 @@ public: lua_pushboolean(L, p->IsEasy( st )); return 1; } - static int GetStepsSeconds( T* p, lua_State *L ) { lua_pushnumber(L, p->GetStepsSeconds()); return 1; } - static int NormallyDisplayed( T* p, lua_State *L ){ lua_pushboolean(L, p->NormallyDisplayed()); return 1; } + static int GetStepsSeconds( T* p, lua_State *L ) + { + lua_pushnumber(L, p->GetStepsSeconds()); + return 1; + } + static int NormallyDisplayed( T* p, lua_State *L ) + { + lua_pushboolean(L, p->NormallyDisplayed()); + return 1; + } static int GetFirstSecond(T* p, lua_State *L) { lua_pushnumber(L, p->GetFirstSecond()); @@ -1643,7 +1806,11 @@ public: lua_pushnumber(L, p->GetLastBeat()); return 1; } - static int HasAttacks( T* p, lua_State *L ) { lua_pushboolean(L, p->HasAttacks()); return 1; } + static int HasAttacks( T* p, lua_State *L ) + { + lua_pushboolean(L, p->HasAttacks()); + return 1; + } static int GetDisplayBpms( T* p, lua_State *L ) { DisplayBpms temp; diff --git a/src/Song.h b/src/Song.h index 279cb8e5b9..1858a136a0 100644 --- a/src/Song.h +++ b/src/Song.h @@ -103,10 +103,10 @@ public: void TidyUpData( bool bFromCache = false ); /** - * @brief Get the new radar values, and determine the last beat at the same time. + * @brief Get the new radar values, and determine the last second at the same time. * * This is called by TidyUpData, after saving the Song. */ - void ReCalculateRadarValuesAndLastBeat( bool bFromCache = false ); + void ReCalculateRadarValuesAndLastSecond( bool bFromCache = false ); /** * @brief Translate any titles that aren't in english. * diff --git a/src/StepMania-net2008.vcproj b/src/StepMania-net2008.vcproj index 8c558ff4f2..315331951d 100644 --- a/src/StepMania-net2008.vcproj +++ b/src/StepMania-net2008.vcproj @@ -372,7 +372,7 @@ EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" AdditionalIncludeDirectories=".;"..\extern\lua-5.1\src";ffmpeg\modern_working\include;BaseClasses;..\extern\jsoncpp\include;"..\extern\glew-1.5.8\include";..\extern\pcre;"..\extern\mad-0.15.1b";..\extern\libpng\include;..\extern\libjpeg;..\extern\zlib;..\extern\vorbis" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WINDOWS;RELEASE;GLEW_STATIC" + PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,WINDOWS,RELEASE,GLEW_STATIC" StringPooling="true" MinimalRebuild="false" ExceptionHandling="0" diff --git a/src/TimingSegments.cpp b/src/TimingSegments.cpp index 0d241da25d..304623c285 100644 --- a/src/TimingSegments.cpp +++ b/src/TimingSegments.cpp @@ -250,18 +250,24 @@ void SpeedSegment::SetUnit(const int i) this->unit = static_cast(i); } -void SpeedSegment::Scale( int start, int length, int newLength ) +void SpeedSegment::Scale( int start, int oldLength, int newLength ) { if( GetUnit() == 0 ) { // XXX: this function is duplicated, there should be a better way float startBeat = GetBeat(); float endBeat = startBeat + GetLength(); - float newStartBeat = ScalePosition( NoteRowToBeat(start), NoteRowToBeat(length), NoteRowToBeat(newLength), startBeat ); - float newEndBeat = ScalePosition( NoteRowToBeat(start), NoteRowToBeat(length), NoteRowToBeat(newLength), endBeat ); + float newStartBeat = ScalePosition(NoteRowToBeat(start), + NoteRowToBeat(oldLength), + NoteRowToBeat(newLength), + startBeat); + float newEndBeat = ScalePosition(NoteRowToBeat(start), + NoteRowToBeat(oldLength), + NoteRowToBeat(newLength), + endBeat); SetLength( newEndBeat - newStartBeat ); } - TimingSegment::Scale( start, length, newLength ); + TimingSegment::Scale( start, oldLength, newLength ); } bool SpeedSegment::operator<( const SpeedSegment &other ) const