Skip to content

Commit

Permalink
add text indicator for song position on chartpreview when seeking
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Nov 25, 2018
1 parent 3539b08 commit c01495e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Themes/Til Death/BGAnimations/_chartpreview.lua
Expand Up @@ -12,7 +12,7 @@ local cd
local function UpdatePreviewPos(self)
if noteField and yeet and SCREENMAN:GetTopScreen():GetName() == "ScreenSelectMusic" then
local pos = SCREENMAN:GetTopScreen():GetPreviewNoteFieldMusicPosition() / musicratio
self:GetChild("Pos"):zoomto(math.min(pos,wodth), hidth)
self:GetChild("Pos"):zoomto(math.min(pos,wodth), hidth)
self:queuecommand("Highlight")
end
end
Expand Down Expand Up @@ -93,8 +93,13 @@ local t = Def.ActorFrame {
HighlightCommand = function(self) -- use the bg for detection but move the seek pointer -mina
if isOver(self) then
self:GetParent():GetChild("Seek"):visible(true)
self:GetParent():GetChild("Seektext"):visible(true)
self:GetParent():GetChild("Seek"):x(INPUTFILTER:GetMouseX() - self:GetParent():GetX())
self:GetParent():GetChild("Seektext"):x(INPUTFILTER:GetMouseX() - self:GetParent():GetX() - 4) -- todo: refactor this lmao -mina
self:GetParent():GetChild("Seektext"):y(INPUTFILTER:GetMouseY() - self:GetParent():GetY())
self:GetParent():GetChild("Seektext"):settextf("%0.2f", self:GetParent():GetChild("Seek"):GetX() * musicratio / getCurRateValue())
else
self:GetParent():GetChild("Seektext"):visible(false)
self:GetParent():GetChild("Seek"):visible(false)
end
end
Expand All @@ -110,6 +115,13 @@ local t = Def.ActorFrame {
t[#t + 1] = LoadActor("_chorddensitygraph.lua")

-- more draw order shenanigans
t[#t + 1] = LoadFont("Common Normal") .. {
Name = "Seektext",
InitCommand = function(self)
self:y(8):valign(1):halign(1):draworder(1100):diffuse(color("0.8,0,0")):zoom(0.4)
end
}

t[#t + 1] = Def.Quad {
Name = "Seek",
InitCommand = function(self)
Expand Down

0 comments on commit c01495e

Please sign in to comment.