Skip to content

Commit 7b274ec

Browse files
encase goaltracker buttons actions in if statements
1 parent f03a163 commit 7b274ec

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/goaltracker.lua

+7-7
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,13 @@ local function makescoregoal(i)
194194
Def.Quad{
195195
InitCommand=cmd(halign,0;zoomto,28,buttonheight;diffuse,getMainColor('positive');diffusealpha,buttondiffuse),
196196
MouseLeftClickMessageCommand=function(self)
197-
if isOver(self) and update then
197+
if sg and isOver(self) and update then
198198
sg:SetRate(sg:GetRate()+0.1)
199199
MESSAGEMAN:Broadcast("UpdateGoals")
200200
end
201201
end,
202202
MouseRightClickMessageCommand=function(self)
203-
if isOver(self) and update then
203+
if sg and isOver(self) and update then
204204
sg:SetRate(sg:GetRate()-0.1)
205205
MESSAGEMAN:Broadcast("UpdateGoals")
206206
end
@@ -250,13 +250,13 @@ local function makescoregoal(i)
250250
Def.Quad{
251251
InitCommand=cmd(y,goalrow2Y;halign,0;zoomto,25,buttonheight;diffuse,getMainColor('positive');diffusealpha,buttondiffuse),
252252
MouseLeftClickMessageCommand=function(self)
253-
if isOver(self) and update then
253+
if sg and isOver(self) and update then
254254
sg:SetPercent(sg:GetPercent()+0.01)
255255
MESSAGEMAN:Broadcast("UpdateGoals")
256256
end
257257
end,
258258
MouseRightClickMessageCommand=function(self)
259-
if isOver(self) and update then
259+
if sg and isOver(self) and update then
260260
sg:SetPercent(sg:GetPercent()-0.01)
261261
MESSAGEMAN:Broadcast("UpdateGoals")
262262
end
@@ -329,13 +329,13 @@ local function makescoregoal(i)
329329
Def.Quad{
330330
InitCommand=cmd(x,-16;halign,0;zoomto,16,buttonheight;diffuse,getMainColor('positive');diffusealpha,buttondiffuse),
331331
MouseLeftClickMessageCommand=function(self)
332-
if isOver(self) and update then
332+
if sg and isOver(self) and update then
333333
sg:SetPriority(sg:GetPriority()+1)
334334
MESSAGEMAN:Broadcast("UpdateGoals")
335335
end
336336
end,
337337
MouseRightClickMessageCommand=function(self)
338-
if isOver(self) and update then
338+
if sg and isOver(self) and update then
339339
sg:SetPriority(sg:GetPriority()-1)
340340
MESSAGEMAN:Broadcast("UpdateGoals")
341341
end
@@ -344,7 +344,7 @@ local function makescoregoal(i)
344344
Def.Quad{
345345
InitCommand=cmd(x,325;halign,0;zoomto,4,4;diffuse,byJudgment('TapNoteScore_Miss');diffusealpha,1),
346346
MouseLeftClickMessageCommand=function(self)
347-
if isOver(self) and update and sg then
347+
if sg and isOver(self) and update and sg then
348348
sg:Delete()
349349
MESSAGEMAN:Broadcast("UpdateGoals")
350350
end

0 commit comments

Comments
 (0)