Skip to content

Commit

Permalink
Remove custom timing windows
Browse files Browse the repository at this point in the history
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
  • Loading branch information
poco0317 committed May 9, 2020
1 parent 0655b75 commit afeafa5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 170 deletions.
112 changes: 22 additions & 90 deletions Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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))
Expand All @@ -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
Expand All @@ -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")
Expand All @@ -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)
Expand Down
57 changes: 8 additions & 49 deletions Themes/Til Death/BGAnimations/ScreenNetEvaluation decorations.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)",
Expand All @@ -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
Expand Down Expand Up @@ -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))
Expand All @@ -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
Expand All @@ -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")
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit afeafa5

Please sign in to comment.