From 9b7e769510d261308f8ce3cfcef4b8d59b55eea0 Mon Sep 17 00:00:00 2001 From: Barinade Date: Mon, 17 Feb 2020 21:06:09 -0600 Subject: [PATCH] Force (with great justice) J4 window on eval when SSRNorm is on oh MY GOD WE NEED TO REWRITE THIS STUFF NOW IM MAKING IT SO BAD --- .../ScreenEvaluation decorations/default.lua | 87 ++++++++++++++++++- Themes/Til Death/BGAnimations/offsetplot.lua | 9 +- 2 files changed, 92 insertions(+), 4 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua b/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua index 45d3f07858..105b7fa82e 100644 --- a/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua +++ b/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua @@ -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") .. @@ -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) @@ -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) @@ -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 @@ -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)) @@ -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) @@ -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 @@ -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 @@ -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 } @@ -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 diff --git a/Themes/Til Death/BGAnimations/offsetplot.lua b/Themes/Til Death/BGAnimations/offsetplot.lua index c5f436287d..4babe0e54a 100644 --- a/Themes/Til Death/BGAnimations/offsetplot.lua +++ b/Themes/Til Death/BGAnimations/offsetplot.lua @@ -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 @@ -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) @@ -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