Skip to content

Commit

Permalink
Force (with great justice) J4 window on eval when SSRNorm is on
Browse files Browse the repository at this point in the history
oh MY GOD WE NEED TO REWRITE THIS STUFF NOW IM MAKING IT SO BAD
  • Loading branch information
poco0317 committed Feb 18, 2020
1 parent 1e283ae commit 9b7e769
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ local translated_info = {
}

local tso = {1.50, 1.33, 1.16, 1.00, 0.84, 0.66, 0.50, 0.33, 0.20}
local originaljudge = GetTimingDifficulty()
local originaljudge = (PREFSMAN:GetPreference("SortBySSRNormPercent") and 4 or GetTimingDifficulty())

-- im going to cry
local aboutToForceWindowSettings = false

t[#t + 1] =
LoadFont("Common Normal") ..
Expand Down Expand Up @@ -172,10 +175,14 @@ function scoreBoard(pn, position)
if not enabledCustomWindows then
if PREFSMAN:GetPreference("SortBySSRNormPercent") then
judge = 4
judge2 = judge
-- you ever hack something so hard?
aboutToForceWindowSettings = true
MESSAGEMAN:Broadcast("ForceWindow", {judge=4})
else
judge = scaleToJudge(SCREENMAN:GetTopScreen():GetReplayJudge())
judge2 = judge
end
judge2 = judge
end
end,
UpdateNetEvalStatsMessageCommand = function(self)
Expand Down Expand Up @@ -267,6 +274,9 @@ function scoreBoard(pn, position)
self:queuecommand("PercentMouseover")
end)
end,
ForceWindowMessageCommand = function(self, params)
self:playcommand("Set")
end,
Def.Quad {
InitCommand = function(self)
self:xy(frameX + 5, frameY + 9):zoomto(capWideScale(320,360)/2.2,20):halign(0):valign(0)
Expand Down Expand Up @@ -472,7 +482,19 @@ function scoreBoard(pn, position)
BeginCommand = function(self)
self:glowshift():effectcolor1(color("1,1,1," .. tostring(pss:GetPercentageOfTaps(v) * 0.4))):effectcolor2(
color("1,1,1,0")
):sleep(0.5):decelerate(2):zoomx(frameWidth * pss:GetPercentageOfTaps(v))
)
if aboutToForceWindowSettings then return end
self:sleep(0.5):decelerate(2):zoomx(frameWidth * pss:GetPercentageOfTaps(v))
end,
ForceWindowMessageCommand = function(self, params)
if enabledCustomWindows then
self:finishtweening():decelerate(2):zoomx(
frameWidth * getRescoredCustomJudge(dvt, customWindow.judgeWindows, k) / totalTaps
)
else
local rescoreJudges = getRescoredJudge(dvt, judge, k)
self:finishtweening():decelerate(2):zoomx(frameWidth * rescoreJudges / totalTaps)
end
end,
CodeMessageCommand = function(self, params)
if params.Name == "PrevJudge" or params.Name == "NextJudge" then
Expand All @@ -497,11 +519,15 @@ function scoreBoard(pn, position)
self:xy(frameX + 10, frameY + 80 + ((k - 1) * 22)):zoom(0.25):halign(0)
end,
BeginCommand = function(self)
if aboutToForceWindowSettings then return end
self:queuecommand("Set")
end,
SetCommand = function(self)
self:settext(getJudgeStrings(v))
end,
ForceWindowMessageCommand = function(self, params)
self:playcommand("Set")
end,
CodeMessageCommand = function(self, params)
if enabledCustomWindows and (params.Name == "PrevJudge" or params.Name == "NextJudge") then
self:settext(getCustomJudgeString(customWindow.judgeNames, k))
Expand All @@ -518,6 +544,7 @@ function scoreBoard(pn, position)
self:xy(frameX + frameWidth - 40, frameY + 80 + ((k - 1) * 22)):zoom(0.25):halign(1)
end,
BeginCommand = function(self)
if aboutToForceWindowSettings then return end
self:queuecommand("Set")
end,
SetCommand = function(self)
Expand All @@ -526,6 +553,13 @@ function scoreBoard(pn, position)
ScoreChangedMessageCommand = function(self)
self:queuecommand("Set")
end,
ForceWindowMessageCommand = function(self, params)
if enabledCustomWindows then
self:settext(getRescoredCustomJudge(dvt, customWindow.judgeWindows, k))
else
self:settext(getRescoredJudge(dvt, judge, k))
end
end,
CodeMessageCommand = function(self, params)
if params.Name == "PrevJudge" or params.Name == "NextJudge" then
if enabledCustomWindows then
Expand All @@ -546,11 +580,21 @@ function scoreBoard(pn, position)
self:xy(frameX + frameWidth - 38, frameY + 80 + ((k - 1) * 22)):zoom(0.3):halign(0)
end,
BeginCommand = function(self)
if aboutToForceWindowSettings then return end
self:queuecommand("Set")
end,
SetCommand = function(self)
self:settextf("(%03.2f%%)", pss:GetPercentageOfTaps(v) * 100)
end,
ForceWindowMessageCommand = function(self, params)
local rescoredJudge
if enabledCustomWindows then
rescoredJudge = getRescoredCustomJudge(dvt, customWindow.judgeWindows, k)
else
rescoredJudge = getRescoredJudge(dvt, params.judge, k)
end
self:settextf("(%03.2f%%)", rescoredJudge / totalTaps * 100)
end,
CodeMessageCommand = function(self, params)
if params.Name == "PrevJudge" or params.Name == "NextJudge" then
local rescoredJudge
Expand Down Expand Up @@ -657,6 +701,18 @@ function scoreBoard(pn, position)
greatTaps = score:GetTapNoteScore(judges[3])
self:playcommand("Set")
end
end,
ForceWindowMessageCommand = function(self)
if enabledCustomWindows then
marvelousTaps = getRescoredCustomJudge(dvt, customWindow.judgeWindows, 1)
perfectTaps = getRescoredCustomJudge(dvt, customWindow.judgeWindows, 2)
greatTaps = getRescoredCustomJudge(dvt, customWindow.judgeWindows, 3)
else
marvelousTaps = getRescoredJudge(dvt, judge, 1)
perfectTaps = getRescoredJudge(dvt, judge, 2)
greatTaps = getRescoredJudge(dvt, judge, 3)
end
self:playcommand("Set")
end
}

