Skip to content

Commit

Permalink
require click to occur on the musicwheel scroller first before dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Aug 5, 2021
1 parent c1cad55 commit 48ac479
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions Themes/Til Death/Graphics/ScrollBar TickThumb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,22 @@ t[#t + 1] = Def.ActorFrame {
BeginCommand = function(self)
SCREENMAN:GetTopScreen():AddInputCallback(function(event)
if event.DeviceInput.button == "DeviceButton_left mouse button" then
if event.type ~= "InputEventType_Release" then
if event.type == "InputEventType_FirstPress" then
mdown = true

self:SetUpdateFunction(function(self)
local mx = SCREEN_WIDTH - INPUTFILTER:GetMouseX()
local my = SCREEN_HEIGHT - INPUTFILTER:GetMouseY()
if moving or mx < 32 and mx > 0 and my < 440 and my > 48 then
moving = true
self:playcommand("ClickingMusicWheelScroller")
end
end)
else
local mx = SCREEN_WIDTH - INPUTFILTER:GetMouseX()
local my = SCREEN_HEIGHT - INPUTFILTER:GetMouseY()
if mx < 32 and mx > 0 and my < 440 and my > 48 then
self:SetUpdateFunction(function(self)
local mx = SCREEN_WIDTH - INPUTFILTER:GetMouseX()
local my = SCREEN_HEIGHT - INPUTFILTER:GetMouseY()
if moving or mx < 32 and mx > 0 and my < 440 and my > 48 then
moving = true
self:playcommand("ClickingMusicWheelScroller")
end
end)
end
elseif event.type == "InputEventType_Release" then
mdown = false
moving = false
self:SetUpdateFunction(nil)
Expand Down

0 comments on commit 48ac479

Please sign in to comment.