Skip to content

Commit 48d4448

Browse files
committed
fix right click pausing in til death in general
makes it much more "reliable"
1 parent 00fd30c commit 48d4448

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

Themes/Til Death/BGAnimations/_chartpreview.lua

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,6 @@ local t = Def.ActorFrame {
6565
musicratio = (GAMESTATE:GetCurrentSong():GetFirstSecond() / getCurRateValue() + GAMESTATE:GetCurrentSteps():GetLengthSeconds()) / wodth * getCurRateValue()
6666
end
6767
end,
68-
MouseRightClickMessageCommand=function(self)
69-
local tab = getTabIndex()
70-
-- the Score and Profile tabs have right click functionality
71-
-- so ignore right clicks if on those
72-
if tab ~= 2 and tab ~= 4 then
73-
SCREENMAN:GetTopScreen():PauseSampleMusic()
74-
self:GetChild("pausetext"):playcommand("Set")
75-
end
76-
end,
7768
SetupNoteFieldCommand=function(self)
7869
self:playcommand("NoteFieldVisible")
7970
end,
@@ -167,7 +158,10 @@ local t = Def.ActorFrame {
167158
else
168159
self:settext("")
169160
end
170-
end
161+
end,
162+
MusicPauseToggledMessageCommand = function(self)
163+
self:playcommand("Set")
164+
end,
171165
},
172166
Def.Quad {
173167
Name = "PosBG",

Themes/Til Death/BGAnimations/_songbg.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,18 @@ t[#t + 1] = Def.Quad {
4747
end
4848
}
4949

50+
t[#t+1] = UIElements.QuadButton(1, 100) .. {-- a fullscreen button for right click pausing so your right clicks dont pause accidentally
51+
InitCommand = function(self)
52+
self:valign(0):halign(0)
53+
self:zoomto(SCREEN_WIDTH, SCREEN_HEIGHT)
54+
self:diffusealpha(0)
55+
end,
56+
MouseDownCommand = function(self, params)
57+
if params.event == "DeviceButton_right mouse button" then
58+
SCREENMAN:GetTopScreen():PauseSampleMusic()
59+
MESSAGEMAN:Broadcast("MusicPauseToggled")
60+
end
61+
end
62+
}
63+
5064
return t

0 commit comments

Comments
 (0)