Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SMLoader(Steps)
- local Open_SM = RageFileUtil.CreateRageFile()
- local CurGS = ToEnumShortString(Steps:GetStepsType()):lower():gsub("_","-")
- local CurDiff = ToEnumShortString(Steps:GetDifficulty())
- local FBeat = GAMESTATE:GetCurrentSong():GetFirstBeat()
- local function CheckGS(Line)
- for i in string.gmatch(Line, "%s+(.-):") do
- if i == CurGS then
- return true
- end
- end
- return false
- end
- local function CheckDiff(Line)
- for i in string.gmatch(Line, "%s+(.-):") do
- if i == CurDiff then
- return true
- end
- end
- return false
- end
- Open_SM:Open(Steps:GetFilename(), 1)
- SM_File = Open_SM:Read()
- Output = {}
- for i in string.gmatch(SM_File, "#NOTES:.-;") do
- if CheckGS(i) and CheckDiff(i) then
- local Beat = 0
- for i2 in string.gmatch(i:gsub(".+:",""):gsub(";",","):gsub("//.-\n",""):gsub(" ",""), "%s(.-),") do
- Beat = Beat + 4
- AL = 0
- CL = 0
- for _ in string.gmatch(i2, "%w+") do
- AL = AL + 1
- end
- for i3 in string.gmatch(i2, "%w+") do
- SBeat = (Beat-4)+((4/AL)*CL)
- CL = CL + 1
- CI = 1
- for i4 in string.gmatch(i3, "%w") do
- if i4 == "1" then
- Output[#Output+1] = {SBeat,Exp_Buttons[GAMESTATE:GetCurrentGame():GetName()][GAMESTATE:GetCurrentStyle():GetName()][CI]}
- end
- CI = CI + 1
- end
- end
- end
- end
- end
- return Output
- end
- Exp_Buttons = {
- dance = {
- single = {"Left","Down","Up","Right"},
- solo = {"Left","UpLeft","Down","Up","UpRight","Right"},
- },
- pump = {},
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement