From b3b15caf628ce3172946d6dd6cd455dd993cb90c Mon Sep 17 00:00:00 2001 From: dionzz99 Date: Fri, 7 May 2021 01:23:17 +0700 Subject: [PATCH 1/4] restructuring code and added reverse order feature --- KeepStill/plugin.lua | 68 +++++++++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/KeepStill/plugin.lua b/KeepStill/plugin.lua index 834719b..bce2ae3 100644 --- a/KeepStill/plugin.lua +++ b/KeepStill/plugin.lua @@ -13,14 +13,15 @@ function draw() state.IsWindowHovered = imgui.IsWindowHovered() - --I'll implement some way to input numbers if/when I feel like it local AVG_SV = state.GetValue("AVG_SV") or 1 --What SV to normalize to local INCREMENT = state.GetValue("INCREMENT") or 2^-6 --powers of 2 are your friend, small number also bad, but small number funny and make playfield go teleport, numbers smaller than this may cause rounding errors - local INT_SV = state.GetValue("INT_SV") or 0 + local INT_SV = state.GetValue("INT_SV") or 0 --all selected objects will still move with this speed + local reverse = state.GetValue("reverse") or false --sets option to reverse the order of the note. visually will be upside down and has to be read from above to bottom. _, AVG_SV = imgui.InputFloat("Average SV", AVG_SV, .05) _, INCREMENT = imgui.InputFloat("Teleport Duration", INCREMENT, 2^-6) _, INT_SV = imgui.InputFloat("Intermediate SV", INT_SV, .05) + _, reverse = imgui.Checkbox("reverse order", reverse) if INCREMENT <= 0 then INCREMENT = 2^-6 @@ -40,32 +41,59 @@ function draw() local svs = {} - for i, starttime in pairs(starttimes) do - --this is terrible - if i == 1 then - table.insert(svs, utils.CreateScrollVelocity(starttime, INT_SV)) - elseif i == #starttimes then - table.insert(svs, utils.CreateScrollVelocity(starttime - INCREMENT, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) - table.insert(svs, utils.CreateScrollVelocity(starttime, AVG_SV)) - else - local num_increments - if i == 2 then - num_increments = 1 - else - num_increments = 2 - end - table.insert(svs, utils.CreateScrollVelocity(starttime - INCREMENT, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV * (starttimes[i] - starttimes[i-1] - num_increments * INCREMENT) / (starttimes[i] - starttimes[i-1])))) - table.insert(svs, utils.CreateScrollVelocity(starttime, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV * (starttimes[i] - starttimes[i-1] - num_increments * INCREMENT) / (starttimes[i] - starttimes[i-1])) * -1)) - table.insert(svs, utils.CreateScrollVelocity(starttime + INCREMENT, INT_SV)) + if reverse then + --processes in reverse order + table.insert(svs, utils.CreateScrollVelocity(starttimes[1] - INCREMENT, (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) + table.insert(svs, utils.CreateScrollVelocity(starttimes[1], INT_SV)) + for i=2,#starttimes-1,1 do + --moving calculation to one variable so it will only excecuted once and used twice. Intrepeters might already ahead of this so efficiency might not be significant. + local num_sv = (starttimes[#starttimes-i+1] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV) + table.insert(svs, utils.CreateScrollVelocity(starttimes[i] - INCREMENT, num_sv)) + table.insert(svs, utils.CreateScrollVelocity(starttimes[i], -1 * num_sv)) + table.insert(svs, utils.CreateScrollVelocity(starttimes[i] + INCREMENT, INT_SV)) end + table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes], (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) + table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes] + INCREMENT, AVG_SV)) + else + --processes in normal order + table.insert(svs, utils.CreateScrollVelocity(starttimes[1], INT_SV)) + for i=2,#starttimes-1,1 do + local num_sv = (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV) + table.insert(svs, utils.CreateScrollVelocity(starttimes[i] - INCREMENT, num_sv)) + table.insert(svs, utils.CreateScrollVelocity(starttimes[i], -1 * num_sv)) + table.insert(svs, utils.CreateScrollVelocity(starttimes[i] + INCREMENT, INT_SV)) + end + table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes] - INCREMENT, (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) + table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes], AVG_SV)) end - + + -- old code -- + -- for i, starttime in pairs(starttimes) do + -- --this is terrible + -- if i == 1 then + -- table.insert(svs, utils.CreateScrollVelocity(starttime, INT_SV)) + -- elseif i == #starttimes then + -- table.insert(svs, utils.CreateScrollVelocity(starttime - INCREMENT, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) + -- table.insert(svs, utils.CreateScrollVelocity(starttime, AVG_SV)) + -- else + -- local num_increments + -- if i == 2 then + -- num_increments = 1 + -- else + -- num_increments = 2 + -- end + -- table.insert(svs, utils.CreateScrollVelocity(starttime - INCREMENT, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV * (starttimes[i] - starttimes[i-1] - num_increments * INCREMENT) / (starttimes[i] - starttimes[i-1])))) + -- table.insert(svs, utils.CreateScrollVelocity(starttime, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV * (starttimes[i] - starttimes[i-1] - num_increments * INCREMENT) / (starttimes[i] - starttimes[i-1])) * -1)) + -- table.insert(svs, utils.CreateScrollVelocity(starttime + INCREMENT, INT_SV)) + -- end + -- end actions.PlaceScrollVelocityBatch(svs) end state.SetValue("AVG_SV", AVG_SV) state.SetValue("INCREMENT", INCREMENT) state.SetValue("INT_SV", INT_SV) + state.SetValue("reverse",reverse) imgui.End() end From d9c075debd31c71a66de6b9427cb3b5e7945f0a7 Mon Sep 17 00:00:00 2001 From: dionzz99 Date: Fri, 7 May 2021 03:17:03 +0700 Subject: [PATCH 2/4] fixed first SV mispositioning other notes --- KeepStill/plugin.lua | 4 +- plugin.lua | 99 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 plugin.lua diff --git a/KeepStill/plugin.lua b/KeepStill/plugin.lua index bce2ae3..a3b440d 100644 --- a/KeepStill/plugin.lua +++ b/KeepStill/plugin.lua @@ -43,9 +43,7 @@ function draw() if reverse then --processes in reverse order - table.insert(svs, utils.CreateScrollVelocity(starttimes[1] - INCREMENT, (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) - table.insert(svs, utils.CreateScrollVelocity(starttimes[1], INT_SV)) - for i=2,#starttimes-1,1 do + for i=1,#starttimes-1,1 do --moving calculation to one variable so it will only excecuted once and used twice. Intrepeters might already ahead of this so efficiency might not be significant. local num_sv = (starttimes[#starttimes-i+1] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV) table.insert(svs, utils.CreateScrollVelocity(starttimes[i] - INCREMENT, num_sv)) diff --git a/plugin.lua b/plugin.lua new file mode 100644 index 0000000..bce2ae3 --- /dev/null +++ b/plugin.lua @@ -0,0 +1,99 @@ +local function not_has(table, val) + for _, value in pairs(table) do + if value == val then + return false + end + end + + return true +end + +function draw() + imgui.Begin("Keep Still") + + state.IsWindowHovered = imgui.IsWindowHovered() + + local AVG_SV = state.GetValue("AVG_SV") or 1 --What SV to normalize to + local INCREMENT = state.GetValue("INCREMENT") or 2^-6 --powers of 2 are your friend, small number also bad, but small number funny and make playfield go teleport, numbers smaller than this may cause rounding errors + local INT_SV = state.GetValue("INT_SV") or 0 --all selected objects will still move with this speed + local reverse = state.GetValue("reverse") or false --sets option to reverse the order of the note. visually will be upside down and has to be read from above to bottom. + + _, AVG_SV = imgui.InputFloat("Average SV", AVG_SV, .05) + _, INCREMENT = imgui.InputFloat("Teleport Duration", INCREMENT, 2^-6) + _, INT_SV = imgui.InputFloat("Intermediate SV", INT_SV, .05) + _, reverse = imgui.Checkbox("reverse order", reverse) + + if INCREMENT <= 0 then + INCREMENT = 2^-6 + end + + if imgui.Button("click me") then + local notes = state.SelectedHitObjects --should check to see if there are enough objects selected but I don't care + + --maybe jank way of removing redundant notes idk + local starttimes = {} + + for _,note in pairs(notes) do + if not_has(starttimes, note.StartTime) then + table.insert(starttimes, note.StartTime) + end + end + + local svs = {} + + if reverse then + --processes in reverse order + table.insert(svs, utils.CreateScrollVelocity(starttimes[1] - INCREMENT, (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) + table.insert(svs, utils.CreateScrollVelocity(starttimes[1], INT_SV)) + for i=2,#starttimes-1,1 do + --moving calculation to one variable so it will only excecuted once and used twice. Intrepeters might already ahead of this so efficiency might not be significant. + local num_sv = (starttimes[#starttimes-i+1] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV) + table.insert(svs, utils.CreateScrollVelocity(starttimes[i] - INCREMENT, num_sv)) + table.insert(svs, utils.CreateScrollVelocity(starttimes[i], -1 * num_sv)) + table.insert(svs, utils.CreateScrollVelocity(starttimes[i] + INCREMENT, INT_SV)) + end + table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes], (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) + table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes] + INCREMENT, AVG_SV)) + else + --processes in normal order + table.insert(svs, utils.CreateScrollVelocity(starttimes[1], INT_SV)) + for i=2,#starttimes-1,1 do + local num_sv = (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV) + table.insert(svs, utils.CreateScrollVelocity(starttimes[i] - INCREMENT, num_sv)) + table.insert(svs, utils.CreateScrollVelocity(starttimes[i], -1 * num_sv)) + table.insert(svs, utils.CreateScrollVelocity(starttimes[i] + INCREMENT, INT_SV)) + end + table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes] - INCREMENT, (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) + table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes], AVG_SV)) + end + + -- old code -- + -- for i, starttime in pairs(starttimes) do + -- --this is terrible + -- if i == 1 then + -- table.insert(svs, utils.CreateScrollVelocity(starttime, INT_SV)) + -- elseif i == #starttimes then + -- table.insert(svs, utils.CreateScrollVelocity(starttime - INCREMENT, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) + -- table.insert(svs, utils.CreateScrollVelocity(starttime, AVG_SV)) + -- else + -- local num_increments + -- if i == 2 then + -- num_increments = 1 + -- else + -- num_increments = 2 + -- end + -- table.insert(svs, utils.CreateScrollVelocity(starttime - INCREMENT, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV * (starttimes[i] - starttimes[i-1] - num_increments * INCREMENT) / (starttimes[i] - starttimes[i-1])))) + -- table.insert(svs, utils.CreateScrollVelocity(starttime, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV * (starttimes[i] - starttimes[i-1] - num_increments * INCREMENT) / (starttimes[i] - starttimes[i-1])) * -1)) + -- table.insert(svs, utils.CreateScrollVelocity(starttime + INCREMENT, INT_SV)) + -- end + -- end + actions.PlaceScrollVelocityBatch(svs) + end + + state.SetValue("AVG_SV", AVG_SV) + state.SetValue("INCREMENT", INCREMENT) + state.SetValue("INT_SV", INT_SV) + state.SetValue("reverse",reverse) + + imgui.End() +end From 7f6155834fdcb7299ddc92bbb723a01964a5a92d Mon Sep 17 00:00:00 2001 From: dionzz99 Date: Fri, 7 May 2021 03:24:22 +0700 Subject: [PATCH 3/4] deleting plugin outside folder --- plugin.lua | 99 ------------------------------------------------------ 1 file changed, 99 deletions(-) delete mode 100644 plugin.lua diff --git a/plugin.lua b/plugin.lua deleted file mode 100644 index bce2ae3..0000000 --- a/plugin.lua +++ /dev/null @@ -1,99 +0,0 @@ -local function not_has(table, val) - for _, value in pairs(table) do - if value == val then - return false - end - end - - return true -end - -function draw() - imgui.Begin("Keep Still") - - state.IsWindowHovered = imgui.IsWindowHovered() - - local AVG_SV = state.GetValue("AVG_SV") or 1 --What SV to normalize to - local INCREMENT = state.GetValue("INCREMENT") or 2^-6 --powers of 2 are your friend, small number also bad, but small number funny and make playfield go teleport, numbers smaller than this may cause rounding errors - local INT_SV = state.GetValue("INT_SV") or 0 --all selected objects will still move with this speed - local reverse = state.GetValue("reverse") or false --sets option to reverse the order of the note. visually will be upside down and has to be read from above to bottom. - - _, AVG_SV = imgui.InputFloat("Average SV", AVG_SV, .05) - _, INCREMENT = imgui.InputFloat("Teleport Duration", INCREMENT, 2^-6) - _, INT_SV = imgui.InputFloat("Intermediate SV", INT_SV, .05) - _, reverse = imgui.Checkbox("reverse order", reverse) - - if INCREMENT <= 0 then - INCREMENT = 2^-6 - end - - if imgui.Button("click me") then - local notes = state.SelectedHitObjects --should check to see if there are enough objects selected but I don't care - - --maybe jank way of removing redundant notes idk - local starttimes = {} - - for _,note in pairs(notes) do - if not_has(starttimes, note.StartTime) then - table.insert(starttimes, note.StartTime) - end - end - - local svs = {} - - if reverse then - --processes in reverse order - table.insert(svs, utils.CreateScrollVelocity(starttimes[1] - INCREMENT, (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) - table.insert(svs, utils.CreateScrollVelocity(starttimes[1], INT_SV)) - for i=2,#starttimes-1,1 do - --moving calculation to one variable so it will only excecuted once and used twice. Intrepeters might already ahead of this so efficiency might not be significant. - local num_sv = (starttimes[#starttimes-i+1] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV) - table.insert(svs, utils.CreateScrollVelocity(starttimes[i] - INCREMENT, num_sv)) - table.insert(svs, utils.CreateScrollVelocity(starttimes[i], -1 * num_sv)) - table.insert(svs, utils.CreateScrollVelocity(starttimes[i] + INCREMENT, INT_SV)) - end - table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes], (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) - table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes] + INCREMENT, AVG_SV)) - else - --processes in normal order - table.insert(svs, utils.CreateScrollVelocity(starttimes[1], INT_SV)) - for i=2,#starttimes-1,1 do - local num_sv = (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV) - table.insert(svs, utils.CreateScrollVelocity(starttimes[i] - INCREMENT, num_sv)) - table.insert(svs, utils.CreateScrollVelocity(starttimes[i], -1 * num_sv)) - table.insert(svs, utils.CreateScrollVelocity(starttimes[i] + INCREMENT, INT_SV)) - end - table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes] - INCREMENT, (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) - table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes], AVG_SV)) - end - - -- old code -- - -- for i, starttime in pairs(starttimes) do - -- --this is terrible - -- if i == 1 then - -- table.insert(svs, utils.CreateScrollVelocity(starttime, INT_SV)) - -- elseif i == #starttimes then - -- table.insert(svs, utils.CreateScrollVelocity(starttime - INCREMENT, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) - -- table.insert(svs, utils.CreateScrollVelocity(starttime, AVG_SV)) - -- else - -- local num_increments - -- if i == 2 then - -- num_increments = 1 - -- else - -- num_increments = 2 - -- end - -- table.insert(svs, utils.CreateScrollVelocity(starttime - INCREMENT, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV * (starttimes[i] - starttimes[i-1] - num_increments * INCREMENT) / (starttimes[i] - starttimes[i-1])))) - -- table.insert(svs, utils.CreateScrollVelocity(starttime, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV * (starttimes[i] - starttimes[i-1] - num_increments * INCREMENT) / (starttimes[i] - starttimes[i-1])) * -1)) - -- table.insert(svs, utils.CreateScrollVelocity(starttime + INCREMENT, INT_SV)) - -- end - -- end - actions.PlaceScrollVelocityBatch(svs) - end - - state.SetValue("AVG_SV", AVG_SV) - state.SetValue("INCREMENT", INCREMENT) - state.SetValue("INT_SV", INT_SV) - state.SetValue("reverse",reverse) - - imgui.End() -end From 0989fca93095b195f7ba9d89c5e5ffafbecdd003 Mon Sep 17 00:00:00 2001 From: dionzz99 Date: Sun, 9 May 2021 00:48:29 +0700 Subject: [PATCH 4/4] deleting unused file --- KeepStill/plugin.lua | 1 + plugin.lua | 99 -------------------------------------------- 2 files changed, 1 insertion(+), 99 deletions(-) delete mode 100644 plugin.lua diff --git a/KeepStill/plugin.lua b/KeepStill/plugin.lua index a3b440d..d8efbd0 100644 --- a/KeepStill/plugin.lua +++ b/KeepStill/plugin.lua @@ -46,6 +46,7 @@ function draw() for i=1,#starttimes-1,1 do --moving calculation to one variable so it will only excecuted once and used twice. Intrepeters might already ahead of this so efficiency might not be significant. local num_sv = (starttimes[#starttimes-i+1] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV) + num_sv = num_sv + num_sv * ((INT_SV / AVG_SV)*4) table.insert(svs, utils.CreateScrollVelocity(starttimes[i] - INCREMENT, num_sv)) table.insert(svs, utils.CreateScrollVelocity(starttimes[i], -1 * num_sv)) table.insert(svs, utils.CreateScrollVelocity(starttimes[i] + INCREMENT, INT_SV)) diff --git a/plugin.lua b/plugin.lua deleted file mode 100644 index bce2ae3..0000000 --- a/plugin.lua +++ /dev/null @@ -1,99 +0,0 @@ -local function not_has(table, val) - for _, value in pairs(table) do - if value == val then - return false - end - end - - return true -end - -function draw() - imgui.Begin("Keep Still") - - state.IsWindowHovered = imgui.IsWindowHovered() - - local AVG_SV = state.GetValue("AVG_SV") or 1 --What SV to normalize to - local INCREMENT = state.GetValue("INCREMENT") or 2^-6 --powers of 2 are your friend, small number also bad, but small number funny and make playfield go teleport, numbers smaller than this may cause rounding errors - local INT_SV = state.GetValue("INT_SV") or 0 --all selected objects will still move with this speed - local reverse = state.GetValue("reverse") or false --sets option to reverse the order of the note. visually will be upside down and has to be read from above to bottom. - - _, AVG_SV = imgui.InputFloat("Average SV", AVG_SV, .05) - _, INCREMENT = imgui.InputFloat("Teleport Duration", INCREMENT, 2^-6) - _, INT_SV = imgui.InputFloat("Intermediate SV", INT_SV, .05) - _, reverse = imgui.Checkbox("reverse order", reverse) - - if INCREMENT <= 0 then - INCREMENT = 2^-6 - end - - if imgui.Button("click me") then - local notes = state.SelectedHitObjects --should check to see if there are enough objects selected but I don't care - - --maybe jank way of removing redundant notes idk - local starttimes = {} - - for _,note in pairs(notes) do - if not_has(starttimes, note.StartTime) then - table.insert(starttimes, note.StartTime) - end - end - - local svs = {} - - if reverse then - --processes in reverse order - table.insert(svs, utils.CreateScrollVelocity(starttimes[1] - INCREMENT, (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) - table.insert(svs, utils.CreateScrollVelocity(starttimes[1], INT_SV)) - for i=2,#starttimes-1,1 do - --moving calculation to one variable so it will only excecuted once and used twice. Intrepeters might already ahead of this so efficiency might not be significant. - local num_sv = (starttimes[#starttimes-i+1] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV) - table.insert(svs, utils.CreateScrollVelocity(starttimes[i] - INCREMENT, num_sv)) - table.insert(svs, utils.CreateScrollVelocity(starttimes[i], -1 * num_sv)) - table.insert(svs, utils.CreateScrollVelocity(starttimes[i] + INCREMENT, INT_SV)) - end - table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes], (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) - table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes] + INCREMENT, AVG_SV)) - else - --processes in normal order - table.insert(svs, utils.CreateScrollVelocity(starttimes[1], INT_SV)) - for i=2,#starttimes-1,1 do - local num_sv = (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV) - table.insert(svs, utils.CreateScrollVelocity(starttimes[i] - INCREMENT, num_sv)) - table.insert(svs, utils.CreateScrollVelocity(starttimes[i], -1 * num_sv)) - table.insert(svs, utils.CreateScrollVelocity(starttimes[i] + INCREMENT, INT_SV)) - end - table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes] - INCREMENT, (starttimes[#starttimes] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) - table.insert(svs, utils.CreateScrollVelocity(starttimes[#starttimes], AVG_SV)) - end - - -- old code -- - -- for i, starttime in pairs(starttimes) do - -- --this is terrible - -- if i == 1 then - -- table.insert(svs, utils.CreateScrollVelocity(starttime, INT_SV)) - -- elseif i == #starttimes then - -- table.insert(svs, utils.CreateScrollVelocity(starttime - INCREMENT, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV))) - -- table.insert(svs, utils.CreateScrollVelocity(starttime, AVG_SV)) - -- else - -- local num_increments - -- if i == 2 then - -- num_increments = 1 - -- else - -- num_increments = 2 - -- end - -- table.insert(svs, utils.CreateScrollVelocity(starttime - INCREMENT, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV * (starttimes[i] - starttimes[i-1] - num_increments * INCREMENT) / (starttimes[i] - starttimes[i-1])))) - -- table.insert(svs, utils.CreateScrollVelocity(starttime, (starttimes[i] - starttimes[1]) / INCREMENT * (AVG_SV - INT_SV * (starttimes[i] - starttimes[i-1] - num_increments * INCREMENT) / (starttimes[i] - starttimes[i-1])) * -1)) - -- table.insert(svs, utils.CreateScrollVelocity(starttime + INCREMENT, INT_SV)) - -- end - -- end - actions.PlaceScrollVelocityBatch(svs) - end - - state.SetValue("AVG_SV", AVG_SV) - state.SetValue("INCREMENT", INCREMENT) - state.SetValue("INT_SV", INT_SV) - state.SetValue("reverse",reverse) - - imgui.End() -end