Skip to content

Commit

Permalink
rebirth add author name tooltip to cdtitle
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Oct 23, 2021
1 parent 9b119e3 commit c01732c
Showing 1 changed file with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ t[#t+1] = Def.ActorFrame {
}
}

t[#t+1] = Def.Sprite {
t[#t+1] = UIElements.SpriteButton(1, 1, nil) .. {
Name = "CDTitle",
InitCommand = function(self)
-- lets... avoid aligning this.
Expand All @@ -503,6 +503,7 @@ t[#t+1] = Def.Sprite {
end,
SetCommand = function(self, params)
self:finishtweening()
self.song = params.song
if params.song then
if params.song:HasCDTitle() then
self:diffusealpha(1)
Expand Down Expand Up @@ -530,7 +531,29 @@ t[#t+1] = Def.Sprite {
else
self:diffusealpha(0)
end
end
if isOver(self) then
self:playcommand("ToolTip")
end
end,
ToolTipCommand = function(self)
if isOver(self) then
if self.song then
local auth = self.song:GetOrTryAtLeastToGetSimfileAuthor()
if auth and #auth > 0 then
TOOLTIP:SetText(auth)
TOOLTIP:Show()
end
end
end
end,
MouseOverCommand = function(self)
if self:IsInvisible() then return end
self:playcommand("ToolTip")
end,
MouseOutCommand = function(self)
if self:IsInvisible() then return end
TOOLTIP:Hide()
end,
}

t[#t+1] = createStatLines()
Expand Down

0 comments on commit c01732c

Please sign in to comment.