Skip to content

Commit

Permalink
fix score values when changing scoreboard in multi
Browse files Browse the repository at this point in the history
update ratetext and make score percentages and MSD be correct
  • Loading branch information
Ulti-FD committed Jul 27, 2021
1 parent 6d12632 commit e8a2ef0
Showing 1 changed file with 32 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,21 @@ t[#t + 1] =
{
InitCommand = function(self)
self:xy(SCREEN_CENTER_X, capWideScale(154, 180)):zoom(0.25):halign(0.5)
self:queuecommand("Set")
end,
BeginCommand = function(self)
local rate = SCREENMAN:GetTopScreen():GetReplayRate()
if not rate then rate = getCurRateValue() end
ScoreChangedMessageCommand = function(self)
self:queuecommand("Set")
end,
SetCommand = function(self)
local top = SCREENMAN:GetTopScreen()
local rate
if top:GetName() == "ScreenNetEvaluation" then
rate = score:GetMusicRate()
else
rate = top:GetReplayRate()
if not rate then rate = getCurRateValue() end
end
rate = notShit.round(rate,3)
local ratestr = getRateString(rate)
if ratestr == "1x" then
self:settext("")
Expand Down Expand Up @@ -299,9 +310,19 @@ function scoreBoard(pn, position)
BeginCommand = function(self)
self:queuecommand("Set")
end,
ScoreChangedMessageCommand = function(self)
self:queuecommand("Set")
end,
SetCommand = function(self)
local rate = SCREENMAN:GetTopScreen():GetReplayRate()
if not rate then rate = getCurRateValue() end
local top = SCREENMAN:GetTopScreen()
local rate
if top:GetName() == "ScreenNetEvaluation" then
rate = score:GetMusicRate()
else
rate = top:GetReplayRate()
if not rate then rate = getCurRateValue() end
end
rate = notShit.round(rate,3)
local meter = GAMESTATE:GetCurrentSteps():GetMSD(rate, 1)
self:settextf("%5.2f", meter)
self:diffuse(byMSD(meter))
Expand Down Expand Up @@ -380,10 +401,12 @@ function scoreBoard(pn, position)
local wv = score:GetWifeVers()
local ws = "Wife" .. wv .. " J"
local js = judge ~= 9 and judge or "ustice"
local rescoretable = getRescoreElements(score)
local rescorepercent = getRescoredWife3Judge(3, judge, rescoretable)
self:diffuse(getGradeColor(score:GetWifeGrade()))
self:settextf(
"%05.2f%% (%s)",
notShit.floor(score:GetWifeScore() * 100, 2), ws .. js
notShit.floor(rescorepercent, 2), ws .. js
)
end,
ScoreChangedMessageCommand = function(self)
Expand Down Expand Up @@ -433,10 +456,12 @@ function scoreBoard(pn, position)
local wv = score:GetWifeVers()
local ws = "Wife" .. wv .. " J"
local js = judge ~= 9 and judge or "ustice"
local rescoretable = getRescoreElements(score)
local rescorepercent = getRescoredWife3Judge(3, judge, rescoretable)
self:diffuse(getGradeColor(score:GetWifeGrade()))
self:settextf(
"%05.5f%% (%s)",
notShit.floor(score:GetWifeScore() * 100, 5), ws .. js
notShit.floor(rescorepercent, 5), ws .. js
)
end,
ScoreChangedMessageCommand = function(self)
Expand Down

0 comments on commit e8a2ef0

Please sign in to comment.