From c01495eb6209eb7117776fa53d0229f74e859538 Mon Sep 17 00:00:00 2001 From: "born a rick, raised a morty, died a jerry" Date: Sat, 24 Nov 2018 19:39:13 -0500 Subject: [PATCH] add text indicator for song position on chartpreview when seeking --- Themes/Til Death/BGAnimations/_chartpreview.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Themes/Til Death/BGAnimations/_chartpreview.lua b/Themes/Til Death/BGAnimations/_chartpreview.lua index 01cabb5678..c9e290a94e 100644 --- a/Themes/Til Death/BGAnimations/_chartpreview.lua +++ b/Themes/Til Death/BGAnimations/_chartpreview.lua @@ -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 @@ -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 @@ -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)