From 58bff25db5be96d0449f68e26c1a4aa1fbc7650e Mon Sep 17 00:00:00 2001 From: FajsiEx Date: Fri, 27 Aug 2021 18:37:49 +0200 Subject: [PATCH] + decimal portion to the gauge % in the results --- scripts/result.lua | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/scripts/result.lua b/scripts/result.lua index 8ec79d5..694acf9 100644 --- a/scripts/result.lua +++ b/scripts/result.lua @@ -278,8 +278,28 @@ local drawRightPanelContent = function() -- Draw gauge % gfx.FontSize(24) - gfx.Text(math.floor(result.gauge * 100) .. '%', rightPanelX + 987, - rightPanelY + 294); + + if result.gauge == 1 then + gfx.Text('100%', rightPanelX + 987, + rightPanelY + 294); + else + gfx.Text(math.floor(result.gauge * 100) .. '.', rightPanelX + 964, rightPanelY + 294); + + gfx.FontSize(18) + local decimalPortion = math.floor( + ( + result.gauge * 100 - + math.floor(result.gauge * 100) + ) * 10 + ); + gfx.Text(decimalPortion .. '%', rightPanelX + 988, rightPanelY + 296); + + + -- gfx.FontSize(24) + -- gfx.Text('%', rightPanelX + 988, rightPanelY + 294); + end + + gfx.FontSize(24) -- Draw gauge fill local gaugeFillImage = gaugeEffPassFillImage;