Skip to content

Commit 37e26b6

Browse files
committed
fix the nps hover on the graph the cd graph it wasnt right it was wrong
1 parent 13fe59b commit 37e26b6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Themes/Til Death/BGAnimations/_chartpreview.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ local t = Def.ActorFrame {
180180
seektext:y(INPUTFILTER:GetMouseY() - self:GetParent():GetY())
181181
if cdg.npsVector ~= nil and #cdg.npsVector > 0 then
182182
local percent = clamp((INPUTFILTER:GetMouseX() - self:GetParent():GetX()) / wodth, 0, 1)
183-
local hoveredindex = clamp(math.ceil(#cdg.npsVector * percent), math.min(1, #cdg.npsVector), #cdg.npsVector)
183+
local hoveredindex = clamp(math.ceil(cdg.finalNPSVectorIndex * percent), math.min(1, cdg.finalNPSVectorIndex), cdg.finalNPSVectorIndex)
184184
local hoverednps = cdg.npsVector[hoveredindex]
185185
seektext:settextf("%0.2f - %d %s", seek:GetX() * musicratio / getCurRateValue(), hoverednps, translated_info["NPS"])
186186
else

Themes/Til Death/BGAnimations/_chorddensitygraph.lua

+6
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,20 @@ local function updateGraphMultiVertex(parent, realgraph)
7272
hodth = hidth/hodth
7373
local verts = {} -- reset the vertices for the graph
7474
local yOffset = 0 -- completely unnecessary, just a Y offset from the graph
75+
local lastIndex = 1
7576
for density = 1,ncol do
7677
for column = 1,numberOfColumns do
7778
if graphVectors[density][column] > 0 then
7879
local barColor = getColorForDensity(density, ncol)
7980
makeABar(verts, math.min(column * columnWidth, wodth), yOffset, columnWidth, graphVectors[density][column] * 2 * hodth, barColor)
81+
if column > lastIndex then
82+
lastIndex = column
83+
end
8084
end
8185
end
8286
end
87+
88+
parent.finalNPSVectorIndex = lastIndex
8389

8490
realgraph:SetVertices(verts)
8591
realgraph:SetDrawState( {Mode = "DrawMode_Quads", First = 1, Num = #verts} )

0 commit comments

Comments
 (0)