forked from Yonokid/YataiDONNijiiro
Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97fa82924f | ||
|
|
48660a8b87 | ||
|
|
287f8ffd67 | ||
|
|
e8ce3b3a7d | ||
|
|
a9bce590c5 | ||
|
|
2e00d1a0f5 | ||
|
|
ec5731e3bd | ||
|
|
c78383fdc1 | ||
|
|
a029b25b22 | ||
|
|
6b5ae8b5b5 | ||
|
|
afe0bab807 | ||
|
|
d10bd49613 | ||
|
|
20d8e142d5 | ||
|
|
3c9690b3fa | ||
|
|
00d8f8e3e1 |
No files matched your search
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"folder": {
|
||||
"x": -44,
|
||||
"y": 16
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -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.
@@ -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.
@@ -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.
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
@@ -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
@@ -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
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user