@@ -4,69 +4,69 @@ return function(Style)
44
55 -- All the Compatible Songs Container.
66 local AllCompSongs = {}
7-
7+
88 -- For all Songs.
99 for _ , CurSong in pairs (SONGMAN :GetAllSongs ()) do
10-
10+
1111 -- Temp Difficulty Container.
1212 local DiffCon = {}
13-
13+
1414 -- Set the first value to be Current Looped Song, In the Temp Current Song Container.
15- local CurSongCon = {CurSong }
16-
15+ local CurSongCon = { CurSong }
16+
1717 -- For all the steps in Current looped Song.
1818 for i , CurStep in ipairs (CurSong :GetAllSteps ()) do
1919 -- Find if Steps supports current selected Style.
2020
2121 if string.find (CurStep :GetStepsType ():lower (), Style ) then
2222
23- -- Check the type of Steps
23+ -- Check the type of Steps
2424 local Type = 1
2525
2626 -- Check if its HalfDoubles.
2727 if string.find (CurStep :GetStepsType ():lower (), " half" ) then
2828 Type = 2
29- -- Check if its Doubles.
29+ -- Check if its Doubles.
3030 elseif string.find (CurStep :GetStepsType ():lower (), " double" ) then
3131 Type = 3
3232 end
33-
33+
3434 -- Check the step level.
3535 local Meter = tonumber (CurStep :GetMeter ())
3636 -- If the step level is under 10, Add a 0 in front.
3737 if tonumber (CurStep :GetMeter ()) < 10 then
3838 -- Add the 0.
39- Meter = " 0" .. CurStep :GetMeter ()
39+ Meter = " 0" .. CurStep :GetMeter ()
4040 end
4141 -- Add the Difficulty to the Temp Difficulty Contrainer.
42- DiffCon [Type .. " _" .. tonumber (TF_WHEEL .DiffTab [CurStep :GetDifficulty ()]).. " _" .. Meter ] = CurStep
42+ DiffCon [Type .. " _" .. tonumber (TF_WHEEL .DiffTab [CurStep :GetDifficulty ()]) .. " _" .. Meter ] = CurStep
4343 end
4444 end
45-
45+
4646 -- We want to sort the Difficulties, So we gra the Keys and Sort based on them.
4747 local Keys = {}
4848 for k in pairs (DiffCon ) do table.insert (Keys , k ) end
4949 table.sort (Keys )
50-
50+
5151 -- Now we put the Difficulies inside the Temp Current Song Contrainer.
5252 for _ , k in pairs (Keys ) do
5353 if DiffCon [k ] then
54- CurSongCon [# CurSongCon + 1 ] = DiffCon [k ]
54+ CurSongCon [# CurSongCon + 1 ] = DiffCon [k ]
5555 end
5656 end
57-
57+
5858 -- If a Difficulty exist for song using Style, Add it to All Compatible Songs.
59- if CurSongCon [2 ] then
60- AllCompSongs [# AllCompSongs + 1 ] = CurSongCon
59+ if CurSongCon [2 ] then
60+ AllCompSongs [# AllCompSongs + 1 ] = CurSongCon
6161 end
62- end
62+ end
63+
64+ local function compare (a , b )
65+ return a [1 ]:GetDisplayMainTitle () < b [1 ]:GetDisplayMainTitle ()
66+ end
6367
64- local function compare (a ,b )
65- return a [1 ]:GetDisplayMainTitle () < b [1 ]:GetDisplayMainTitle ()
66- end
67-
6868 table.sort (AllCompSongs , compare )
6969
7070 -- Return all the Songs, That support Current Style.
7171 return AllCompSongs
72- end
72+ end
0 commit comments