Skip to content

Commit

Permalink
increase precision for rebirth wifescore displays
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Oct 23, 2021
1 parent c01732c commit 2f2ac63
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ t.JudgmentMessageCommand = function(self, params)
-- the online highscore curWifeScore is the wife percent...
-- params.WifePercent is our current calculated wife percent.
local old = curScore.curWifeScore
curScore.curWifeScore = notShit.floor(params.WifePercent * 100) / 10000
curScore.curWifeScore = notShit.floor(params.WifePercent * 10000) / 1000000
if isMulti then
multiScores = NSMAN:GetMPLeaderboard()
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,12 @@ t[#t+1] = Def.ActorFrame {
end,
SetCommand = function(self, params)
if displayScore then
self:settextf("%05.2f%%", notShit.floor(displayScore:GetWifeScore() * 10000) / 100)
local wife = displayScore:GetWifeScore()
if wife < 0.99 then
self:settextf("%05.2f%%", notShit.floor(wife * 10000) / 100)
else
self:settextf("%05.4f%%", notShit.floor(wife * 1000000) / 10000)
end
self:diffuse(colorByGrade(displayScore:GetWifeGrade()))
else
self:settext("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,20 @@ local function createList()
SetScoreCommand = function(self)
if score ~= nil then
if isLocal then
self:settextf("%5.2f%%", score:GetWifeScore() * 100)
local w = score:GetWifeScore()
if w < 0.99 then
self:settextf("%05.2f%%", notShit.floor(w * 10000) / 100)
else
self:settextf("%05.4f%%", notShit.floor(w * 1000000) / 10000)
end
self:diffuse(colorByGrade(score:GetWifeGrade()))
else
self:settextf("%5.2f%%", score.wife * 100)
local w = score.wife
if w < 0.99 then
self:settextf("%05.2f%%", notShit.floor(w * 10000) / 100)
else
self:settextf("%05.4f%%", notShit.floor(w * 1000000) / 10000)
end
self:diffuse(colorByGrade(score.grade))
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,13 @@ local function createList()
end,
SetScoreCommand = function(self)
if score ~= nil then
local wifeStr = string.format("%05.2f%%", notShit.floor(score:GetWifeScore() * 10000) / 100)
local ws = score:GetWifeScore()
local wifeStr = ""
if ws < 0.99 then
wifeStr = string.format("%05.2f%%", notShit.floor(ws * 10000) / 100)
else
wifeStr = string.format("%05.4f%%", notShit.floor(ws * 1000000) / 10000)
end
local grade = GetGradeFromPercent(score:GetWifeScore())
self:settext(wifeStr)
self:diffuse(colorByGrade(grade))
Expand Down Expand Up @@ -1060,7 +1066,7 @@ local function createList()
if localscore ~= nil then
local ssrstr = string.format("%5.2f", localscore:GetSkillsetSSR("Overall"))
local ssrcolr = colorByMSD(localscore:GetSkillsetSSR("Overall"))
local wife = localscore:GetWifeScore() * 100
local wife = localscore:GetWifeScore()
local wifecolr = colorByGrade(localscore:GetWifeGrade())
local wv = "Wife "..localscore:GetWifeVers()
local judge = 4
Expand All @@ -1070,7 +1076,12 @@ local function createList()
if not judge then judge = 4 end
if judge < 4 then judge = 4 end
local js = judge ~= 9 and judge or "Justice"
local perc = string.format("%5.2f%%", notShit.floor(wife, 2))
local perc = ""
if wife < 0.99 then
perc = string.format("%05.2f%%", notShit.floor(wife * 10000) / 100)
else
perc = string.format("%05.4f%%", notShit.floor(wife * 1000000) / 10000)
end
self:ClearAttributes()
self:diffuse(COLORS:getMainColor("PrimaryText"))
self:diffusealpha(1)
Expand Down

0 comments on commit 2f2ac63

Please sign in to comment.