From a9bce590c59318322bffc3e171898c081a894c4d Mon Sep 17 00:00:00 2001 From: TaikoZhong <108016253+GanYiZhong@users.noreply.github.com> Date: Wed, 14 Oct 2026 19:23:04 +0800 Subject: [PATCH 1/5] dan game: soul gauge threshold marker, cell art and threshold caption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The white threshold marker (game/dan_info/gauge_border_cell) is drawn on the threshold cell, as the cabinet's border_N, from Background:draw_fore so it sits over the lane frame. - The gauge cells (gauge_dan/1p_bar, 2p_bar, 1p_bar_fade) get the cabinet lamp's light band along the top. - The 「100 %以上」 caption on the threshold plate sits lower and one size smaller, as on the cabinet. Co-Authored-By: Claude Opus 5.5 --- Graphics/game/gauge_dan/1p_bar.png | 4 +-- Graphics/game/gauge_dan/1p_bar_fade.png | 4 +-- Graphics/game/gauge_dan/2p_bar.png | 4 +-- Scripts/background/bg_collabs/dan.lua | 4 ++- Scripts/background/bg_objects/dan_info.lua | 35 +++++++++++++++++++--- 5 files changed, 40 insertions(+), 11 deletions(-) diff --git a/Graphics/game/gauge_dan/1p_bar.png b/Graphics/game/gauge_dan/1p_bar.png index 0303c62..a8787ab 100644 --- a/Graphics/game/gauge_dan/1p_bar.png +++ b/Graphics/game/gauge_dan/1p_bar.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5334beebaf0465383e56388ab56095e59fb4663333ed31f8393c4c5eea42240d -size 121 +oid sha256:4881329e93a7040b9381d9e0e5b9a059ef970e161784f4c6f4854f7f3bd9fc1b +size 114 diff --git a/Graphics/game/gauge_dan/1p_bar_fade.png b/Graphics/game/gauge_dan/1p_bar_fade.png index 7379271..051b125 100644 --- a/Graphics/game/gauge_dan/1p_bar_fade.png +++ b/Graphics/game/gauge_dan/1p_bar_fade.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:27a25757806a1bef35ef5c37ac29c1f9493bdc78728fce9d80e1e3c44117b513 -size 918 +oid sha256:cf478da9b65420849d8a1b1ab781b4737e3ca3df4f50df846262cbb5cd059d30 +size 904 diff --git a/Graphics/game/gauge_dan/2p_bar.png b/Graphics/game/gauge_dan/2p_bar.png index 0303c62..a8787ab 100644 --- a/Graphics/game/gauge_dan/2p_bar.png +++ b/Graphics/game/gauge_dan/2p_bar.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5334beebaf0465383e56388ab56095e59fb4663333ed31f8393c4c5eea42240d -size 121 +oid sha256:4881329e93a7040b9381d9e0e5b9a059ef970e161784f4c6f4854f7f3bd9fc1b +size 114 diff --git a/Scripts/background/bg_collabs/dan.lua b/Scripts/background/bg_collabs/dan.lua index bc9f4dd..cab4969 100644 --- a/Scripts/background/bg_collabs/dan.lua +++ b/Scripts/background/bg_collabs/dan.lua @@ -155,7 +155,8 @@ function DanBackground:draw_back() self.chibi:draw() end --- dan soul gauge separator overlay (static, drawn at a hardcoded fade). +-- dan soul gauge separator overlay (static, drawn at a hardcoded fade), then the gauge's +-- threshold marker on top of everything. function DanBackground:draw_fore() if not self._gauge_overlay then self._gauge_overlay = tex.get_texture("game/gauge_dan/overlay") or 0 @@ -163,6 +164,7 @@ function DanBackground:draw_fore() if self._gauge_overlay ~= 0 then tex.draw_texture(self._gauge_overlay, { fade = 0.15 }) end + self.dan_info:draw_marker() end -- dan condition plate, drawn in the gauge's own layer. diff --git a/Scripts/background/bg_objects/dan_info.lua b/Scripts/background/bg_objects/dan_info.lua index 27dc810..e753dbc 100644 --- a/Scripts/background/bg_objects/dan_info.lua +++ b/Scripts/background/bg_objects/dan_info.lua @@ -1,5 +1,6 @@ -- 段位道場 exam-panel extras only Lua can draw: the soul-gauge pass-threshold --- callout plate + captions, anchored on the gauge's own 50-cell grid. +-- callout plate + captions and the white threshold marker on the threshold cell, anchored +-- on the gauge's own 50-cell grid. local M = {} M.__index = M @@ -17,9 +18,14 @@ local PLATE_OVERHANG = 24 -- px the plate extends PAST the threshold local PILL_CX, PILL_CY = 150, 20 -- 魂ゲージ ink centre, plate-local local VALUE_RIGHT = 532 -- 100%以上 is RIGHT-aligned to this -local VALUE_CY = 22 -- its ink centre y, plate-local +local VALUE_CY = 39 -- its ink centre y, plate-local local NAME_SIZE = 26 -- arcade id 142 -local VALUE_SIZE = 36 -- arcade id 141 +local VALUE_SIZE = 30 -- arcade id 141 + +-- the threshold marker (gauge_border_cell): its white inside (x 7, y 7 in the art) lands on +-- the threshold cell's left edge + 1, from y 238, as the cabinet's border_N +local MARKER_INNER_X, MARKER_INNER_Y = 7, 7 +local MARKER_Y = 238 local CAP_FILL = { 255, 255, 255, 255 } local CAP_OUTLINE = { 80, 60, 45, 255 } -- #503C2D @@ -27,7 +33,8 @@ local VALUE_OUTLINE = { 0, 0, 0, 255 } function M.new() return setmetatable({ state = nil, label = nil, label_for = nil, - name_label = nil, plate = nil, plate_tried = false }, M) + name_label = nil, plate = nil, plate_tried = false, + marker = nil, marker_tried = false }, M) end function M:plate_id() @@ -38,6 +45,14 @@ function M:plate_id() return self.plate end +function M:marker_id() + if not self.marker_tried then + self.marker_tried = true + self.marker = tex.get_texture("game/dan_info/gauge_border_cell") + end + return self.marker +end + -- Called from Background:handle_dan. function M:handle(state) self.state = state @@ -103,4 +118,16 @@ function M:draw() end end +-- The threshold marker, drawn over the lane's frame as on the cabinet (it reaches below the +-- gauge), so from Background:draw_fore() rather than with the plate in the gauge layer. +function M:draw_marker() + local ex = gauge_exam(self.state) + if not ex or not ex.red or ex.red <= 0 then return end + local n = math.max(1, math.min(CELL_COUNT, math.floor(ex.red / 2))) + local mid = self:marker_id() + if not mid then return end + local cell_left = GAUGE_X0 + CELL_PITCH * (n - 1) + tex.draw_texture(mid, { x = cell_left + 1 - MARKER_INNER_X, y = MARKER_Y - MARKER_INNER_Y }) +end + return M -- 2.54.0 From e8ce3b3a7d88017212a5dce6f87e626d862ac029 Mon Sep 17 00:00:00 2001 From: TaikoZhong <108016253+GanYiZhong@users.noreply.github.com> Date: Wed, 14 Oct 2026 19:33:42 +0800 Subject: [PATCH 2/5] dan game: the soul gauge's gold zone past the threshold The cabinet shows the cells past the threshold in gold: dark gold while unfilled, its lamp_clear (white band over yellow) once filled. The gauge script does not know the threshold, so dan_info, which does, paints them over the engine's cells in the gauge layer (game/dan_info/gauge_gold_cell, gauge_gold_unfilled). Co-Authored-By: Claude Opus 5.5 --- Graphics/game/dan_info/gauge_gold_cell.png | 3 ++ .../game/dan_info/gauge_gold_unfilled.png | 3 ++ Graphics/game/dan_info/texture.json | 8 +++++ Scripts/background/bg_objects/dan_info.lua | 30 +++++++++++++++++-- 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 Graphics/game/dan_info/gauge_gold_cell.png create mode 100644 Graphics/game/dan_info/gauge_gold_unfilled.png diff --git a/Graphics/game/dan_info/gauge_gold_cell.png b/Graphics/game/dan_info/gauge_gold_cell.png new file mode 100644 index 0000000..3511422 --- /dev/null +++ b/Graphics/game/dan_info/gauge_gold_cell.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fe59f16d8731f9ee7ca29ec1cacc5feb1285911ed740ac6d719f2e4d05240d7 +size 113 diff --git a/Graphics/game/dan_info/gauge_gold_unfilled.png b/Graphics/game/dan_info/gauge_gold_unfilled.png new file mode 100644 index 0000000..75de700 --- /dev/null +++ b/Graphics/game/dan_info/gauge_gold_unfilled.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb00dd3b0bb7eefcff580de49cb61b60a68107d85788bde1e076f7cd165e634d +size 106 diff --git a/Graphics/game/dan_info/texture.json b/Graphics/game/dan_info/texture.json index a4aada3..cff4297 100644 --- a/Graphics/game/dan_info/texture.json +++ b/Graphics/game/dan_info/texture.json @@ -201,5 +201,13 @@ "x": 1262, "y": 592, "x2": 0 + }, + "gauge_gold_cell": { + "x": 0, + "y": 0 + }, + "gauge_gold_unfilled": { + "x": 0, + "y": 0 } } diff --git a/Scripts/background/bg_objects/dan_info.lua b/Scripts/background/bg_objects/dan_info.lua index e753dbc..a30aed4 100644 --- a/Scripts/background/bg_objects/dan_info.lua +++ b/Scripts/background/bg_objects/dan_info.lua @@ -1,10 +1,12 @@ -- 段位道場 exam-panel extras only Lua can draw: the soul-gauge pass-threshold --- callout plate + captions and the white threshold marker on the threshold cell, anchored --- on the gauge's own 50-cell grid. +-- callout plate + captions, the white threshold marker on the threshold cell, and the gold +-- zone past it (the gauge itself does not know the threshold), anchored on the gauge's own +-- 50-cell grid. local M = {} M.__index = M local GAUGE_Y = 248 +local CELL_TOP = 248 -- the cells' top (gauge_dan/1p_bar) local GAUGE_X0 = 738 -- cell 1 starts here local CELL_PITCH = 21 local CELL_COUNT = 50 @@ -34,7 +36,7 @@ local VALUE_OUTLINE = { 0, 0, 0, 255 } function M.new() return setmetatable({ state = nil, label = nil, label_for = nil, name_label = nil, plate = nil, plate_tried = false, - marker = nil, marker_tried = false }, M) + marker = nil, marker_tried = false, gold = nil }, M) end function M:plate_id() @@ -53,6 +55,27 @@ function M:marker_id() return self.marker end +function M:gold_ids() + if self.gold == nil then + local lit = tex.get_texture("game/dan_info/gauge_gold_cell") + local dark = tex.get_texture("game/dan_info/gauge_gold_unfilled") + self.gold = (lit and dark) and { lit = lit, dark = dark } or false + end + return self.gold or nil +end + +-- The cells past the threshold, as on the cabinet: gold when filled, dark gold when not. +-- Drawn in the gauge layer, over the engine's red cells. +function M:draw_gold_zone(n) + local g = self:gold_ids() + if not g or n >= CELL_COUNT then return end + local filled = math.floor((self.state.gauge or 0) / 2 + 1e-6) + for k = n + 1, CELL_COUNT do + tex.draw_texture(k <= filled and g.lit or g.dark, + { x = GAUGE_X0 + CELL_PITCH * (k - 1), y = CELL_TOP }) + end +end + -- Called from Background:handle_dan. function M:handle(state) self.state = state @@ -79,6 +102,7 @@ function M:draw() if n < 1 then n = 1 end -- border_0 == border_1 on the cabinet if n > CELL_COUNT then n = CELL_COUNT end -- dan.json may say >100 %; the cabinet cannot local x = GAUGE_X0 + CELL_PITCH * n - CELL_PITCH / 2 - 1 + self:draw_gold_zone(n) if self.label_for ~= ex.red then -- skin_config: dan_gauge_name (魂ゲージ) and dan_exam_text_gauge ("%s %以上", %% = %) -- 2.54.0 From 287f8ffd67bada128a3011084ee1b17f86b12814 Mon Sep 17 00:00:00 2001 From: TaikoZhong <108016253+GanYiZhong@users.noreply.github.com> Date: Wed, 14 Oct 2026 20:22:30 +0800 Subject: [PATCH 3/5] dan game: the soul gauge drawn as the cabinet's tamashii_gauge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gauge:draw_dan is this skin's own now, built from the cabinet's tamashii_gauge pieces: - the gold track (border) with the red track (gauge_dan/track_red, gauge_bg) only up to the threshold, so the cells past it are dark gold; - the lit cells as the cabinet's lamp stretched 21 px per cell (gauge_dan/1p_lamp, 2p_lamp), all yellow (lamp_clear) once the gauge reaches the threshold, with the matching glow on a newly lit cell (bar_fade_clear); - the cell separators at the cabinet's 103/255 (they were drawn at 0.15, plus a second copy from the dan background); - 魂 grey, white once cleared, in flames at full. The threshold comes from the dan exam: background/dan_info hands it over as g_dan_gauge_border. Without it, or on a screen without these pieces, the parent draws. This replaces the gold-zone repaint in dan_info, and 1p_bar / 2p_bar / 1p_bar_fade go back to what they were. Co-Authored-By: Claude Opus 5.5 --- Graphics/game/dan_info/gauge_gold_cell.png | 3 - .../game/dan_info/gauge_gold_unfilled.png | 3 - Graphics/game/dan_info/texture.json | 8 -- Graphics/game/gauge_dan/1p_bar.png | 4 +- Graphics/game/gauge_dan/1p_bar_fade.png | 4 +- Graphics/game/gauge_dan/1p_lamp.png | 3 + Graphics/game/gauge_dan/2p_bar.png | 4 +- Graphics/game/gauge_dan/2p_lamp.png | 3 + Graphics/game/gauge_dan/bar_fade_clear.png | 3 + Graphics/game/gauge_dan/lamp_clear.png | 3 + Graphics/game/gauge_dan/texture.json | 20 +++++ Graphics/game/gauge_dan/track_red.png | 3 + Scripts/background/bg_collabs/dan.lua | 9 +-- Scripts/background/bg_objects/dan_info.lua | 44 +++-------- Scripts/game/gauge.lua | 75 ++++++++++++++++++- 15 files changed, 127 insertions(+), 62 deletions(-) delete mode 100644 Graphics/game/dan_info/gauge_gold_cell.png delete mode 100644 Graphics/game/dan_info/gauge_gold_unfilled.png create mode 100644 Graphics/game/gauge_dan/1p_lamp.png create mode 100644 Graphics/game/gauge_dan/2p_lamp.png create mode 100644 Graphics/game/gauge_dan/bar_fade_clear.png create mode 100644 Graphics/game/gauge_dan/lamp_clear.png create mode 100644 Graphics/game/gauge_dan/track_red.png diff --git a/Graphics/game/dan_info/gauge_gold_cell.png b/Graphics/game/dan_info/gauge_gold_cell.png deleted file mode 100644 index 3511422..0000000 --- a/Graphics/game/dan_info/gauge_gold_cell.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9fe59f16d8731f9ee7ca29ec1cacc5feb1285911ed740ac6d719f2e4d05240d7 -size 113 diff --git a/Graphics/game/dan_info/gauge_gold_unfilled.png b/Graphics/game/dan_info/gauge_gold_unfilled.png deleted file mode 100644 index 75de700..0000000 --- a/Graphics/game/dan_info/gauge_gold_unfilled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fb00dd3b0bb7eefcff580de49cb61b60a68107d85788bde1e076f7cd165e634d -size 106 diff --git a/Graphics/game/dan_info/texture.json b/Graphics/game/dan_info/texture.json index cff4297..a4aada3 100644 --- a/Graphics/game/dan_info/texture.json +++ b/Graphics/game/dan_info/texture.json @@ -201,13 +201,5 @@ "x": 1262, "y": 592, "x2": 0 - }, - "gauge_gold_cell": { - "x": 0, - "y": 0 - }, - "gauge_gold_unfilled": { - "x": 0, - "y": 0 } } diff --git a/Graphics/game/gauge_dan/1p_bar.png b/Graphics/game/gauge_dan/1p_bar.png index a8787ab..0303c62 100644 --- a/Graphics/game/gauge_dan/1p_bar.png +++ b/Graphics/game/gauge_dan/1p_bar.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4881329e93a7040b9381d9e0e5b9a059ef970e161784f4c6f4854f7f3bd9fc1b -size 114 +oid sha256:5334beebaf0465383e56388ab56095e59fb4663333ed31f8393c4c5eea42240d +size 121 diff --git a/Graphics/game/gauge_dan/1p_bar_fade.png b/Graphics/game/gauge_dan/1p_bar_fade.png index 051b125..7379271 100644 --- a/Graphics/game/gauge_dan/1p_bar_fade.png +++ b/Graphics/game/gauge_dan/1p_bar_fade.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cf478da9b65420849d8a1b1ab781b4737e3ca3df4f50df846262cbb5cd059d30 -size 904 +oid sha256:27a25757806a1bef35ef5c37ac29c1f9493bdc78728fce9d80e1e3c44117b513 +size 918 diff --git a/Graphics/game/gauge_dan/1p_lamp.png b/Graphics/game/gauge_dan/1p_lamp.png new file mode 100644 index 0000000..5c6a55b --- /dev/null +++ b/Graphics/game/gauge_dan/1p_lamp.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7073f04a6f717214aabd6f60f80fde4a4656012327780ccfaa6df51b0cf6269 +size 102 diff --git a/Graphics/game/gauge_dan/2p_bar.png b/Graphics/game/gauge_dan/2p_bar.png index a8787ab..0303c62 100644 --- a/Graphics/game/gauge_dan/2p_bar.png +++ b/Graphics/game/gauge_dan/2p_bar.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4881329e93a7040b9381d9e0e5b9a059ef970e161784f4c6f4854f7f3bd9fc1b -size 114 +oid sha256:5334beebaf0465383e56388ab56095e59fb4663333ed31f8393c4c5eea42240d +size 121 diff --git a/Graphics/game/gauge_dan/2p_lamp.png b/Graphics/game/gauge_dan/2p_lamp.png new file mode 100644 index 0000000..b4dba75 --- /dev/null +++ b/Graphics/game/gauge_dan/2p_lamp.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:feee6a6b22b4fbe5fefb51a7568f1f0c9f553e37f543f5498042ab37357bd18e +size 101 diff --git a/Graphics/game/gauge_dan/bar_fade_clear.png b/Graphics/game/gauge_dan/bar_fade_clear.png new file mode 100644 index 0000000..ccc1a03 --- /dev/null +++ b/Graphics/game/gauge_dan/bar_fade_clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0b93b68d5618c46103efe2f338affdee84f0afd82c967016640ccd347b357c5 +size 844 diff --git a/Graphics/game/gauge_dan/lamp_clear.png b/Graphics/game/gauge_dan/lamp_clear.png new file mode 100644 index 0000000..e5d92e8 --- /dev/null +++ b/Graphics/game/gauge_dan/lamp_clear.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ecf728861f1e98daff53b3cbfb5acb5c7e48c90dc0268bb1f7b82361deb1af18 +size 101 diff --git a/Graphics/game/gauge_dan/texture.json b/Graphics/game/gauge_dan/texture.json index ba6afd6..e6403e5 100644 --- a/Graphics/game/gauge_dan/texture.json +++ b/Graphics/game/gauge_dan/texture.json @@ -100,5 +100,25 @@ "tamashii_fire": { "x": 1698, "y": 34 + }, + "track_red": { + "x": 738, + "y": 242 + }, + "1p_lamp": { + "x": 738, + "y": 242 + }, + "2p_lamp": { + "x": 738, + "y": 242 + }, + "lamp_clear": { + "x": 738, + "y": 242 + }, + "bar_fade_clear": { + "x": 733, + "y": 241 } } diff --git a/Graphics/game/gauge_dan/track_red.png b/Graphics/game/gauge_dan/track_red.png new file mode 100644 index 0000000..2e6970c --- /dev/null +++ b/Graphics/game/gauge_dan/track_red.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15b7143bdf6632718f0b1ce429ab81a3e221429f15c7e9de48712521d7091a6f +size 162 diff --git a/Scripts/background/bg_collabs/dan.lua b/Scripts/background/bg_collabs/dan.lua index cab4969..26f5daa 100644 --- a/Scripts/background/bg_collabs/dan.lua +++ b/Scripts/background/bg_collabs/dan.lua @@ -155,15 +155,8 @@ function DanBackground:draw_back() self.chibi:draw() end --- dan soul gauge separator overlay (static, drawn at a hardcoded fade), then the gauge's --- threshold marker on top of everything. +-- the soul gauge's threshold marker, on top of everything (the gauge draws its separators) function DanBackground:draw_fore() - if not self._gauge_overlay then - self._gauge_overlay = tex.get_texture("game/gauge_dan/overlay") or 0 - end - if self._gauge_overlay ~= 0 then - tex.draw_texture(self._gauge_overlay, { fade = 0.15 }) - end self.dan_info:draw_marker() end diff --git a/Scripts/background/bg_objects/dan_info.lua b/Scripts/background/bg_objects/dan_info.lua index a30aed4..8b94ba2 100644 --- a/Scripts/background/bg_objects/dan_info.lua +++ b/Scripts/background/bg_objects/dan_info.lua @@ -1,12 +1,11 @@ -- 段位道場 exam-panel extras only Lua can draw: the soul-gauge pass-threshold --- callout plate + captions, the white threshold marker on the threshold cell, and the gold --- zone past it (the gauge itself does not know the threshold), anchored on the gauge's own --- 50-cell grid. +-- callout plate + captions and the white threshold marker on the threshold cell, anchored +-- on the gauge's own 50-cell grid. It also hands the threshold (in cells) to the gauge script +-- (g_dan_gauge_border), which colours the track by it. local M = {} M.__index = M local GAUGE_Y = 248 -local CELL_TOP = 248 -- the cells' top (gauge_dan/1p_bar) local GAUGE_X0 = 738 -- cell 1 starts here local CELL_PITCH = 21 local CELL_COUNT = 50 @@ -36,7 +35,7 @@ local VALUE_OUTLINE = { 0, 0, 0, 255 } function M.new() return setmetatable({ state = nil, label = nil, label_for = nil, name_label = nil, plate = nil, plate_tried = false, - marker = nil, marker_tried = false, gold = nil }, M) + marker = nil, marker_tried = false }, M) end function M:plate_id() @@ -55,32 +54,6 @@ function M:marker_id() return self.marker end -function M:gold_ids() - if self.gold == nil then - local lit = tex.get_texture("game/dan_info/gauge_gold_cell") - local dark = tex.get_texture("game/dan_info/gauge_gold_unfilled") - self.gold = (lit and dark) and { lit = lit, dark = dark } or false - end - return self.gold or nil -end - --- The cells past the threshold, as on the cabinet: gold when filled, dark gold when not. --- Drawn in the gauge layer, over the engine's red cells. -function M:draw_gold_zone(n) - local g = self:gold_ids() - if not g or n >= CELL_COUNT then return end - local filled = math.floor((self.state.gauge or 0) / 2 + 1e-6) - for k = n + 1, CELL_COUNT do - tex.draw_texture(k <= filled and g.lit or g.dark, - { x = GAUGE_X0 + CELL_PITCH * (k - 1), y = CELL_TOP }) - end -end - --- Called from Background:handle_dan. -function M:handle(state) - self.state = state -end - local function gauge_exam(state) if not state or not state.exams then return nil end for _, e in ipairs(state.exams) do @@ -89,6 +62,14 @@ local function gauge_exam(state) return nil end +-- Called from Background:handle_dan. +function M:handle(state) + self.state = state + local ex = gauge_exam(state) + _G.g_dan_gauge_border = (ex and ex.red and ex.red > 0) + and math.max(1, math.min(CELL_COUNT, math.floor(ex.red / 2))) or nil +end + -- Called from Background:draw_fore(), i.e. after the whole GAME_DAN HUD. function M:draw() local st = self.state @@ -102,7 +83,6 @@ function M:draw() if n < 1 then n = 1 end -- border_0 == border_1 on the cabinet if n > CELL_COUNT then n = CELL_COUNT end -- dan.json may say >100 %; the cabinet cannot local x = GAUGE_X0 + CELL_PITCH * n - CELL_PITCH / 2 - 1 - self:draw_gold_zone(n) if self.label_for ~= ex.red then -- skin_config: dan_gauge_name (魂ゲージ) and dan_exam_text_gauge ("%s %以上", %% = %) diff --git a/Scripts/game/gauge.lua b/Scripts/game/gauge.lua index f659b97..4942b1a 100644 --- a/Scripts/game/gauge.lua +++ b/Scripts/game/gauge.lua @@ -4,6 +4,7 @@ -- length-1 (at length it left a dark gap cell before it) -- * the clear mark sits gauge_clear_mark_offset cells (skin_config: 1, the cell edge) before -- the exact clear fraction, not the parent's 87/60 +-- The dan gauge is drawn as the cabinet's tamashii_gauge (see draw_dan below). -- Everything else is the parent's file, loaded from its own copy. -- the parent skin's copy of a script: the second match on package.path (the first is this file) @@ -23,10 +24,21 @@ assert(load_parent("game/gauge"), "game/gauge: the parent skin has no gauge scri local function clamp(v, lo, hi) return math.max(lo, math.min(hi, v)) end local parent_new = Gauge.new -function Gauge.new(...) - local self = parent_new(...) +function Gauge.new(is_2p, dan, string_diff, opts) + local self = parent_new(is_2p, dan, string_diff, opts) local mark = tex.get_skin_config("gauge_clear_mark_offset") self.clear_mark_offset = mark and mark.x + if dan then + local screen = (opts and opts.screen) or "game" + local p = (opts and opts.player_str and (opts.player_str .. "_")) or (is_2p and "2p_" or "1p_") + local function t(name) return tex.get_texture(screen .. "/gauge_dan/" .. name) end + self.cab = { + track_red = t("track_red"), + lamp = t(p .. "lamp"), + lamp_clear = t("lamp_clear"), + fade_clear = t("bar_fade_clear"), + } + end return self end @@ -101,3 +113,62 @@ function Gauge:render(y, mirror, idx, points, previous_points, max_points, clear self:blit(self.tamashii_dark, nil, nil, y, nil, nil, nil, idx) end end + +-- The dan gauge as the cabinet's tamashii_gauge draws it: the gold track (border), the red +-- track (track_red, gauge_bg) up to the threshold, the lit cells as one lamp stretched 21 px +-- per cell (lamp_clear, yellow, once the gauge reaches the threshold), the glow on a newly lit +-- cell, the cell separators at the cabinet's 103/255, then 魂: grey, white once cleared, and +-- in flames at full. The threshold comes from the dan exam (background dan_info sets +-- g_dan_gauge_border, in cells); without it, or without the cabinet pieces, the parent draws. +local CAB_CELL = 21 +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, + 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 }) + end + end + + local length, solid, alpha, show_up = self:cells(points, previous_points, max_points, anim_active, anim_alpha) + local clear = length >= border + + layer(self.border) + if border > 0 then layer(cab.track_red, nil, CAB_TRACK * border - 160) end + if solid > 0 then layer(clear and cab.lamp_clear or cab.lamp, nil, CAB_CELL * solid - 8) end + + if is_rainbow and rainbow_fade >= 0 then + local frame_a = math.floor(rainbow_frac) % 8 + local frame_b = (frame_a + 1) % 8 + local f = rainbow_frac - math.floor(rainbow_frac) + layer(self.rainbow, nil, nil, rainbow_fade, frame_a) + layer(self.rainbow, nil, nil, rainbow_fade * f, frame_b) + end + + if show_up and length > 0 then + layer(clear and cab.fade_clear or self.bar_fade, (length - 1) * CAB_CELL, nil, alpha) + end + + layer(self.overlay, nil, nil, CAB_SEPARATOR) + + if is_rainbow then + layer(self.fire, nil, nil, nil, fire_frame, 0.75, true) + layer(self.tamashii) + if fire_frame == 0 or fire_frame == 1 or fire_frame == 4 or fire_frame == 5 then + layer(self.tamashii_overlay, nil, nil, 0.5) + end + elseif clear then + layer(self.tamashii) + else + layer(self.tamashii_dark) + end +end -- 2.54.0 From 48660a8b8721595ab294d2d0c23cd1be0ec7c7c5 Mon Sep 17 00:00:00 2001 From: TaikoZhong <108016253+GanYiZhong@users.noreply.github.com> Date: Wed, 14 Oct 2026 21:01:01 +0800 Subject: [PATCH 4/5] dan game: the soul gauge over the lane's top edge, as on the cabinet The engine draws the lane after the gauge, and the lane's black top edge (y 276) hid the cells' last six rows; the cabinet's gauge sits over it (cells down to y 281). The gauge leaves a redraw (g_dan_gauge_redraw) that the dan background's draw_fore repeats, clipped to that strip (y 276-288). Co-Authored-By: Claude Opus 5.5 --- Scripts/background/bg_collabs/dan.lua | 11 ++++++++++- Scripts/game/gauge.lua | 27 +++++++++++++++++++++------ 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Scripts/background/bg_collabs/dan.lua b/Scripts/background/bg_collabs/dan.lua index 26f5daa..615d9fb 100644 --- a/Scripts/background/bg_collabs/dan.lua +++ b/Scripts/background/bg_collabs/dan.lua @@ -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 diff --git a/Scripts/game/gauge.lua b/Scripts/game/gauge.lua index 4942b1a..df9d3d1 100644 --- a/Scripts/game/gauge.lua +++ b/Scripts/game/gauge.lua @@ -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 -- 2.54.0 From 97fa82924fee3e3726ad307ed37089e83160d746 Mon Sep 17 00:00:00 2001 From: TaikoZhong <108016253+GanYiZhong@users.noreply.github.com> Date: Wed, 14 Oct 2026 21:12:38 +0800 Subject: [PATCH 5/5] Dan gauge plate: uncropped art, value at the cabinet's size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The plate art had its top and left rows cut off, flattening the top of the 魂ゲージ pill. It is now the cabinet's whole plate (with its 9 px margin), drawn 9 px up and left so the layout constants stay put. The threshold caption is the cabinet's size 36, its centre moved up to match. Co-Authored-By: Claude Opus 5.5 --- Graphics/game/dan_info/gauge_border_plate.png | 4 ++-- Scripts/background/bg_objects/dan_info.lua | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Graphics/game/dan_info/gauge_border_plate.png b/Graphics/game/dan_info/gauge_border_plate.png index f532a2e..fc32ed4 100644 --- a/Graphics/game/dan_info/gauge_border_plate.png +++ b/Graphics/game/dan_info/gauge_border_plate.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:060e1ae8a3ffcdd68fdf642a80c86263295536652c41dbf76817aacd0c0128e9 -size 4548 +oid sha256:f17f353558be8f2c6e3a3be114c03611384c1475d292e8b38bd176e60299c953 +size 5771 diff --git a/Scripts/background/bg_objects/dan_info.lua b/Scripts/background/bg_objects/dan_info.lua index 8b94ba2..b2dbce6 100644 --- a/Scripts/background/bg_objects/dan_info.lua +++ b/Scripts/background/bg_objects/dan_info.lua @@ -13,15 +13,16 @@ local LABEL_SIZE = 30 -- arcade MS 明朝 36; ours reads local WHITE = { 255, 255, 255, 255 } local BLACK = { 0, 0, 0, 255 } -local PLATE_W, PLATE_H = 586, 60 +local PLATE_W, PLATE_H = 586, 60 -- the plate's grey body; the art adds a 9 px margin +local PLATE_ART_PAD = 9 -- (the pill's top/left edge and the drop shadow) local PLATE_GAP = 12 -- px between the plate's bottom and the bar top local PLATE_OVERHANG = 24 -- px the plate extends PAST the threshold local PILL_CX, PILL_CY = 150, 20 -- 魂ゲージ ink centre, plate-local local VALUE_RIGHT = 532 -- 100%以上 is RIGHT-aligned to this -local VALUE_CY = 39 -- its ink centre y, plate-local +local VALUE_CY = 35 -- its ink centre y, plate-local local NAME_SIZE = 26 -- arcade id 142 -local VALUE_SIZE = 30 -- arcade id 141 +local VALUE_SIZE = 36 -- arcade id 141 -- the threshold marker (gauge_border_cell): its white inside (x 7, y 7 in the art) lands on -- the threshold cell's left edge + 1, from y 238, as the cabinet's border_N @@ -103,7 +104,7 @@ function M:draw() local px = math.max(0, math.floor(x - PLATE_W + PLATE_OVERHANG + 0.5)) local py = GAUGE_Y - PLATE_GAP - PLATE_H if pid then - tex.draw_texture(pid, { x = px, y = py }) + tex.draw_texture(pid, { x = px - PLATE_ART_PAD, y = py - PLATE_ART_PAD }) end -- fail soft: with no plate art the two captions still draw, at the same places -- 2.54.0