Skip to content

Commit

Permalink
Allow setting the Error Bar Count
Browse files Browse the repository at this point in the history
also applies to EWMA
  • Loading branch information
poco0317 committed Nov 13, 2019
1 parent 852cd31 commit 366930b
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,10 @@ end
--]]
-- User Parameters
--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--
local barcount = 30 -- Number of bars. Older bars will refresh if judgments/barDuration exceeds this value. You don't need more than 40.
local barcount = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).ErrorBarCount -- Number of bars. Older bars will refresh if judgments/barDuration exceeds this value.
local barWidth = 2 -- Width of the ticks.
local barDuration = 0.75 -- Time duration in seconds before the ticks fade out. Doesn't need to be higher than 1. Maybe if you have 300 bars I guess.
if barcount > 50 then barDuration = barcount / 50 end -- just procedurally set the duration if we pass 50 bars
--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--
local currentbar = 1 -- so we know which error bar we need to update
local ingots = {} -- references to the error bars
Expand Down
2 changes: 2 additions & 0 deletions Themes/Til Death/Languages/en.ini
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ TargetGoal = Tracker Goal
TargetTrackerMode = Tracker mode
JudgeCounter = Judge Counter
ErrorBar=Error Bar
ErrorBarCount=Error Bar Count
ErrorBarLoc=Error Bar Position
PlayerInfo = Player Info
FullProgressBar = Full Progressbar
Expand Down Expand Up @@ -174,6 +175,7 @@ TargetGoal = Set the percentage goal for the target tracker.
TargetTrackerMode = Toggle tracker mode between a set percentage and your personal best. If no PB is available it will default to your set target goal.
JudgeCounter = Enable Judge Counter. Displays your currently obtained judgment counts. This has a moderate impact on performance. Expect about a 10% penalty to average fps.
ErrorBar = Enable Error Bar. Visual representation of your judgments' deviation from the intended mark. This is about as taxing as the judge counter performance-wise, though more useful. EWMA mode uses the Exponential Weighted Moving Average for its display.
ErrorBarCount = Set the number of bars considered in the Error Bar. If higher than 50, non-EWMA bars begin to persist longer.
ErrorBarLoc = Set the positioning of the error bar to center or bottom.
PlayerInfo = Enable the player info display in the bottom left. This is the most taxing gameplay screen element. Expect a 20% or higher drop in average fps. It's also useless for non-streamers. Advised to disable.
Leaderboard = Displays the top 4 global scores against your current one
Expand Down
1 change: 1 addition & 0 deletions Themes/Til Death/Scripts/01 player_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ local defaultConfig = {
JudgmentText = true,
ComboText = true,
ReceptorSize = 100,
ErrorBarCount = 30,
BackgroundType = 1,
UserName = "",
PasswordToken = "",
Expand Down
35 changes: 35 additions & 0 deletions Themes/Til Death/Scripts/02 ThemePrefs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,41 @@ function ReceptorSize()
return t
end

local ErrorBarCountChoices = {}
for i = 1, 200 do
ErrorBarCountChoices[i] = tostring(i)
end
function ErrorBarCount()
local t = {
Name = "ErrorBarCount",
LayoutType = "ShowAllInRow",
SelectType = "SelectOne",
OneChoiceForAllPlayers = false,
ExportOnChange = true,
Choices = ErrorBarCountChoices,
LoadSelections = function(self, list, pn)
local prefs = playerConfig:get_data(pn_to_profile_slot(pn)).ErrorBarCount
list[prefs] = true
end,
SaveSelections = function(self, list, pn)
local found = false
for i = 1, #list do
if not found then
if list[i] == true then
local value = i
playerConfig:get_data(pn_to_profile_slot(pn)).ErrorBarCount = value
found = true
end
end
end
playerConfig:set_dirty(pn_to_profile_slot(pn))
playerConfig:save(pn_to_profile_slot(pn))
end
}
setmetatable(t, t)
return t
end

function JudgmentText()
local t = {
Name = "JudgmentText",
Expand Down
3 changes: 2 additions & 1 deletion Themes/Til Death/metrics.ini
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,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,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,CW,Background,Fail,Center,Score"
LineCenter="conf,Center1Player"
LineCG="lua,CustomizeGameplay()"
LineRS="lua,ReceptorSize()"
Expand Down Expand Up @@ -390,6 +390,7 @@ LineJudge="conf,TimingWindowScale"
LineCW="lua,CustomEvalWindows()"
LineBackground="conf,BGBrightness"
LineCBHL="lua,CBHighlight()"
LineEBC="lua,ErrorBarCount()"

NextScreen=ToGameplay()

Expand Down

0 comments on commit 366930b

Please sign in to comment.