From a05f8ab041fb23e5906955a53411e3b8cdf68db1 Mon Sep 17 00:00:00 2001 From: RealFD Date: Mon, 27 Dec 2021 22:40:26 +0100 Subject: [PATCH] better now --- scripts/result.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/result.lua b/scripts/result.lua index 2daf553..e520b9e 100644 --- a/scripts/result.lua +++ b/scripts/result.lua @@ -342,7 +342,7 @@ local drawRightPanelContent = function() gfx.BeginPath() gfx.ImageRect(timmingX, timmingY, tmw/1.1, tmh/1.1, timming, 1, 0); - local Fillmhd, Fillmihd = result.meanHitDelta, result.medianHitDelta; + local Fillmhd, Fillmihd = math.floor(result.meanHitDelta), result.medianHitDelta; -- result.meanHitDelta up210 down gfx.BeginPath(); @@ -355,20 +355,25 @@ local drawRightPanelContent = function() elseif Fillmhd <= -196 then gfx.Rect(timmingX + 210, timmingY + 27.2 , -196, 12); gfx.Fill(); + elseif Fillmhd == 0 then + gfx.Rect(timmingX + 210, timmingY + 27.2 , 1, 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 + if Fillmihd >= 210 then gfx.Rect(timmingX + 210, timmingY + 27.2 + detailTextMargin, 210, 12); gfx.Fill(); - elseif Fillmhd <= -196 then + elseif Fillmihd <= -196 then gfx.Rect(timmingX + 210, timmingY + 27.2 + detailTextMargin, -196, 12); gfx.Fill(); + elseif Fillmihd == 0 then + gfx.Rect(timmingX + 210, timmingY + 27.2 + detailTextMargin, 1, 12); + gfx.Fill(); end gfx.ClosePath(); @@ -376,8 +381,8 @@ local drawRightPanelContent = function() 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); + gfx.Text(Fillmhd.." ms", rightX, baseY); + gfx.Text(Fillmihd.." ms", rightX, baseY + detailTextMargin); -- Draw gauge % gfx.FontSize(24)