Skip to content

Commit

Permalink
fix wife2 showing up for scores that are converted temporarily to wife3
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Dec 2, 2021
1 parent b370bd8 commit cad313a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -814,14 +814,16 @@ local function wifePercentDisplay()
SetCommand = function(self, params)
if params.score ~= nil then
local ver = params.score:GetWifeVers()
local ws = "W"..ver.." J"
ws = ws .. (judgeSetting ~= 9 and judgeSetting or "ustice")
local percent = params.score:GetWifeScore() * 100
decimals = 2
if params.judgeSetting ~= nil then
local rescoreTable = gatherRescoreTableFromScore(params.score)
percent = getRescoredWife3Judge(3, params.judgeSetting, rescoreTable)
ver = 3
end
-- wife version string
local ws = "W"..ver.." J"
ws = ws .. (judgeSetting ~= 9 and judgeSetting or "ustice")
-- scores over 99% should show more decimals
if percent > 99 or isOver(self) then
decimals = 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,9 @@ local function createList()
local ws = score:GetWifeScore()
local wifeStr = checkWifeStr(ws)
local grade = GetGradeFromPercent(score:GetWifeScore())
if score:GetWifeVers() ~= 3 then
wifeStr = wifeStr .. " W2"
end
txt:settext(wifeStr)
txt:diffuse(colorByGrade(grade))
bg:zoomto(txt:GetZoomedWidth(), txt:GetZoomedHeight() * textButtonHeightFudgeScalarMultiplier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,11 @@ local function scoreBoard(pn, position)
end,
SetCommand = function(self)
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)
wv = 3 -- this should really only be applicable if we can convert the score
local ws = "Wife" .. wv .. " J"
self:diffuse(getGradeColor(score:GetWifeGrade()))
self:settextf(
"%05.2f%% (%s)",
Expand All @@ -412,7 +413,6 @@ local function scoreBoard(pn, position)
CodeMessageCommand = function(self, params)
local rescoretable = getRescoreElements(score)
local rescorepercent = 0
local wv = score:GetWifeVers()
local ws = "Wife3" .. " J"
if params.Name == "PrevJudge" and judge > 4 then
judge = judge - 1
Expand Down Expand Up @@ -450,10 +450,11 @@ local function scoreBoard(pn, position)
end,
SetCommand = function(self)
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)
wv = 3 -- this should really only be applicable if we can convert the score
local ws = "Wife" .. wv .. " J"
self:diffuse(getGradeColor(score:GetWifeGrade()))
self:settextf(
"%05.5f%% (%s)",
Expand Down
6 changes: 5 additions & 1 deletion Themes/Til Death/BGAnimations/superscoreboard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,11 @@ local function makeScoreDisplay(i)
end
end,
DisplayCommand = function(self)
self:settextf("%05.2f%%", notShit.floor(hs:GetWifeScore() * 100, 2)):diffuse(byGrade(hs:GetWifeGrade()))
local append = ""
if hs:GetWifeVers() ~= 3 then
append = " W2"
end
self:settextf("%05.2f%%" .. append, notShit.floor(hs:GetWifeScore() * 100, 2)):diffuse(byGrade(hs:GetWifeGrade()))
end
},
LoadFont("Common normal") .. {
Expand Down

0 comments on commit cad313a

Please sign in to comment.