Expand Down Expand Up @@ -807,6 +863,31 @@ function scoreBoard(pn, position)
end
self:xy(frameWidth + 20, frameY + 230 + 10 * j):zoom(0.4):halign(1):settext(mcscoot[j])
end
end,
ForceWindowMessageCommand = function(self)
local j = tonumber(self:GetName())
if j > 3 then
if j == 4 then
local tso = tst[judge]
if enabledCustomWindows then
tso = 1
end
mcscoot[j] = 0
mcscoot[j+1] = 0
for i = 1, #devianceTable do
if tracks[i] then -- it would probably make sense to move all this to c++
if math.abs(devianceTable[i]) > tso * 90 then
if tracks[i] <= math.floor(ncol/2) then
mcscoot[j] = mcscoot[j] + 1
else
mcscoot[j+1] = mcscoot[j+1] + 1
end
end
end
end
end
self:xy(frameWidth + 20, frameY + 230 + 10 * j):zoom(0.4):halign(1):settext(mcscoot[j])
end
end
}
end
Expand Down
9 changes: 8 additions & 1 deletion Themes/Til Death/BGAnimations/offsetplot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ local o =
-- being explicit about the logic since atm these are the only 2 cases we handle
local name = SCREENMAN:GetTopScreen():GetName()
if name == "ScreenEvaluationNormal" or name == "ScreenNetEvaluation" then -- default case, all data is in pss and no disk load is required
if not enabledCustomWindows then
if not enabledCustomWindows and not forcedWindow then
judge = scaleToJudge(SCREENMAN:GetTopScreen():GetReplayJudge())
tso = tst[judge]
end
Expand Down Expand Up @@ -136,6 +136,7 @@ local o =
for i = 1, #nrt do
wuab[i] = td:GetElapsedTimeFromNoteRow(nrt[i])
end

MESSAGEMAN:Broadcast("JudgeDisplayChanged") -- prim really handled all this much more elegantly
end,
CodeMessageCommand = function(self, params)
Expand Down Expand Up @@ -178,6 +179,12 @@ local o =
maxOffset = (enabledCustomWindows and judge ~= 0) and customWindow.judgeWindows.boo or math.max(180, 180 * tso)
MESSAGEMAN:Broadcast("JudgeDisplayChanged")
end,
ForceWindowMessageCommand = function(self, params)
judge = params.judge
tso = tst[judge]
maxOffset = (enabledCustomWindows and judge ~= 0) and customWindow.judgeWindows.boo or math.max(180, 180 * tso)
forcedWindow = true
end,
UpdateNetEvalStatsMessageCommand = function(self) -- i haven't updated or tested neteval during last round of work -mina
local s = SCREENMAN:GetTopScreen():GetHighScore()
if s then
Expand Down

0 comments on commit 9b7e769

Please sign in to comment.