+ blastive gauge wip & * increase gauge warn flashing intensity

This commit is contained in:
FajsiEx 2021-08-12 13:15:50 +02:00
parent 2ff18307d1
commit 8bdcf11dc2
1 changed files with 21 additions and 3 deletions

View File

@ -711,6 +711,9 @@ local gaugeExcArsFillImage = gfx.CreateSkinImage("gameplay/gauges/excessive_ars/
local gaugePermBgImage = gfx.CreateSkinImage("gameplay/gauges/permissive/gauge_back.png", 0) local gaugePermBgImage = gfx.CreateSkinImage("gameplay/gauges/permissive/gauge_back.png", 0)
local gaugePermFillImage = gfx.CreateSkinImage("gameplay/gauges/permissive/gauge_fill.png", 0) local gaugePermFillImage = gfx.CreateSkinImage("gameplay/gauges/permissive/gauge_fill.png", 0)
local gaugeBlastiveBgImage = gfx.CreateSkinImage("gameplay/gauges/blastive/gauge_back.png", 0)
local gaugeBlastiveFillImage = gfx.CreateSkinImage("gameplay/gauges/blastive/gauge_fill.png", 0)
function draw_gauge(deltaTime) function draw_gauge(deltaTime)
-- fallbacks in case of unsupported type -- fallbacks in case of unsupported type
@ -735,7 +738,7 @@ function draw_gauge(deltaTime)
gaugeBreakpoint = 0.3; gaugeBreakpoint = 0.3;
if gameplay.gauge.value < 0.3 then if gameplay.gauge.value < 0.3 then
gaugeFillAlpha = 1 - math.abs(gaugeWarnTransitionScale - 0.5); -- 100 -> 50 -> 100 gaugeFillAlpha = 1 - math.abs(gaugeWarnTransitionScale - 0.25); -- 100 -> 20 -> 100
gaugeWarnTransitionScale = gaugeWarnTransitionScale + deltaTime*10; gaugeWarnTransitionScale = gaugeWarnTransitionScale + deltaTime*10;
if gaugeWarnTransitionScale > 1 then if gaugeWarnTransitionScale > 1 then
@ -747,7 +750,19 @@ function draw_gauge(deltaTime)
gaugeFillImage = gaugePermFillImage; gaugeFillImage = gaugePermFillImage;
if gameplay.gauge.value < 0.3 then if gameplay.gauge.value < 0.3 then
gaugeFillAlpha = 1 - math.abs(gaugeWarnTransitionScale - 0.5); -- 100 -> 50 -> 100 gaugeFillAlpha = 1 - math.abs(gaugeWarnTransitionScale - 0.25); -- 100 -> 52 -> 100
gaugeWarnTransitionScale = gaugeWarnTransitionScale + deltaTime*10;
if gaugeWarnTransitionScale > 1 then
gaugeWarnTransitionScale = 0;
end
end
elseif gameplay.gauge.type == 3 then -- BLASTIVE RATE
gaugeBgImage = gaugeBlastiveBgImage;
gaugeFillImage = gaugeBlastiveFillImage;
if gameplay.gauge.value < 0.3 then
gaugeFillAlpha = 1 - math.abs(gaugeWarnTransitionScale - 0.25); -- 100 -> 20 -> 100
gaugeWarnTransitionScale = gaugeWarnTransitionScale + deltaTime*10; gaugeWarnTransitionScale = gaugeWarnTransitionScale + deltaTime*10;
if gaugeWarnTransitionScale > 1 then if gaugeWarnTransitionScale > 1 then
@ -769,13 +784,16 @@ function draw_gauge(deltaTime)
gfx.GlobalAlpha(gaugeFillAlpha); gfx.GlobalAlpha(gaugeFillAlpha);
gfx.BeginPath() gfx.BeginPath()
gfx.ImageRect(gaugePosX+18, gaugePosY+9+(FillH-(FillH*(gameplay.gauge.value))), FillW, FillH*(gameplay.gauge.value), gaugeFillImage, 1, 0) gfx.Scissor(gaugePosX+18, gaugePosY+9+(FillH-(FillH*(gameplay.gauge.value))), FillW, FillH*(gameplay.gauge.value))
gfx.ImageRect(gaugePosX+18, gaugePosY+9, FillW, FillH, gaugeFillImage, 1, 0)
gfx.ResetScissor();
gfx.GlobalAlpha(1); gfx.GlobalAlpha(1);
-- Draw the breakpoint line if needed -- Draw the breakpoint line if needed
if (gaugeBreakpoint > 0) then if (gaugeBreakpoint > 0) then
gfx.Save() gfx.Save()
gfx.BeginPath() gfx.BeginPath()
gfx.GlobalAlpha(0.75);
local lineY = gaugePosY+6+(FillH-(FillH*(gaugeBreakpoint))) local lineY = gaugePosY+6+(FillH-(FillH*(gaugeBreakpoint)))