Skip to content

Commit 4544477

Browse files
authored
Fix some ssrnorm judge stuff on eval (#27)
basically it should start as j4 if ssrnormsort is on but it didnt and this fixes it also this fixes some stuff with resetjudge being weird in those cases
1 parent cce07b2 commit 4544477

File tree

1 file changed

+70
-44
lines changed

1 file changed

+70
-44
lines changed

BGAnimations/ScreenEvaluation decorations/default.lua

Lines changed: 70 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,15 @@ local function oldEvalStuff()
480480
self:bouncy(0.3)
481481
self:y(500)
482482
end,
483+
ResetJudgeCommand = function(self)
484+
recountCBs()
485+
end,
483486
SetJudgeCommand = function(self)
484487
recountCBs()
488+
end,
489+
ForceUpdateAllInfoMessageCommand = function(self)
490+
recountCBs()
491+
self:RunCommandsOnChildren(function(self) self:queuecommand("SetJudge") end)
485492
end
486493
}
487494

@@ -2410,6 +2417,49 @@ local function newEvalStuff()
24102417
local score = pss:GetHighScore()
24112418
local scoreIndex = getHighScoreIndex(hsTable, score)
24122419

2420+
-- stolen from earlier in this same file without any shame
2421+
-- stolen from Til Death without any shame
2422+
local tracks = pss:GetTrackVector()
2423+
local devianceTable = pss:GetOffsetVector()
2424+
local cbl = 0
2425+
local cbr = 0
2426+
local cbm = 0
2427+
2428+
local tst = ms.JudgeScalers
2429+
local tso = tst[judge]
2430+
if enabledCustomWindows then
2431+
tso = 1
2432+
end
2433+
local ncol = GAMESTATE:GetCurrentSteps(PLAYER_1):GetNumColumns() - 1
2434+
local middleCol = ncol / 2
2435+
local function recountCBs()
2436+
cbl = 0
2437+
cbr = 0
2438+
cbm = 0
2439+
for i = 1, #devianceTable do
2440+
if tracks[i] then
2441+
if math.abs(devianceTable[i]) > tso * 90 then
2442+
if tracks[i] < middleCol then
2443+
cbl = cbl + 1
2444+
elseif tracks[i] > middleCol then
2445+
cbr = cbr + 1
2446+
else
2447+
cbm = cbm + 1
2448+
end
2449+
end
2450+
end
2451+
end
2452+
end
2453+
recountCBs()
2454+
2455+
local statInfo = {
2456+
mean = wifeMean(devianceTable),
2457+
absmean = wifeAbsMean(devianceTable),
2458+
sd = wifeSd(devianceTable),
2459+
}
2460+
2461+
local showMiddle = middleCol == math.floor(middleCol)
2462+
24132463
local function highlightSD(self)
24142464
self:GetChild("Mean"):queuecommand("Highlight")
24152465
end
@@ -2433,10 +2483,21 @@ local function newEvalStuff()
24332483
end,
24342484
OffsetPlotModificationMessageCommand = function(self, params)
24352485
if params.Name == "ResetJudge" then
2436-
self:queuecommand("ResetJudge")
2486+
if PREFSMAN:GetPreference("SortBySSRNormPercent") then
2487+
judge = 4
2488+
rescoredPercentage = score:GetWifeScore() * 100
2489+
self:queuecommand("SetJudge", params)
2490+
else
2491+
recountCBs()
2492+
self:queuecommand("ResetJudge")
2493+
end
24372494
elseif params.Name ~= "ToggleHands" then
24382495
self:queuecommand("SetJudge", params)
24392496
end
2497+
end,
2498+
ForceUpdateAllInfoMessageCommand = function(self)
2499+
recountCBs()
2500+
self:RunCommandsOnChildren(function(self) self:queuecommand("SetJudge") end)
24402501
end
24412502
}
24422503

@@ -2594,49 +2655,6 @@ local function newEvalStuff()
25942655
return t
25952656
end
25962657

2597-
-- stolen from earlier in this same file without any shame
2598-
-- stolen from Til Death without any shame
2599-
local tracks = pss:GetTrackVector()
2600-
local devianceTable = pss:GetOffsetVector()
2601-
local cbl = 0
2602-
local cbr = 0
2603-
local cbm = 0
2604-
2605-
local tst = ms.JudgeScalers
2606-
local tso = tst[judge]
2607-
if enabledCustomWindows then
2608-
tso = 1
2609-
end
2610-
local ncol = GAMESTATE:GetCurrentSteps(PLAYER_1):GetNumColumns() - 1
2611-
local middleCol = ncol / 2
2612-
local function recountCBs()
2613-
cbl = 0
2614-
cbr = 0
2615-
cbm = 0
2616-
for i = 1, #devianceTable do
2617-
if tracks[i] then
2618-
if math.abs(devianceTable[i]) > tso * 90 then
2619-
if tracks[i] < middleCol then
2620-
cbl = cbl + 1
2621-
elseif tracks[i] > middleCol then
2622-
cbr = cbr + 1
2623-
else
2624-
cbm = cbm + 1
2625-
end
2626-
end
2627-
end
2628-
end
2629-
end
2630-
recountCBs()
2631-
2632-
local statInfo = {
2633-
mean = wifeMean(devianceTable),
2634-
absmean = wifeAbsMean(devianceTable),
2635-
sd = wifeSd(devianceTable),
2636-
}
2637-
2638-
local showMiddle = middleCol == math.floor(middleCol)
2639-
26402658
t[#t+1] = Def.ActorFrame {
26412659
Name = "The Board",
26422660
InitCommand = function(self)
@@ -3072,6 +3090,14 @@ t[#t+1] = offsetStuff()
30723090
t[#t+1] = Def.ActorFrame {
30733091
OnCommand = function(self)
30743092
SCREENMAN:GetTopScreen():AddInputCallback(scroller)
3093+
if PREFSMAN:GetPreference("SortBySSRNormPercent") then
3094+
local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats(pn)
3095+
local curScore = pss:GetHighScore()
3096+
judge = 4
3097+
3098+
rescoredPercentage = curScore:GetWifeScore() * 100
3099+
MESSAGEMAN:Broadcast("ForceUpdateAllInfo")
3100+
end
30753101
end
30763102
}
30773103

0 commit comments

Comments
 (0)