diff --git a/scripts/gameplay.lua b/scripts/gameplay.lua index cb1389f..5a95fab 100644 --- a/scripts/gameplay.lua +++ b/scripts/gameplay.lua @@ -717,9 +717,11 @@ function draw_gauge(deltaTime) local gaugeFillAlpha = 1; local gaugeBgImage = gaugeEffBgImage; local gaugeFillImage = gaugeEffPassFillImage; + local gaugeBreakpoint = 0; if gameplay.gauge.type == 0 then gaugeBgImage = gaugeEffBgImage; + gaugeBreakpoint = 0.7; if gameplay.gauge.value <= 0.7 then gaugeFillImage = gaugeEffFailFillImage; @@ -730,6 +732,7 @@ function draw_gauge(deltaTime) elseif gameplay.gauge.type == 1 then gaugeBgImage = gaugeExcBgImage; gaugeFillImage = gaugeExcFillImage; + gaugeBreakpoint = 0.3; if gameplay.gauge.value < 0.3 then gaugeFillAlpha = 1 - math.abs(gaugeWarnTransitionScale - 0.5); -- 100 -> 50 -> 100 @@ -769,8 +772,39 @@ function draw_gauge(deltaTime) gfx.ImageRect(gaugePosX+18, gaugePosY+9+(FillH-(FillH*(gameplay.gauge.value))), FillW, FillH*(gameplay.gauge.value), gaugeFillImage, 1, 0) gfx.GlobalAlpha(1); + -- Draw the breakpoint line if needed + if (gaugeBreakpoint > 0) then + gfx.Save() + gfx.BeginPath() - -- TODO: Draw gauge % label + local lineY = gaugePosY+6+(FillH-(FillH*(gaugeBreakpoint))) + + gfx.MoveTo(gaugePosX+18, lineY) + gfx.LineTo(gaugePosX+36, lineY) + + gfx.StrokeWidth(2) + gfx.StrokeColor(255,255,255) + gfx.Stroke() + + gfx.ClosePath() + gfx.Restore() + end + + -- Draw gauge % label + local gaugeMarkerY = gaugePosY-6+(FillH-(FillH*(gameplay.gauge.value))) + + gfx.BeginPath() + gfx.ImageRect(gaugePosX-64, gaugeMarkerY, 83*0.85, 37*0.85, gaugeMarkerBgImage, 1, 0) + + gfx.BeginPath() + gfx.FillColor(255, 255, 255) + gfx.LoadSkinFont("Digital-Serial-Bold.ttf") + gfx.FontSize(22) + gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE) + gfx.Text(math.floor(gameplay.gauge.value * 100), gaugePosX-16, gaugeMarkerY+17) + + gfx.FontSize(16) + gfx.Text('%', gaugePosX-4, gaugeMarkerY+17) end -- -------------------------------------------------------------------------- -- -- draw_combo: --