Skip to content

Commit

Permalink
Fix oddities with judge counter and error bar
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Feb 12, 2019
1 parent b74f19e commit 9dd4848
Showing 1 changed file with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ local positive = getMainColor("positive")
local highlight = getMainColor("highlight")
local negative = getMainColor("negative")

local jdgCounts = {} -- Child references for the judge counter


-- We can also pull in some localized aliases for workhorse functions for a modest speed increase
local Round = notShit.round
local Floor = notShit.floor
Expand Down Expand Up @@ -209,11 +212,11 @@ local t =
jdgct = msg.Val
if msg.Offset ~= nil then
dvCur = msg.Offset
else
dvCur = 1000
end
jdgCur = msg.Judgment
queuecommand(self, "SpottedOffset")
if jdgCounts[jdgCur] ~= nil then
queuecommand(self, "SpottedOffset")
end
end
}

Expand Down Expand Up @@ -298,7 +301,7 @@ else
end
self:settextf("")
end,
JudgmentMessageCommand = function(self, msg)
SpottedOffsetCommand = function(self, msg)
if tDiff then
local pbtarget = msg.WifePBGoal
if tDiff >= 0 then
Expand Down Expand Up @@ -387,7 +390,6 @@ local countFontSize = 0.35
local gradeFontSize = 0.45
--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--

local jdgCounts = {} -- Child references for the judge counter

local j =
Def.ActorFrame {
Expand All @@ -405,7 +407,7 @@ local j =
end
end,
SpottedOffsetCommand = function(self)
if jdgCur then
if jdgCur and jdgCounts[jdgCur] ~= nil then
settext(jdgCounts[jdgCur], jdgct)
end
end,
Expand Down Expand Up @@ -513,8 +515,10 @@ local e =
end,
SpottedOffsetCommand = function(self)
if enabledErrorBar == 1 then
currentbar = ((currentbar) % barcount) + 1
queuecommand(ingots[currentbar], "UpdateErrorBar") -- Update the next bar in the queue
if jdgCounts[jdgCur] ~= nil and jdgCur ~= "HoldNoteScore_LetGo" and jdgCur ~= "TapNoteScore_Miss" then
currentbar = ((currentbar) % barcount) + 1
queuecommand(ingots[currentbar], "UpdateErrorBar") -- Update the next bar in the queue
end
end
end,
DootCommand = function(self)
Expand Down Expand Up @@ -577,9 +581,11 @@ if enabledErrorBar == 2 then
end
end,
SpottedOffsetCommand = function(self)
avg = alpha * dvCur + (1 - alpha) * lastAvg
lastAvg = avg
self:x(MovableValues.ErrorBarX + avg * wscale)
if jdgCounts[jdgCur] and jdgCur ~= "HoldNoteScore_LetGo" and jdgCur~= "TapNoteScore_Miss" then
avg = alpha * dvCur + (1 - alpha) * lastAvg
lastAvg = avg
self:x(MovableValues.ErrorBarX + avg * wscale)
end
end
}
end
Expand Down

0 comments on commit 9dd4848

Please sign in to comment.