dan game: soul gauge drawn as on the cabinet #66

Merged
GanYiZhong merged 5 commits from GanYiZhong/YataiDONNijiiro:fix/dan-game-gauge into main 2026-10-14 15:38:18 +02:00
2 changed files with 31 additions and 7 deletions
Showing only changes of commit 48660a8b87 - Show all commits

No files matched your search

+10 -1
View File
@@ -155,8 +155,17 @@ function DanBackground:draw_back()
self.chibi:draw()
end
-- the soul gauge's threshold marker, on top of everything (the gauge draws its separators)
-- the soul gauge's strip the lane covers (the cabinet draws the gauge over the lane), then
-- its threshold marker, on top of everything
local LANE_TOP, GAUGE_BOTTOM = 276, 288
function DanBackground:draw_fore()
local redraw = _G.g_dan_gauge_redraw
if redraw then
tex.begin_scissor(0, LANE_TOP, tex.get_screen_width(), GAUGE_BOTTOM - LANE_TOP)
local ok, err = pcall(redraw)
tex.end_scissor()
if not ok then error(err, 0) end
end
self.dan_info:draw_marker()
end
+21 -6
View File
@@ -125,14 +125,12 @@ local CAB_TRACK = 20.88 -- gauge_bg: 160 px x 0.1305 per cell
local CAB_SEPARATOR = 103 / 255
local parent_draw_dan = Gauge.draw_dan
function Gauge:draw_dan(points, previous_points, max_points, is_rainbow,
-- The cabinet draws the gauge over the lane; the engine draws the lane after it, so its top
-- edge (y 276, 184 px x 1.5) hides the cells' last rows. The gauge leaves a redraw for the
-- dan background's draw_fore (g_dan_gauge_redraw), which repeats it clipped to that strip.
local function draw_cab(self, border, points, previous_points, max_points, is_rainbow,
anim_active, anim_alpha, rainbow_fade, rainbow_frac, fire_frame)
local cab = self.cab
local border = _G.g_dan_gauge_border
if not (cab and cab.track_red and cab.lamp and cab.lamp_clear and border) then
return parent_draw_dan(self, points, previous_points, max_points, is_rainbow,
anim_active, anim_alpha, rainbow_fade, rainbow_frac, fire_frame)
end
local function layer(t, x, x2, fade, frame, scale, center)
if t then
tex.draw_texture(t, { x = x, x2 = x2, fade = fade, frame = frame, scale = scale, center = center })
@@ -172,3 +170,20 @@ function Gauge:draw_dan(points, previous_points, max_points, is_rainbow,
layer(self.tamashii_dark)
end
end
function Gauge:draw_dan(points, previous_points, max_points, is_rainbow,
anim_active, anim_alpha, rainbow_fade, rainbow_frac, fire_frame)
local cab = self.cab
local border = _G.g_dan_gauge_border
if not (cab and cab.track_red and cab.lamp and cab.lamp_clear and border) then
_G.g_dan_gauge_redraw = nil
return parent_draw_dan(self, points, previous_points, max_points, is_rainbow,
anim_active, anim_alpha, rainbow_fade, rainbow_frac, fire_frame)
end
draw_cab(self, border, points, previous_points, max_points, is_rainbow,
anim_active, anim_alpha, rainbow_fade, rainbow_frac, fire_frame)
_G.g_dan_gauge_redraw = function()
draw_cab(self, border, points, previous_points, max_points, is_rainbow,
anim_active, anim_alpha, rainbow_fade, rainbow_frac, fire_frame)
end
end