50% done only graph left

This commit is contained in:
RealFD 2021-12-27 20:30:48 +01:00
parent 8cd3f36e15
commit 30ca0407e6
1 changed files with 59 additions and 23 deletions

View File

@ -50,6 +50,7 @@ local danBadgeImage = gfx.CreateSkinImage("dan/inf.png", 0);
local badgeLines = gfx.CreateSkinImage("result/badge_lines.png", 0);
local badgeGrade = gfx.CreateSkinImage("result/badge_gradient.png", 0);
local timming = gfx.CreateSkinImage("result/timing.png", 0);
local gradeImages = {
S = gfx.CreateSkinImage("common/grades/S.png", 0),
@ -140,6 +141,9 @@ local badgeLinesAnimOffsetX = 0;
local rightPanelX = 0;
local rightPanelY = 910;
local timmingX = 575;
local timmingY = 1472;
local bottomPanelX = 0;
local bottomPanelY = 1170;
@ -189,13 +193,14 @@ function drawTimingBar(y, value, max, type)
if type == 'crit' then
gfx.FillColor(255, 255, 84, 255);
gfx.Rect(rightPanelX + 696, rightPanelY + y, 293 * (value / max), 8);
elseif type == 'early' then
gfx.FillColor(255, 16, 94, 255);
gfx.Rect(rightPanelX + 696, rightPanelY + y, 293 * (value / max), 8);
elseif type == 'late' then
gfx.FillColor(16, 225, 255, 255);
gfx.Rect(rightPanelX + 696, rightPanelY + y, 293 * (value / max), 8);
end
gfx.Rect(rightPanelX + 696, rightPanelY + y, 293 * (value / max), 8);
gfx.Fill();
gfx.ClosePath();
end
@ -258,7 +263,6 @@ end
local drawRightPanel = function()
gfx.BeginPath();
local tw, th = gfx.ImageSize(rightPanelImage);
gfx.ImageRect(rightPanelX, rightPanelY, tw, th, rightPanelImage, 1, 0);
end
@ -269,7 +273,6 @@ local drawRightPanelContent = function()
if highScore then highScoreScore = highScore.score end
local highScoreDelta = result.score - highScoreScore
-- Draw clear badge
local badgeData = clearBadgeImages[result.badge + 1] or clearBadgeImages[1]
if (result.autoplay) then
@ -326,8 +329,58 @@ local drawRightPanelContent = function()
gfx.ImageRect(rightPanelX + 722, rightPanelY + 273, 211, 40,
gaugeTypeBadgeImages[result.gauge_type + 1], 1, 0);
-- Draw gauge %
gfx.FontSize(24)
-- Draw median and mean hit delta
local addX = 418.5
local leftX = timmingX + addX
local rightX = timmingX + addX
local baseY = timmingY + 33
local detailTextMargin = 25.5
local tmw, tmh = gfx.ImageSize(timming);
gfx.BeginPath()
gfx.ImageRect(timmingX, timmingY, tmw/1.1, tmh/1.1, timming, 1, 0);
local Fillmhd, Fillmihd = result.meanHitDelta, result.medianHitDelta;
-- result.meanHitDelta up210 down
gfx.BeginPath();
gfx.FillColor(255, 100, 0, 255);
gfx.Rect(timmingX + 210, timmingY + 27.2 , Fillmhd, 12);
gfx.Fill();
if Fillmhd >= 210 then
gfx.Rect(timmingX + 210, timmingY + 27.2 , 210, 12);
gfx.Fill();
elseif Fillmhd <= -196 then
gfx.Rect(timmingX + 210, timmingY + 27.2 , -196, 12);
gfx.Fill();
end
gfx.ClosePath();
-- result.medianHitDelta
gfx.BeginPath();
gfx.FillColor(255, 136, 0, 255);
gfx.Rect(timmingX + 210, timmingY + 27.2 + detailTextMargin, Fillmihd, 12);
gfx.Fill();
if Fillmhd >= 210 then
gfx.Rect(timmingX + 210, timmingY + 27.2 + detailTextMargin, 210, 12);
gfx.Fill();
elseif Fillmhd <= -196 then
gfx.Rect(timmingX + 210, timmingY + 27.2 + detailTextMargin, -196, 12);
gfx.Fill();
end
gfx.ClosePath();
gfx.FillColor(255, 255, 255, 255);
gfx.FontSize(18)
gfx.BeginPath();
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 gauge %
gfx.FontSize(24)
if result.gauge == 1 then
gfx.Text('100%', rightPanelX + 987,
@ -343,10 +396,6 @@ local drawRightPanelContent = function()
) * 10
);
gfx.Text(decimalPortion .. '%', rightPanelX + 988, rightPanelY + 296);
-- gfx.FontSize(24)
-- gfx.Text('%', rightPanelX + 988, rightPanelY + 294);
end
gfx.FontSize(24)
@ -484,19 +533,6 @@ local drawBottomPanelContent = function(deltatime)
gfx.FontSize(22)
gfx.Text(irText, bottomPanelX + 80, bottomPanelY + 461);
-- Draw median and mean hit delta
local leftX = bottomPanelX + 600
local rightX = bottomPanelX + 1010
local baseY = bottomPanelY + 440
local detailTextMargin = 25
gfx.FontSize(20)
gfx.Text('Median hit delta', leftX, baseY);
gfx.Text('Mean hit delta', leftX, baseY + detailTextMargin);
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);
end
local drawJacketPanel = function()