Skip to content

Commit

Permalink
Merge pull request #222 from poco0317/filter_fix1
Browse files Browse the repository at this point in the history
Fix Filter Lag & Filter Tab Change Lock
  • Loading branch information
TheROPFather authored Aug 17, 2018
2 parents 41c92ba + 8507174 commit 713ce90
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@ end

local function FilterInput(event)
if event.type ~= "InputEventType_Release" and ActiveSS > 0 and active then
local shouldUpdate = false
if event.button == "Start" or event.button == "Back" then
ActiveSS = 0
MESSAGEMAN:Broadcast("NumericInputEnded")
SCREENMAN:set_input_redirected(PLAYER_1, false)
return true
elseif event.DeviceInput.button == "DeviceButton_backspace" then
SSQuery[activebound][ActiveSS] = SSQuery[activebound][ActiveSS]:sub(1, -2)
shouldUpdate = true
elseif event.DeviceInput.button == "DeviceButton_delete" then
SSQuery[activebound][ActiveSS] = ""
shouldUpdate = true
else
for i=1,#numbershers do
if event.DeviceInput.button == "DeviceButton_"..numbershers[i] then
shouldUpdate = true
if SSQuery[activebound][ActiveSS] == "0" then
SSQuery[activebound][ActiveSS] = ""
end
Expand All @@ -44,11 +48,14 @@ local function FilterInput(event)
end
end
if SSQuery[activebound][ActiveSS] == "" then
shouldUpdate = true
SSQuery[activebound][ActiveSS] = "0"
end
FILTERMAN:SetSSFilter(tonumber(SSQuery[activebound][ActiveSS]), ActiveSS, activebound)
whee:SongSearch("") -- stupid workaround?
MESSAGEMAN:Broadcast("UpdateFilter")
if shouldUpdate then
FILTERMAN:SetSSFilter(tonumber(SSQuery[activebound][ActiveSS]), ActiveSS, activebound)
whee:SongSearch("") -- stupid workaround?
MESSAGEMAN:Broadcast("UpdateFilter")
end
end
end

Expand Down Expand Up @@ -395,6 +402,8 @@ f[#f+1] = Def.Quad{
activebound = 0
ActiveSS = 0
MESSAGEMAN:Broadcast("UpdateFilter")
MESSAGEMAN:Broadcast("NumericInputEnded")
SCREENMAN:set_input_redirected(PLAYER_1, false)
whee:SongSearch("")
end
end
Expand Down

0 comments on commit 713ce90

Please sign in to comment.