Skip to content

Commit

Permalink
remove some local isovers (their behavior is the same as the new one)
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Nov 26, 2018
1 parent 5437e71 commit bf869c5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ local function BroadcastIfActive(msg)
end

local function ButtonActive(self, scale)
return isOverScaled(self, scale) and update
return isOver(self) and update
end

local r =
Expand Down Expand Up @@ -409,19 +409,6 @@ local b2 =
end
}

--Add chart button
-- b2[#b2+1] = LoadFont("Common Large") .. {InitCommand=cmd(zoom,0.3;x,245;settext,"Add Chart")}
-- b2[#b2+1] = Def.Quad{
-- InitCommand=function(self)
-- self:x(245):diffusealpha(buttondiffuse):zoomto(80,20)
-- end,
-- MouseLeftClickMessageCommand=function(self)
-- if ButtonActive(self) and singleplaylistactive then
-- pl:AddChart(GAMESTATE:GetCurrentSteps(PLAYER_1):GetChartKey())
-- end
-- end
-- }
-- Play As Course button
b2[#b2 + 1] =
LoadFont("Common Large") ..
{
Expand Down Expand Up @@ -722,21 +709,6 @@ local b =
end
}

-- zzzz button positioning is lame... use shortcut key for now whynot
-- New Playlist
-- b[#b+1] = LoadFont("Common Large") .. {InitCommand=cmd(zoom,0.3;settext,"New Playlist")}
-- b[#b+1] = Def.Quad{
-- InitCommand=function(self)
-- self:diffusealpha(buttondiffuse):zoomto(110,20)
-- end,
-- MouseLeftClickMessageCommand=function(self)
-- if ButtonActive(self,0.3) and allplaylistsactive then
-- SONGMAN:NewPlaylist()
-- MESSAGEMAN:Broadcast("DisplayAll")
-- end
-- end
-- }

playlists[#playlists + 1] = b

for i = 1, chartsperplaylist do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,6 @@ else
defaultRateText = "All"
end

local function isOver(element)
if element:GetParent():GetParent():GetVisible() == false then
return false
end
if element:GetParent():GetVisible() == false then
return false
end
if element:GetVisible() == false then
return false
end
local x = getTrueX(element)
local y = getTrueY(element)
local hAlign = element:GetHAlign()
local vAlign = element:GetVAlign()
local w = element:GetZoomedWidth()
local h = element:GetZoomedHeight()

local mouseX = INPUTFILTER:GetMouseX()
local mouseY = INPUTFILTER:GetMouseY()

local withinX = (mouseX >= (x - (hAlign * w))) and (mouseX <= ((x + w) - (hAlign * w)))
local withinY = (mouseY >= (y - (vAlign * h))) and (mouseY <= ((y + h) - (vAlign * h)))

return (withinX and withinY)
end

-- should maybe make some of these generic
local function highlight(self)
if self:GetVisible() then
Expand Down
26 changes: 0 additions & 26 deletions Themes/Til Death/BGAnimations/superscoreboard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,32 +43,6 @@ local function input(event)
return false
end

local function isOver(element)
if element:GetParent():GetParent():GetVisible() == false then
return false
end
if element:GetParent():GetVisible() == false then
return false
end
if element:GetVisible() == false then
return false
end
local x = getTrueX(element)
local y = getTrueY(element)
local hAlign = element:GetHAlign()
local vAlign = element:GetVAlign()
local w = element:GetZoomedWidth()
local h = element:GetZoomedHeight()

local mouseX = INPUTFILTER:GetMouseX()
local mouseY = INPUTFILTER:GetMouseY()

local withinX = (mouseX >= (x - (hAlign * w))) and (mouseX <= ((x + w) - (hAlign * w)))
local withinY = (mouseY >= (y - (vAlign * h))) and (mouseY <= ((y + h) - (vAlign * h)))

return (withinX and withinY)
end

local function highlight(self)
if self:GetVisible() then
self:queuecommand("Highlight")
Expand Down

0 comments on commit bf869c5

Please sign in to comment.