Skip to content

Commit

Permalink
fix clicking playlists teleporting to the song that sits underneath
Browse files Browse the repository at this point in the history
REALLY BAD SOLUTION
  • Loading branch information
poco0317 committed Sep 21, 2021
1 parent 244a61c commit 2b2b5a1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ local function highlight(self)
end

local update = false
local clickedForSinglePlaylist = false
local t = Def.ActorFrame {
BeginCommand = function(self)
self:queuecommand("Set"):visible(false)
Expand Down Expand Up @@ -251,10 +252,9 @@ local function TitleDisplayButton(i)
self:x(-22):zoomto(212, scoreYspacing):halign(0):diffusealpha(0)
end,
MouseLeftClickMessageCommand = function(self)
if
ButtonActive(self) and chartlist[i + ((currentchartpage - 1) * chartsperplaylist)] and
if ButtonActive(self) and chartlist[i + ((currentchartpage - 1) * chartsperplaylist)] and
chartlist[i + ((currentchartpage - 1) * chartsperplaylist)]:IsLoaded() and
singleplaylistactive
singleplaylistactive and not clickedForSinglePlaylist
then
whee:SelectSong(songlist[i + ((currentchartpage - 1) * chartsperplaylist)])
end
Expand Down Expand Up @@ -593,8 +593,12 @@ local function PlaylistTitleDisplayButton(i)
SONGMAN:SetActivePlaylist(allplaylists[i + ((currentplaylistpage - 1) * playlistsperpage)]:GetName())
pl = allplaylists[i + ((currentplaylistpage - 1) * playlistsperpage)]
MESSAGEMAN:Broadcast("DisplaySinglePlaylist")
clickedForSinglePlaylist = true
end
end
end,
MouseUpMessageCommand = function(self)
clickedForSinglePlaylist = false
end,
},
LoadFont("Common Large") .. {
Name = "Text",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
local showVisualizer = themeConfig:get_data().global.ShowVisualizer

local function input(event)
if event.DeviceInput.button == "DeviceButton_left mouse button" and event.type == "InputEventType_Release" then
MESSAGEMAN:Broadcast("MouseLeftClick")
elseif event.DeviceInput.button == "DeviceButton_right mouse button" and event.type == "InputEventType_Release" then
MESSAGEMAN:Broadcast("MouseRightClick")
if event.DeviceInput.button == "DeviceButton_left mouse button" then
if event.type == "InputEventType_Release" then
MESSAGEMAN:Broadcast("MouseLeftClick")
MESSAGEMAN:Broadcast("MouseUp", {event = event})
elseif event.type == "InputEventType_FirstPress" then
MESSAGEMAN:Broadcast("MouseDown", {event = event})
end
elseif event.DeviceInput.button == "DeviceButton_right mouse button" then
if event.type == "InputEventType_Release" then
MESSAGEMAN:Broadcast("MouseRightClick")
MESSAGEMAN:Broadcast("MouseUp", {event = event})
elseif event.type == "InputEventType_FirstPress" then
MESSAGEMAN:Broadcast("MouseDown", {event = event})
end
end
return false
end
Expand Down

0 comments on commit 2b2b5a1

Please sign in to comment.