Skip to content

Commit

Permalink
add judgment cutoff indicators for offset plot and scale it to judge …
Browse files Browse the repository at this point in the history
…window
  • Loading branch information
MinaciousGrace committed Dec 12, 2016
1 parent e2a93bd commit 39e5fa8
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
local ts = PREFSMAN:GetPreference("TimingWindowScale")
local plotWidth, plotHeight = 400,120
local plotX, plotY = SCREEN_WIDTH - 9 - plotWidth/2, SCREEN_HEIGHT - 56 - plotHeight/2
local dotDims, plotMargin = 2, 4
local maxOffset = 180
local maxOffset = 180*ts
local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats(PLAYER_1)
local dvt = pss:GetOffsetVector()
local nrt = pss:GetNoteRowVector()
Expand All @@ -18,22 +19,28 @@ end

local function plotOffset(nr,dv)
if dv == 1000 then -- 1000 denotes a miss for which we use a different marker
return Def.Quad{InitCommand=cmd(xy,fitX(nr),fitY(184);zoomto,dotDims,dotDims;diffuse,offsetToJudgeColor(dv/1000);valign,0)}
return Def.Quad{InitCommand=cmd(xy,fitX(nr),fitY(ts*184);zoomto,dotDims,dotDims;diffuse,offsetToJudgeColor(dv/1000);valign,0)}
end
return Def.Quad{InitCommand=cmd(xy,fitX(nr),fitY(dv);zoomto,dotDims,dotDims;diffuse,offsetToJudgeColor(dv/1000))}
end

local o = Def.ActorFrame{InitCommand=cmd(xy,plotX,plotY)}
-- Center Bar
o[#o+1] = Def.Quad{InitCommand=cmd(zoomto,plotWidth+plotMargin,1;diffuse,color("0.3,0.3,0.3,0.3");diffusealpha,0.8)}
o[#o+1] = Def.Quad{InitCommand=cmd(zoomto,plotWidth+plotMargin,1;diffuse,byJudgment("TapNoteScore_W1"))}
local fantabars = {22.5, 45, 90, 135}
local bantafars = {"TapNoteScore_W2", "TapNoteScore_W3", "TapNoteScore_W4", "TapNoteScore_W5"}
for i=1, #fantabars do
o[#o+1] = Def.Quad{InitCommand=cmd(y, fitY(ts*fantabars[i]); zoomto,plotWidth+plotMargin,1;diffuse,byJudgment(bantafars[i]))}
o[#o+1] = Def.Quad{InitCommand=cmd(y, fitY(-ts*fantabars[i]); zoomto,plotWidth+plotMargin,1;diffuse,byJudgment(bantafars[i]))}
end
-- Background
o[#o+1] = Def.Quad{InitCommand=cmd(zoomto,plotWidth+plotMargin,plotHeight+plotMargin;diffuse,color("0.05,0.05,0.05,0.05");diffusealpha,0.8)}
-- Plot Dots
for i=1,#devianceTable do
o[#o+1] = plotOffset(td:GetElapsedTimeFromNoteRow(nrt[i]), dvt[i])
end
-- Early/Late markers
o[#o+1] = LoadFont("Common Normal")..{InitCommand=cmd(xy,-plotWidth/2,-plotHeight/2+2;settext,"Late (+180ms)";zoom,0.35;halign,0;valign,0)}
o[#o+1] = LoadFont("Common Normal")..{InitCommand=cmd(xy,-plotWidth/2,plotHeight/2-2;settext,"Early (-180ms)";zoom,0.35;halign,0;valign,1)}
o[#o+1] = LoadFont("Common Normal")..{InitCommand=cmd(xy,-plotWidth/2,-plotHeight/2+2;settextf,"Late (+%ims)", ts*180;zoom,0.35;halign,0;valign,0)}
o[#o+1] = LoadFont("Common Normal")..{InitCommand=cmd(xy,-plotWidth/2,plotHeight/2-2;settextf,"Early (-%ims)", ts*180;zoom,0.35;halign,0;valign,1)}
return o

0 comments on commit 39e5fa8

Please sign in to comment.