Skip to content

Commit

Permalink
Relocate and Reimplement Player Options Button
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Dec 1, 2018
1 parent 436962e commit 563c0a5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,40 @@ t[#t + 1] =
oldstyle = GAMESTATE:GetCurrentStyle()
end
}

t[#t + 1] =
LoadFont("Common Normal") ..
{
Name = "PlayerOptionsButton",
BeginCommand = function(self)
SCREENMAN:GetTopScreen():AddInputCallback(MPinput)
self:xy(20, 218)
self:zoom(0.5)
self:halign(0)
self:settext("Player Options")
end,
MouseLeftClickMessageCommand = function(self)
if isOver(self) then
SCREENMAN:GetTopScreen():OpenOptions()
end
end
}

--[[ -- This is the Widget Button alternative of the above implementation.
t[#t + 1] =
Widg.Button {
text = "Options",
width = 50,
height = 25,
border = false,
bgColor = BoostColor(getMainColor("frames"), 7.5),
highlight = {color = BoostColor(getMainColor("frames"), 10)},
x = SCREEN_WIDTH / 2,
y = 5,
onClick = function(self)
SCREENMAN:GetTopScreen():OpenOptions()
end
}]]

t[#t + 1] = LoadActor("../_chartpreview.lua")
return t
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,4 @@ GAMESTATE:UpdateDiscordMenu(
": " .. string.format("%5.2f", GetPlayerOrMachineProfile(PLAYER_1):GetPlayerRating())
)

t[#t + 1] =
Widg.Button {
text = "Options",
width = 50,
height = 25,
border = false,
bgColor = BoostColor(getMainColor("frames"), 7.5),
highlight = {color = BoostColor(getMainColor("frames"), 10)},
x = SCREEN_WIDTH / 2,
y = 5,
onClick = function(self)
SCREENMAN:GetTopScreen():OpenOptions()
end
}

return t

0 comments on commit 563c0a5

Please sign in to comment.