diff --git a/scripts/result.lua b/scripts/result.lua index 66a96bf..eef733f 100644 --- a/scripts/result.lua +++ b/scripts/result.lua @@ -180,6 +180,13 @@ local irText = '' game.LoadSkinSample("result") game.LoadSkinSample("shutter") +local function isHard(result) + if result.flags == nil then + return result.gauge_type == 1 + end + return result.flags & 1 == 1 + end + local handleSfx = function() if not bgSfxPlayed then game.PlaySample("result", true) @@ -188,6 +195,55 @@ local handleSfx = function() end end +local drawGraph = function(x,y,w,h) + if isHard(result) then + gfx.BeginPath() + gfx.Rect(x,y,w,103) + gfx.FillColor(26,26,26,255) + gfx.Fill() + gfx.FillColor(255,255,255,255) + else + gfx.BeginPath() + gfx.Rect(x,y,w,h-68) + gfx.FillColor(55,27,51,255) + gfx.Fill() + gfx.BeginPath() + gfx.Rect(x,y+30,w,72) + gfx.FillColor(7,24,28,255) + gfx.Fill() + gfx.FillColor(255,255,255,255) + end + + gfx.BeginPath() + gfx.MoveTo(x,y + h + 2 - h * result.gaugeSamples[1]) + for i = 2, #result.gaugeSamples do + gfx.LineTo(x + i * w / #result.gaugeSamples,y + h + 2 - h * result.gaugeSamples[i]) + end + + if isHard(result) then + gfx.StrokeWidth(3) + gfx.StrokeColor(232,163,10) + gfx.Stroke() + gfx.Scissor(x, y + h *0.01, w, h*0.98) + gfx.Stroke() + gfx.ResetScissor() + gfx.Scissor(x, y + h * 0.99, w, (h * 0.03) + 4) + gfx.StrokeColor(255,0,0) + gfx.Stroke() + gfx.ResetScissor() + else + gfx.StrokeWidth(3) + gfx.StrokeColor(46,211,241) + gfx.Scissor(x, y + h * 0.3, w, (h * 0.7) + 4) + gfx.Stroke() + gfx.ResetScissor() + gfx.Scissor(x, y, w, h*0.3) + gfx.StrokeColor(215,48,182) + gfx.Stroke() + gfx.ResetScissor() + end +end + function drawTimingBar(y, value, max, type) gfx.BeginPath(); @@ -516,8 +572,23 @@ local drawBottomPanelContent = function(deltatime) gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE) gfx.Text(result.medianHitDelta.." ms", rightX, baseY); gfx.Text(math.floor(result.meanHitDelta).." ms", rightX, baseY + detailTextMargin); + + --Draw Graph + drawGraph(leftX-22, baseY-18, 454, 98); + + --draw Recommended Offset + local delta = math.floor(result.medianHitDelta); + local songOffset = 0; + if (songOffset == nil) then songOffset = 0; end + local offset = tonumber(songOffset) + delta; + gfx.FillColor(255,255,255,255); + gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_TOP) + gfx.Text('RECOMMENDED SONG OFFSET:', leftX + 367, baseY + 89); + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP) + gfx.Text(string.format("%dms", offset), leftX + 370, baseY + 89); end + local drawJacketPanel = function() gfx.BeginPath(); local tw, th = gfx.ImageSize(jacketPanelImage); diff --git a/textures/result/panels/bottom.png b/textures/result/panels/bottom.png index 1837e87..49f4c2e 100644 Binary files a/textures/result/panels/bottom.png and b/textures/result/panels/bottom.png differ