From afeafa545887303411ddbb98f8c291da4dc09575 Mon Sep 17 00:00:00 2001 From: Barinade Date: Fri, 8 May 2020 22:33:10 -0500 Subject: [PATCH] Remove custom timing windows the implementation still exists in the background, but is now nonfunctional due to bloat/code concerns given community input it will probably make a return --- .../ScreenEvaluation decorations/default.lua | 112 ++++-------------- .../ScreenNetEvaluation decorations.lua | 57 ++------- Themes/Til Death/BGAnimations/offsetplot.lua | 40 ++----- Themes/Til Death/metrics.ini | 2 +- Themes/_fallback/Scripts/10 Scores.lua | 4 + 5 files changed, 45 insertions(+), 170 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua b/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua index 0c1da28c73..415a07e71c 100644 --- a/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua +++ b/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua @@ -1,9 +1,5 @@ local t = Def.ActorFrame {} -local enabledCustomWindows = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).CustomEvaluationWindowTimings - -local customWindows = timingWindowConfig:get_data().customWindows - local scoreType = themeConfig:get_data().global.DefaultScoreType if GAMESTATE:GetNumPlayersEnabled() == 1 and themeConfig:get_data().eval.ScoreBoardEnabled then @@ -157,8 +153,7 @@ local frameY = 140 local frameWidth = SCREEN_CENTER_X - 120 function scoreBoard(pn, position) - local customWindow - local judge = enabledCustomWindows and 0 or (PREFSMAN:GetPreference("SortBySSRNormPercent") and 4 or GetTimingDifficulty()) + local judge = PREFSMAN:GetPreference("SortBySSRNormPercent") and 4 or GetTimingDifficulty() local judge2 = judge local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats(pn) local score = SCOREMAN:GetMostRecentScore() @@ -186,18 +181,16 @@ function scoreBoard(pn, position) if position == 1 then self:x(SCREEN_WIDTH - (frameX * 2) - frameWidth) end - 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}) - MESSAGEMAN:Broadcast("RecalculateGraphs", {judge=4}) - else - judge = scaleToJudge(SCREENMAN:GetTopScreen():GetReplayJudge()) - judge2 = judge - end + if PREFSMAN:GetPreference("SortBySSRNormPercent") then + judge = 4 + judge2 = judge + -- you ever hack something so hard? + aboutToForceWindowSettings = true + MESSAGEMAN:Broadcast("ForceWindow", {judge=4}) + MESSAGEMAN:Broadcast("RecalculateGraphs", {judge=4}) + else + judge = scaleToJudge(SCREENMAN:GetTopScreen():GetReplayJudge()) + judge2 = judge end end, UpdateNetEvalStatsMessageCommand = function(self) @@ -334,25 +327,7 @@ function scoreBoard(pn, position) local rescorepercent = 0 local wv = score:GetWifeVers() local ws = "Wife" .. wv .. " J" - if enabledCustomWindows then - if params.Name == "PrevJudge" then - judge = judge < 2 and #customWindows or judge - 1 - customWindow = timingWindowConfig:get_data()[customWindows[judge]] - rescorepercent = getRescoredCustomPercentage(customWindow, rescoretable) - self:settextf( - "%05.2f%% (%s)", notShit.floor(rescorepercent, 2), customWindow.name - ) - MESSAGEMAN:Broadcast("RecalculateGraphs", {judge = judge}) - elseif params.Name == "NextJudge" then - judge = judge == #customWindows and 1 or judge + 1 - customWindow = timingWindowConfig:get_data()[customWindows[judge]] - rescorepercent = getRescoredCustomPercentage(customWindow, rescoretable) - self:settextf( - "%05.2f%% (%s)", notShit.floor(rescorepercent, 2), customWindow.name - ) - MESSAGEMAN:Broadcast("RecalculateGraphs", {judge = judge}) - end - elseif params.Name == "PrevJudge" and judge > 4 then + if params.Name == "PrevJudge" and judge > 4 then judge = judge - 1 rescorepercent = getRescoredWife3Judge(2, judge, rescoretable) self:settextf( @@ -369,7 +344,7 @@ function scoreBoard(pn, position) MESSAGEMAN:Broadcast("RecalculateGraphs", {judge = judge}) end if params.Name == "ResetJudge" then - judge = enabledCustomWindows and 0 or GetTimingDifficulty() + judge = GetTimingDifficulty() self:playcommand("Set") MESSAGEMAN:Broadcast("RecalculateGraphs", {judge = judge}) end @@ -402,23 +377,7 @@ function scoreBoard(pn, position) local rescorepercent = 0 local wv = score:GetWifeVers() local ws = "Wife" .. wv .. " J" - if enabledCustomWindows then - if params.Name == "PrevJudge" then - judge = judge < 2 and #customWindows or judge - 1 - customWindow = timingWindowConfig:get_data()[customWindows[judge]] - rescorepercent = getRescoredCustomPercentage(customWindow, rescoretable) - self:settextf( - "%05.5f%% (%s)", notShit.floor(rescorepercent, 5), customWindow.name - ) - elseif params.Name == "NextJudge" then - judge = judge == #customWindows and 1 or judge + 1 - customWindow = timingWindowConfig:get_data()[customWindows[judge]] - rescorepercent = getRescoredCustomPercentage(customWindow, rescoretable) - self:settextf( - "%05.5f%% (%s)", notShit.floor(rescorepercent, 5), customWindow.name - ) - end - elseif params.Name == "PrevJudge" and judge2 > 1 then + if params.Name == "PrevJudge" and judge2 > 1 then judge2 = judge2 - 1 rescorepercent = getRescoredWife3Judge(2, judge2, rescoretable) self:settextf( @@ -433,7 +392,7 @@ function scoreBoard(pn, position) ) end if params.Name == "ResetJudge" then - judge2 = enabledCustomWindows and 0 or GetTimingDifficulty() + judge2 = GetTimingDifficulty() self:playcommand("Set") end end @@ -481,25 +440,13 @@ function scoreBoard(pn, position) 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 + local rescoreJudges = getRescoredJudge(dvt, judge, k) + self:finishtweening():decelerate(2):zoomx(frameWidth * rescoreJudges / totalTaps) end, CodeMessageCommand = function(self, params) if params.Name == "PrevJudge" or params.Name == "NextJudge" then - 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 + local rescoreJudges = getRescoredJudge(dvt, judge, k) + self:finishtweening():decelerate(2):zoomx(frameWidth * rescoreJudges / totalTaps) end if params.Name == "ResetJudge" then self:finishtweening():decelerate(2):zoomx(frameWidth * pss:GetPercentageOfTaps(v)) @@ -523,9 +470,6 @@ function scoreBoard(pn, position) 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)) - end if params.Name == "ResetJudge" then self:playcommand("Set") end @@ -548,19 +492,11 @@ function scoreBoard(pn, position) 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 + self:settext(getRescoredJudge(dvt, judge, k)) end, CodeMessageCommand = function(self, params) if params.Name == "PrevJudge" or params.Name == "NextJudge" then - if enabledCustomWindows then - self:settext(getRescoredCustomJudge(dvt, customWindow.judgeWindows, k)) - else - self:settext(getRescoredJudge(dvt, judge, k)) - end + self:settext(getRescoredJudge(dvt, judge, k)) end if params.Name == "ResetJudge" then self:playcommand("Set") @@ -582,11 +518,7 @@ function scoreBoard(pn, position) end, ForceWindowMessageCommand = function(self, params) local rescoredJudge - if enabledCustomWindows then - rescoredJudge = getRescoredCustomJudge(dvt, customWindow.judgeWindows, k) - else - rescoredJudge = getRescoredJudge(dvt, params.judge, k) - end + rescoredJudge = getRescoredJudge(dvt, params.judge, k) self:settextf("(%03.2f%%)", rescoredJudge / totalTaps * 100) end, CodeMessageCommand = function(self, params) diff --git a/Themes/Til Death/BGAnimations/ScreenNetEvaluation decorations.lua b/Themes/Til Death/BGAnimations/ScreenNetEvaluation decorations.lua index f8f2199782..9ff7e78c8c 100644 --- a/Themes/Til Death/BGAnimations/ScreenNetEvaluation decorations.lua +++ b/Themes/Til Death/BGAnimations/ScreenNetEvaluation decorations.lua @@ -1,10 +1,8 @@ local t = Def.ActorFrame {} -local enabledCustomWindows = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).CustomEvaluationWindowTimings +-- to make scores save...? PROFILEMAN:SaveProfile(PLAYER_1) -local customWindows = timingWindowConfig:get_data().customWindows - local scoreType = themeConfig:get_data().global.DefaultScoreType if GAMESTATE:GetNumPlayersEnabled() == 1 and themeConfig:get_data().eval.ScoreBoardEnabled then @@ -113,8 +111,7 @@ local frameY = 140 local frameWidth = SCREEN_CENTER_X - 120 function scoreBoard(pn, position) - local customWindow - local judge = enabledCustomWindows and 0 or GetTimingDifficulty() + local judge = GetTimingDifficulty() local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats(pn) local score = SCOREMAN:GetMostRecentScore() local dvt = pss:GetOffsetVector() @@ -234,25 +231,7 @@ function scoreBoard(pn, position) score:GetRadarValues():GetValue("RadarCategory_Holds") + score:GetRadarValues():GetValue("RadarCategory_Rolls") local minesHit = pss:GetRadarPossible():GetValue("RadarCategory_Mines") - score:GetRadarValues():GetValue("RadarCategory_Mines") - if enabledCustomWindows then - if params.Name == "LULLTHISWASPREVJUDGE" then - judge = judge < 2 and #customWindows or judge - 1 - customWindow = timingWindowConfig:get_data()[customWindows[judge]] - self:settextf( - "%05.2f%% (%s)", - getRescoredCustomPercentage(dvt, customWindow, totalHolds, holdsHit, minesHit, totalTaps), - customWindow.name - ) - elseif params.Name == "LULLTHISWASNEXTJUDGE" then - judge = judge == #customWindows and 1 or judge + 1 - customWindow = timingWindowConfig:get_data()[customWindows[judge]] - self:settextf( - "%05.2f%% (%s)", - getRescoredCustomPercentage(dvt, customWindow, totalHolds, holdsHit, minesHit, totalTaps), - customWindow.name - ) - end - elseif params.Name == "LULLTHISWASPREVJUDGE" and judge > 1 then + if params.Name == "LULLTHISWASPREVJUDGE" and judge > 1 then judge = judge - 1 self:settextf( "%05.2f%% (%s)", @@ -276,7 +255,7 @@ function scoreBoard(pn, position) end end if params.Name == "ResetJudge" then - judge = enabledCustomWindows and 0 or GetTimingDifficulty() + judge = GetTimingDifficulty() self:playcommand("Set") end end @@ -324,14 +303,8 @@ function scoreBoard(pn, position) end, CodeMessageCommand = function(self, params) if params.Name == "LULLTHISWASPREVJUDGE" or params.Name == "LULLTHISWASNEXTJUDGE" then - 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 + local rescoreJudges = getRescoredJudge(dvt, judge, k) + self:finishtweening():decelerate(2):zoomx(frameWidth * rescoreJudges / totalTaps) end if params.Name == "ResetJudge" then self:finishtweening():decelerate(2):zoomx(frameWidth * pss:GetPercentageOfTaps(v)) @@ -351,9 +324,6 @@ function scoreBoard(pn, position) self:settext(getJudgeStrings(v)) end, CodeMessageCommand = function(self, params) - if enabledCustomWindows and (params.Name == "LULLTHISWASPREVJUDGE" or params.Name == "LULLTHISWASNEXTJUDGE") then - self:settext(getCustomJudgeString(customWindow.judgeNames, k)) - end if params.Name == "ResetJudge" then self:playcommand("Set") end @@ -376,11 +346,7 @@ function scoreBoard(pn, position) end, CodeMessageCommand = function(self, params) if params.Name == "LULLTHISWASPREVJUDGE" or params.Name == "LULLTHISWASNEXTJUDGE" then - if enabledCustomWindows then - self:settext(getRescoredCustomJudge(dvt, customWindow.judgeWindows, k)) - else - self:settext(getRescoredJudge(dvt, judge, k)) - end + self:settext(getRescoredJudge(dvt, judge, k)) end if params.Name == "ResetJudge" then self:playcommand("Set") @@ -405,11 +371,7 @@ function scoreBoard(pn, position) CodeMessageCommand = function(self, params) if params.Name == "LULLTHISWASPREVJUDGE" or params.Name == "LULLTHISWASNEXTJUDGE" then local rescoredJudge - if enabledCustomWindows then - rescoredJudge = getRescoredCustomJudge(dvt, customWindow.judgeWindows, k) - else - rescoredJudge = getRescoredJudge(dvt, judge, k) - end + rescoredJudge = getRescoredJudge(dvt, judge, k) self:settextf("(%03.2f%%)", rescoredJudge / totalTaps * 100) end if params.Name == "ResetJudge" then @@ -491,9 +453,6 @@ function scoreBoard(pn, position) -- basic per-hand stats to be expanded on later local tst = ms.JudgeScalers local tso = tst[judge] - if enabledCustomWindows then - tso = 1 - end local function cbs(dvt, x) local cbs = 0 diff --git a/Themes/Til Death/BGAnimations/offsetplot.lua b/Themes/Til Death/BGAnimations/offsetplot.lua index 98abfa73ed..3bfd778251 100644 --- a/Themes/Til Death/BGAnimations/offsetplot.lua +++ b/Themes/Til Death/BGAnimations/offsetplot.lua @@ -5,12 +5,6 @@ local tst = ms.JudgeScalers local judge = GetTimingDifficulty() local tso = tst[judge] -local enabledCustomWindows = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).CustomEvaluationWindowTimings -judge = enabledCustomWindows and 0 or judge -local customWindowsData = timingWindowConfig:get_data() -local customWindows = timingWindowConfig:get_data().customWindows -local customWindow = timingWindowConfig:get_data()[customWindows[1]] - local plotWidth, plotHeight = 400, 120 local plotX, plotY = SCREEN_WIDTH - 9 - plotWidth / 2, SCREEN_HEIGHT - 56 - plotHeight / 2 local dotDims, plotMargin = 2, 4 @@ -95,7 +89,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 and not forcedWindow then + if not forcedWindow then judge = scaleToJudge(SCREENMAN:GetTopScreen():GetReplayJudge()) tso = tst[judge] end @@ -140,15 +134,7 @@ local o = MESSAGEMAN:Broadcast("JudgeDisplayChanged") -- prim really handled all this much more elegantly end, CodeMessageCommand = function(self, params) - if enabledCustomWindows then - if params.Name == "PrevJudge" then - judge = judge < 2 and #customWindows or judge - 1 - customWindow = timingWindowConfig:get_data()[customWindows[judge]] - elseif params.Name == "NextJudge" then - judge = judge == #customWindows and 1 or judge + 1 - customWindow = timingWindowConfig:get_data()[customWindows[judge]] - end - elseif params.Name == "PrevJudge" and judge > 1 then + if params.Name == "PrevJudge" and judge > 1 then judge = judge - 1 tso = tst[judge] elseif params.Name == "NextJudge" and judge < 9 then @@ -172,17 +158,17 @@ local o = MESSAGEMAN:Broadcast("JudgeDisplayChanged") end if params.Name == "ResetJudge" then - judge = enabledCustomWindows and 0 or GetTimingDifficulty() + judge = GetTimingDifficulty() tso = tst[GetTimingDifficulty()] end if params.Name ~= "ResetJudge" and params.Name ~= "PrevJudge" and params.Name ~= "NextJudge" and params.Name ~= "ToggleHands" then return end - maxOffset = (enabledCustomWindows and judge ~= 0) and customWindow.judgeWindows.boo or math.max(180, 180 * tso) + maxOffset = 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) + maxOffset = math.max(180, 180 * tso) forcedWindow = true end, UpdateNetEvalStatsMessageCommand = function(self) -- i haven't updated or tested neteval during last round of work -mina @@ -255,7 +241,7 @@ for i = 1, #fantabars do Def.Quad { JudgeDisplayChangedMessageCommand = function(self) self:zoomto(plotWidth + plotMargin, 1):diffuse(byJudgment(bantafars[i])):diffusealpha(baralpha) - local fit = (enabledCustomWindows and judge ~= 0) and customWindow.judgeWindows[judges[i]] or tso * fantabars[i] + local fit = tso * fantabars[i] self:y(fitY(fit)) end } @@ -263,7 +249,7 @@ for i = 1, #fantabars do Def.Quad { JudgeDisplayChangedMessageCommand = function(self) self:zoomto(plotWidth + plotMargin, 1):diffuse(byJudgment(bantafars[i])):diffusealpha(baralpha) - local fit = (enabledCustomWindows and judge ~= 0) and customWindow.judgeWindows[judges[i]] or tso * fantabars[i] + local fit = tso * fantabars[i] self:y(fitY(-fit)) end } @@ -295,12 +281,10 @@ o[#o + 1] = for i = 1, #dvt do local x = fitX(wuab[i]) local y = fitY(dvt[i]) - local fit = (enabledCustomWindows and judge ~= 0) and customWindow.judgeWindows.boo + 3 or math.max(183, 183 * tso) + local fit = math.max(183, 183 * tso) -- get the color for the tap - local cullur = - (enabledCustomWindows and judge ~= 0) and customOffsetToJudgeColor(dvt[i], customWindow.judgeWindows) or - offsetToJudgeColor(dvt[i], tst[judge]) + local cullur = offsetToJudgeColor(dvt[i], tst[judge]) cullur[4] = 1 local cullurFaded = {} @@ -424,11 +408,7 @@ o[#o + 1] = end end, SetCommand = function(self) - if enabledCustomWindows then - jdgname = customWindow.name - else - jdgname = "J" .. judge - end + local jdgname = "J" .. judge self:settextf("%s", jdgname) end, JudgeDisplayChangedMessageCommand = function(self) diff --git a/Themes/Til Death/metrics.ini b/Themes/Til Death/metrics.ini index cd86f65033..18abbf37a2 100644 --- a/Themes/Til Death/metrics.ini +++ b/Themes/Til Death/metrics.ini @@ -357,7 +357,7 @@ StepsTypeSetCommand=%function(self,param) \ end; \ [ScreenPlayerOptions] -LineNames="1,Rate,8,4,CG,PRAC,RS,14,5,7,10,13,CBHL,JT,CT,DP,TT,TG,TTM,JC,EB,EBC,PI,FBP,LEADB,FB,MB,SF,LC,NPS,16,BG,Life,Judge,CW,Background,Fail,Center,Score" +LineNames="1,Rate,8,4,CG,PRAC,RS,14,5,7,10,13,CBHL,JT,CT,DP,TT,TG,TTM,JC,EB,EBC,PI,FBP,LEADB,FB,MB,SF,LC,NPS,16,BG,Life,Judge,Background,Fail,Center,Score" LineCenter="conf,Center1Player" LineCG="lua,CustomizeGameplay()" LineRS="lua,ReceptorSize()" diff --git a/Themes/_fallback/Scripts/10 Scores.lua b/Themes/_fallback/Scripts/10 Scores.lua index 3ff439633c..17350776ab 100644 --- a/Themes/_fallback/Scripts/10 Scores.lua +++ b/Themes/_fallback/Scripts/10 Scores.lua @@ -448,6 +448,7 @@ function wife2(maxms, ts) return (2 - -8) * (1 - y) + -8 end +-- For Window-based Scoring function getRescoredJudge(offsetVector, judgeScale, judge) local tso = ms.JudgeScalers local ts = tso[judgeScale] @@ -475,6 +476,7 @@ function getRescoredJudge(offsetVector, judgeScale, judge) return judgeCount end +-- For Window-based Scoring function getRescoredCustomJudge(offsetVector, windows, judge) local lowerBound = judge > 1 and windows[judges[judge - 1]] or -1.0 local upperBound = windows[judges[judge]] @@ -498,6 +500,7 @@ function getRescoredCustomJudge(offsetVector, windows, judge) return judgeCount end +-- For Millisecond-based Scoring function getRescoredWifeJudge(judgeScale, rst) local tso = ms.JudgeScalers local ts = tso[judgeScale] @@ -510,6 +513,7 @@ function getRescoredWifeJudge(judgeScale, rst) return (p / (rst["totalTaps"] * 2)) * 100.0 end +-- For Window-based Scoring function getRescoredCustomPercentage(customWindows, rst) local p = 0.0 local weights = customWindows.judgeWeights