diff --git a/.gitignore b/.gitignore index 7f5c6b9..6d28dbe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ _asset song-assets skin-assets +nautica.json \ No newline at end of file diff --git a/scripts/gameplay.lua b/scripts/gameplay.lua index e52dd38..8cb43db 100644 --- a/scripts/gameplay.lua +++ b/scripts/gameplay.lua @@ -695,47 +695,52 @@ end -- -------------------------------------------------------------------------- -- -- draw_gauge: -- local gaugeNumBack = gfx.CreateSkinImage("gauge_num_back.png", 0) -local gaugeBgImage = gfx.CreateSkinImage("gameplay/gauges/hard/gauge_back.png", 0) -local gaugeFillImage = gfx.CreateSkinImage("gameplay/gauges/hard/gauge_fill.png", 0) + + +local gaugeEffBgImage = gfx.CreateSkinImage("gameplay/gauges/effective/gauge_back.png", 0) +local gaugeEffFailFillImage = gfx.CreateSkinImage("gameplay/gauges/effective/gauge_fill_fail.png", 0) +local gaugeEffPassFillImage = gfx.CreateSkinImage("gameplay/gauges/effective/gauge_fill_pass.png", 0) + +local gaugeExcBgImage = gfx.CreateSkinImage("gameplay/gauges/excessive/gauge_back.png", 0) +local gaugeExcFillImage = gfx.CreateSkinImage("gameplay/gauges/excessive/gauge_fill.png", 0) + +local gaugeExcArsBgImage = gfx.CreateSkinImage("gameplay/gauges/excessive_ars/gauge_back.png", 0) +local gaugeExcArsFillImage = gfx.CreateSkinImage("gameplay/gauges/excessive_ars/gauge_fill.png", 0) + function draw_gauge(deltaTime) - - local width = 82 * scale / 1 - local height = 702 * scale / 1 - local posx = resx - width - local posy = resy / 2 - height / 2 + 60 - if portrait then - posx = resx - width - posy = posy - 90 + -- fallbacks in case of unsupported type + local gaugeBgImage = gaugeEffBgImage; + local gaugeFillImage = gaugeEffPassFillImage; + + if gameplay.gauge.type == 0 then + gaugeBgImage = gaugeEffBgImage; + + if gameplay.gauge.value <= 0.7 then + gaugeFillImage = gaugeEffFailFillImage; + else + gaugeFillImage = gaugeEffPassFillImage; + end + + elseif gameplay.gauge.type == 1 then + gaugeBgImage = gaugeExcBgImage; + gaugeFillImage = gaugeExcFillImage; end - local tw, th = gfx.ImageSize(gaugeBgImage) - gfx.ImageRect(posx, posy, tw, th, gaugeBgImage, 1, 0) - gfx.ImageRect(posx+22, posy+11+(629-(629*(gameplay.gauge.value))), 23, 629*(gameplay.gauge.value), gaugeFillImage, 1, 0) + + local BgW, BgH = gfx.ImageSize(gaugeBgImage); + local FillW, FillH = gfx.ImageSize(gaugeFillImage); + local gaugePosX = 1080 - BgW - 48; + local gaugePosY = 1920/2 - BgH/2 - 32; + + -- gfx.Text('RESX: ' .. resx .. ' // RESY: ' .. resy .. ' // GPX: ' .. gaugePosX, 255,1200); + + gfx.ImageRect(gaugePosX, gaugePosY, BgW, BgH, gaugeBgImage, 1, 0) + gfx.ImageRect(gaugePosX+22, gaugePosY+11+(FillH-(FillH*(gameplay.gauge.value))), FillW, FillH*(gameplay.gauge.value), gaugeFillImage, 1, 0) - --draw gauge % label - posx = posx / scale - posx = posx + (-20 * 0.5) - -- 630 = 0% position - height = 960 * 0.5 - posy = posy / scale - - tw, th = gfx.ImageSize(gaugeNumBack) - -- 80 = 100% position - posy = posy + (95 * 0.5) + height - height * gameplay.gauge.value - -- Draw the background - gfx.BeginPath() - gfx.FillColor(255, 255, 255) - gfx.ImageRect(posx - 44, posy - 10, tw, th, gaugeNumBack, 1, 0) - - gfx.BeginPath() - -- gfx.FillColor(250, 228, 112) - draw_number(posx - 24, posy + 4, 1.0, math.floor(gameplay.gauge.value * 100), 3, numberImages, true) - -- gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE) - -- gfx.FontSize(18) - -- gfx.Text(string.format("%d", math.floor(gameplay.gauge.value * 100)), posx, posy + 4) + -- TODO: Draw gauge % label end -- -------------------------------------------------------------------------- -- -- draw_combo: -- diff --git a/textures/gameplay/gauges/normal/gauge_back.png b/textures/gameplay/gauges/effective/gauge_back.png similarity index 100% rename from textures/gameplay/gauges/normal/gauge_back.png rename to textures/gameplay/gauges/effective/gauge_back.png diff --git a/textures/gameplay/gauges/effective/gauge_fill_fail.png b/textures/gameplay/gauges/effective/gauge_fill_fail.png new file mode 100644 index 0000000..69721aa Binary files /dev/null and b/textures/gameplay/gauges/effective/gauge_fill_fail.png differ diff --git a/textures/gameplay/gauges/effective/gauge_fill_pass.png b/textures/gameplay/gauges/effective/gauge_fill_pass.png new file mode 100644 index 0000000..59d4aa1 Binary files /dev/null and b/textures/gameplay/gauges/effective/gauge_fill_pass.png differ diff --git a/textures/gameplay/gauges/hard+ARS/gauge_front.png b/textures/gameplay/gauges/effective/gauge_front.png similarity index 100% rename from textures/gameplay/gauges/hard+ARS/gauge_front.png rename to textures/gameplay/gauges/effective/gauge_front.png diff --git a/textures/gameplay/gauges/hard+ARS/gauge_mask.png b/textures/gameplay/gauges/effective/gauge_mask.png similarity index 100% rename from textures/gameplay/gauges/hard+ARS/gauge_mask.png rename to textures/gameplay/gauges/effective/gauge_mask.png diff --git a/textures/gameplay/gauges/hard/gauge_back.png b/textures/gameplay/gauges/excessive/gauge_back.png similarity index 100% rename from textures/gameplay/gauges/hard/gauge_back.png rename to textures/gameplay/gauges/excessive/gauge_back.png diff --git a/textures/gameplay/gauges/hard+ARS/gauge_fill.png b/textures/gameplay/gauges/excessive/gauge_fill.png similarity index 100% rename from textures/gameplay/gauges/hard+ARS/gauge_fill.png rename to textures/gameplay/gauges/excessive/gauge_fill.png diff --git a/textures/gameplay/gauges/hard/gauge_front.png b/textures/gameplay/gauges/excessive/gauge_front.png similarity index 100% rename from textures/gameplay/gauges/hard/gauge_front.png rename to textures/gameplay/gauges/excessive/gauge_front.png diff --git a/textures/gameplay/gauges/hard/gauge_mask.png b/textures/gameplay/gauges/excessive/gauge_mask.png similarity index 100% rename from textures/gameplay/gauges/hard/gauge_mask.png rename to textures/gameplay/gauges/excessive/gauge_mask.png diff --git a/textures/gameplay/gauges/hard+ARS/Excessive+ARS.png b/textures/gameplay/gauges/excessive_ars/gauge_back.png similarity index 100% rename from textures/gameplay/gauges/hard+ARS/Excessive+ARS.png rename to textures/gameplay/gauges/excessive_ars/gauge_back.png diff --git a/textures/gameplay/gauges/hard/gauge_fill.png b/textures/gameplay/gauges/excessive_ars/gauge_fill.png similarity index 100% rename from textures/gameplay/gauges/hard/gauge_fill.png rename to textures/gameplay/gauges/excessive_ars/gauge_fill.png diff --git a/textures/gameplay/gauges/normal/gauge_front.png b/textures/gameplay/gauges/excessive_ars/gauge_front.png similarity index 100% rename from textures/gameplay/gauges/normal/gauge_front.png rename to textures/gameplay/gauges/excessive_ars/gauge_front.png diff --git a/textures/gameplay/gauges/normal/gauge_mask.png b/textures/gameplay/gauges/excessive_ars/gauge_mask.png similarity index 100% rename from textures/gameplay/gauges/normal/gauge_mask.png rename to textures/gameplay/gauges/excessive_ars/gauge_mask.png diff --git a/textures/gameplay/gauges/normal/gauge_fill.png b/textures/gameplay/gauges/normal/gauge_fill.png deleted file mode 100644 index 470f185..0000000 Binary files a/textures/gameplay/gauges/normal/gauge_fill.png and /dev/null differ