Compare commits

...
Author SHA1 Message Date
TaikoZhongandClaude Opus 5.5 97fa82924f Dan gauge plate: uncropped art, value at the cabinet's size
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 <noreply@anthropic.com>
2026-10-14 21:12:38 +08:00
TaikoZhongandClaude Opus 5.5 48660a8b87 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 <noreply@anthropic.com>
2026-10-14 21:01:01 +08:00
TaikoZhongandClaude Opus 5.5 287f8ffd67 dan game: the soul gauge drawn as the cabinet's tamashii_gauge
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 <noreply@anthropic.com>
2026-10-14 20:22:30 +08:00
TaikoZhongandClaude Opus 5.5 e8ce3b3a7d 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 <noreply@anthropic.com>
2026-10-14 19:33:42 +08:00
TaikoZhongandClaude Opus 5.5 a9bce590c5 dan game: soul gauge threshold marker, cell art and threshold caption
- 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 <noreply@anthropic.com>
2026-10-14 19:23:04 +08:00
TaikoZhongandClaude Opus 5.5 2e00d1a0f5 Keep checksums.sha256 in its previous line order
Same entries as the last commit; only the order is restored, with the new
paths appended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 15:15:14 +08:00
TaikoZhongandClaude Opus 5.5 ec5731e3bd Update checksums.sha256 for #63
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 15:14:23 +08:00
GanYiZhong c78383fdc1 Merge pull request 'dan select: back chip, chip names, cursor and course rows' (#63) from GanYiZhong/YataiDONNijiiro:feat/dan-select-back-chip into main 2026-10-14 09:13:47 +02:00
TaikoZhongandClaude Opus 5.5 a029b25b22 dan select: back chip, chip names, cursor and course rows (#53)
- Back entry: a chip in the top strip (back/folder, a light blue in the parent's back
  colour) with its label from skin_config dan_back_label, so it follows the language
  (ja 戻る, en Back, zh 返回, ko 뒤로).
- Chip names are black with no outline: dan_chip_name_black moves into screen.options,
  where the engine reads it.
- The selected chip drops below the strip and eases back; the cursor glow covers the
  chip and its name but not the clear stamp.
- Course rows: the 1st/2nd/3rd labels are centred on their row, and the level is one
  "star + number" image per level (yellow_box/difficulty_level, 1..10 and 10+) in place of
  the separate star and digits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 15:12:37 +08:00
TaikoZhongandClaude Opus 5.5 6b5ae8b5b5 Update checksums.sha256 for #62
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 12:56:25 +08:00
GanYiZhong afe0bab807 Merge pull request 'dan select: cabinet clear stamps, no parent ura badge' (#62) from GanYiZhong/YataiDONNijiiro:fix/dan-select-marks into main 2026-10-14 06:56:00 +02:00
TaikoZhongandClaude Opus 5.5 d10bd49613 dan select: cabinet clear stamps, no parent ura badge (#54, #55)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 12:55:40 +08:00
Yonokid 20d8e142d5 Update checksums.sha256 2026-10-13 23:59:04 -04:00
TaikoZhongandClaude Opus 5.5 3c9690b3fa Update checksums.sha256 for #60 and #61
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 11:17:00 +08:00
GanYiZhong 00d8f8e3e1 Merge pull request 'Losslessly recompress the PNGs stored uncompressed (385 MB -> 27 MB)' (#61) from GanYiZhong/YataiDONNijiiro:perf/recompress-pngs into main 2026-10-14 05:16:45 +02:00
33 changed files with 1214 additions and 764 deletions

No files matched your search

Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
{
"folder": {
"x": -44,
"y": 16
}
}
Binary file not shown.
Binary file not shown.
+4
View File
@@ -14,5 +14,9 @@
"arrow_l": {
"x": -95,
"y": 60
},
"clear_mark": {
"x": -39,
"y": 24
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+10 -1
View File
@@ -190,7 +190,7 @@
},
"song_label": {
"x": 430,
"y": 230
"y": 246
},
"exam_seg_label": {
"x": 0,
@@ -199,5 +199,14 @@
"exam_gauge_box": {
"x": 0,
"y": 0
},
"clear_mark": {
"x": 100,
"y": 505
},
"difficulty_ura": {},
"difficulty_level": {
"x": 538,
"y": 287
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+20
View File
@@ -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
}
}
Binary file not shown.
+14
View File
@@ -45,6 +45,7 @@
"combo_color_tiers": true,
"gauge_cell_fade_in": true,
"dan_exam_grid": true,
"dan_chip_name_black": true,
"disable_chara_3d": false
}
},
@@ -833,6 +834,19 @@
"height": 88,
"font_size": 42
},
"dan_back_label": {
"x": 0,
"y": 89,
"width": 60,
"height": 88,
"font_size": 42,
"text": {
"en": "Back",
"ja": "戻る",
"zh": "返回",
"ko": "뒤로"
}
},
"dan_result_chara": {
"x": 187,
"y": 934
+10 -6
View File
@@ -155,14 +155,18 @@ function DanBackground:draw_back()
self.chibi:draw()
end
-- dan soul gauge separator overlay (static, drawn at a hardcoded fade).
-- 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()
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 })
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
-- dan condition plate, drawn in the gauge's own layer.
+40 -8
View File
@@ -1,5 +1,7 @@
-- 段位道場 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. 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
@@ -11,23 +13,30 @@ 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 = 22 -- 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 = 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
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
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,9 +47,12 @@ function M:plate_id()
return self.plate
end
-- Called from Background:handle_dan.
function M:handle(state)
self.state = state
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
local function gauge_exam(state)
@@ -51,6 +63,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
@@ -84,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
@@ -103,4 +123,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
+196 -5
View File
@@ -47,12 +47,14 @@ function DanSelect.new()
end
-- pos: selected chip x (the textures' own json positions carry the rest);
-- now_ms: engine clock; moved_ms: ms since the last ribbon step (-1 = never).
local function draw_cursor(self, pos, now_ms, moved_ms)
-- now_ms: engine clock; moved_ms: ms since the last ribbon step (-1 = never);
-- y: how far the selected chip has dropped (see draw_box below).
local function draw_cursor(self, pos, now_ms, moved_ms, y)
y = y or 0
if self.t_cursor then
local f = (now_ms * 0.06) % 60
local a = CUR:get("#259@0", f, "a") or 1
tex.draw_texture(self.t_cursor, { x = pos, fade = a })
tex.draw_texture(self.t_cursor, { x = pos, y = y, fade = a })
end
if moved_ms and moved_ms >= 0 then
local f = moved_ms * 0.06
@@ -61,10 +63,10 @@ local function draw_cursor(self, pos, now_ms, moved_ms)
local a = ARW:get("#261@0", f, "a") or 0
if a > 0 then
if self.t_arrow_r then
tex.draw_texture(self.t_arrow_r, { x = pos + drift, fade = a })
tex.draw_texture(self.t_arrow_r, { x = pos + drift, y = y, fade = a })
end
if self.t_arrow_l then
tex.draw_texture(self.t_arrow_l, { x = pos - drift, fade = a })
tex.draw_texture(self.t_arrow_l, { x = pos - drift, y = y, fade = a })
end
end
end
@@ -72,3 +74,192 @@ local function draw_cursor(self, pos, now_ms, moved_ms)
end
if HAS_CLIPS then DanSelect.draw_cursor = draw_cursor end
-- The level is the cabinet's own art, one "star + number" image per level
-- (yellow_box/difficulty_level, frames 1..10 and 10+), in place of the parent's star and
-- level digits, which are held back.
local function draw_level(level, x, y, f)
local id = tex.get_texture("dan_select/yellow_box/difficulty_level")
if not id or level < 1 then return end
tex.draw_texture(id, { frame = math.min(level, 11) - 1, x = x, y = y, fade = f })
end
-- The course's clear stamp (yellow_box/clear_mark) sits over the dan plate and Don, as the
-- cabinet's stamp_detail does (it is above don_1p). The parent draws it with the box, under
-- both, so it is held back there and drawn with the title, which the engine draws after
-- the chara and the nameplate.
local parent_open, parent_title = DanSelect.draw_dan_open, DanSelect.draw_title
local held_stamp -- shared: the boxes and the title can be drawn through different instances
if parent_open then
function DanSelect:draw_dan_open(box)
local stamp = tex.get_texture("dan_select/yellow_box/clear_mark")
local level = tex.get_texture("dan_select/yellow_box/difficulty_level")
local hide = {}
if level then
for _, n in ipairs({ "difficulty_star", "difficulty_num", "difficulty_x" }) do
local t = tex.get_texture("dan_select/yellow_box/" .. n)
if t then hide[#hide + 1] = t end
end
end
local draw = tex.draw_texture
tex.draw_texture = function(id, p)
if id == stamp then return end
for _, t in ipairs(hide) do -- handles compare with ==, not as table keys
if id == t then return end
end
return draw(id, p)
end
local ok, err = pcall(parent_open, self, box)
tex.draw_texture = draw
if not ok then error(err, 0) end
local f = box.open_fade.attribute
local off = tex.get_skin_config("dan_yellow_box_offset") or { x = 0, y = 0 }
if level then
for i = 0, box:song_count() - 1 do
draw_level(box:song_level(i), i * (off.x or 0), i * (off.y or 0), f)
end
end
if stamp and box.clear_mark > 0 then
held_stamp = { id = stamp, frame = box.clear_mark - 1, fade = f }
end
end
function DanSelect:draw_title()
if parent_title then parent_title(self) end
local s = held_stamp
held_stamp = nil
if s then tex.draw_texture(s.id, { frame = s.frame, fade = s.fade }) end
end
end
-- The back entry is one more chip in the top strip (back/folder, laid out like box/folder);
-- the parent's opening board is its own layout, so nothing opens under it here.
-- Its label comes from skin_config dan_back_label, so it follows the language setting. It is set
-- like the dan chip names (black, no outline: dan_chip_name_black), vertical for CJK and
-- across, squeezed to the chip, for other languages.
local CJK = { ja = true, zh = true, ko = true, tw = true, cn = true }
local back_label
local function get_back_label()
if back_label == nil then
local cfg = tex.get_skin_config("dan_back_label")
if not cfg then back_label = false; return false end
local lang = tex.language()
local vertical = CJK[lang] or CJK[lang:sub(1, 2)] or false
back_label = {
cfg = cfg,
vertical = vertical,
main = text.create_raw_text(tex.skin_text("dan_back_label"), cfg.font_size,
{ 0, 0, 0, 255 }, { 0, 0, 0, 255 }, vertical, 0, 2),
}
end
return back_label
end
local function draw_back_label(bx, fade, y)
local label = get_back_label()
if not label then return end
local cfg, main = label.cfg, label.main
local sx, sy = 1, 1
if label.vertical then
sy = math.min(1, cfg.height / main.height)
else
sx = math.min(1, cfg.width / main.width) -- width: chip face less the border
end
local w, h = main.width * sx, main.height * sy
main:draw({ x = bx + cfg.x - w / 2, y = cfg.y + (cfg.height - h) / 2 + y,
x2 = w - main.width, y2 = h - main.height, fade = fade })
end
-- The selected chip drops below the strip, as the cabinet's does, easing there and back.
-- Only draw_cursor (called after every box) is told where the cursor is, so the boxes are
-- held back in draw_box and drawn from draw_cursor.
local SELECTED_DROP = 22
local DROP_MS = 60 -- time constant of the ease
local drop = {} -- chip key -> current drop
local held_boxes = {}
local last_ms
local function chip_key(box)
return box.is_back and "\0back" or box.text_name
end
local function chip_drop(box)
return drop[chip_key(box)] or 0
end
local function draw_chip_name(box, bx, y, fade)
local name = box:chip_name()
if not name then return end
local nb = tex.get_skin_config("dan_chip_name") or { x = 0, y = 0 }
name:draw({
x = bx + nb.x - name.width / 2,
y = nb.y + y,
y2 = math.min(name.height, nb.height or name.height) - name.height,
fade = fade,
})
end
-- the chip as the parent draws it (folder, stamp, name), at its drop
function DanSelect:draw_dan_closed(box)
local bx, fade, y = box:box_x(), box.fade.attribute, chip_drop(box)
local id = tex.get_texture("dan_select/box/folder")
if id then tex.draw_texture(id, { frame = box.dan_color, x = bx, y = y, fade = fade }) end
local mark = box.clear_mark > 0 and tex.get_texture("dan_select/box/clear_mark")
if mark then tex.draw_texture(mark, { frame = box.clear_mark - 1, x = bx, y = y, fade = fade }) end
draw_chip_name(box, bx, y, fade)
end
function DanSelect:draw_back_box(box)
local bx, fade, y = box:box_x(), box.fade.attribute, chip_drop(box)
local id = tex.get_texture("dan_select/back/folder")
if id then tex.draw_texture(id, { x = bx, y = y, fade = fade }) end
draw_back_label(bx, fade, y)
end
-- The cursor's glow goes over the chip, its emblem and name (they grey under it, as on the
-- cabinet) but not over the clear stamp, which is drawn again on top of it.
local function draw_chip_front(box)
if box.is_back or box.clear_mark <= 0 then return end
local mark = tex.get_texture("dan_select/box/clear_mark")
if mark then
tex.draw_texture(mark, { frame = box.clear_mark - 1, x = box:box_x(), y = chip_drop(box),
fade = box.fade.attribute })
end
end
local parent_draw_box = DanSelect.draw_box
function DanSelect:draw_box(box)
held_boxes[#held_boxes + 1] = box
end
local cursor_parent = DanSelect.draw_cursor
function DanSelect:draw_cursor(pos, now_ms, moved_ms)
local boxes = held_boxes
held_boxes = {}
local k = last_ms and math.min(1, math.max(0, now_ms - last_ms) / DROP_MS) or 1
last_ms = now_ms
local selected
for _, box in ipairs(boxes) do
local key = chip_key(box)
local is_sel = math.abs(box:box_x() - pos) < 1
if is_sel then selected = box end
local d = drop[key] or 0
d = d + ((is_sel and SELECTED_DROP or 0) - d) * k
drop[key] = (math.abs(d) >= 0.05) and d or nil
end
-- draw every box even if one fails, then report the first failure
local err
for _, box in ipairs(boxes) do
local ok, e = pcall(parent_draw_box, self, box)
if not ok and not err then err = e end
end
if err then error(err, 0) end
local y = selected and chip_drop(selected) or 0
if cursor_parent then
cursor_parent(self, pos, now_ms, moved_ms, y)
elseif self.t_cursor then
tex.draw_texture(self.t_cursor, { x = pos, y = y })
end
if selected then draw_chip_front(selected) end
return true
end
+88 -2
View File
@@ -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,77 @@ 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
-- 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 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
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
+758 -740
View File
File diff suppressed because it is too large. Load diff