Skip to content

Commit

Permalink
fix right click pausing in til death in general
Browse files Browse the repository at this point in the history
makes it much more "reliable"
  • Loading branch information
poco0317 committed Oct 16, 2021
1 parent 00fd30c commit 48d4448
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 4 additions & 10 deletions Themes/Til Death/BGAnimations/_chartpreview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@ local t = Def.ActorFrame {
musicratio = (GAMESTATE:GetCurrentSong():GetFirstSecond() / getCurRateValue() + GAMESTATE:GetCurrentSteps():GetLengthSeconds()) / wodth * getCurRateValue()
end
end,
MouseRightClickMessageCommand=function(self)
local tab = getTabIndex()
-- the Score and Profile tabs have right click functionality
-- so ignore right clicks if on those
if tab ~= 2 and tab ~= 4 then
SCREENMAN:GetTopScreen():PauseSampleMusic()
self:GetChild("pausetext"):playcommand("Set")
end
end,
SetupNoteFieldCommand=function(self)
self:playcommand("NoteFieldVisible")
end,
Expand Down Expand Up @@ -167,7 +158,10 @@ local t = Def.ActorFrame {
else
self:settext("")
end
end
end,
MusicPauseToggledMessageCommand = function(self)
self:playcommand("Set")
end,
},
Def.Quad {
Name = "PosBG",
Expand Down
14 changes: 14 additions & 0 deletions Themes/Til Death/BGAnimations/_songbg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,18 @@ t[#t + 1] = Def.Quad {
end
}

t[#t+1] = UIElements.QuadButton(1, 100) .. {-- a fullscreen button for right click pausing so your right clicks dont pause accidentally
InitCommand = function(self)
self:valign(0):halign(0)
self:zoomto(SCREEN_WIDTH, SCREEN_HEIGHT)
self:diffusealpha(0)
end,
MouseDownCommand = function(self, params)
if params.event == "DeviceButton_right mouse button" then
SCREENMAN:GetTopScreen():PauseSampleMusic()
MESSAGEMAN:Broadcast("MusicPauseToggled")
end
end
}

return t

0 comments on commit 48d4448

Please sign in to comment.