Files
YataiDONNijiiro/Scripts/result/result_background.lua
T
2026-09-02 14:25:04 -04:00

40 lines
1.8 KiB
Lua

-- YataiDON-HSS: arcade result background (lumen 000_default/result/result_bg: main_mc "1p_l" / "2p").
--
-- ROUND 11: this is no longer one flat plate. `result_bg_layers.lua` draws the arcade's 14 layers
-- (2 sky halves, Mt Fuji, 11 drifting cloud bars) and the header band on top of them, off the
-- exported timeline `Scripts/anim/result_bg.lua`. The success ("clear") variant cross-fades in on
-- the same clock, driven by `__hss_result_bg_clear`, which `result_player.lua` publishes from the
-- same `fade_in_bottom` animation that draws `result/background/footer_1p` (now just the fireworks
-- and sparkles, since the clear sky / Fuji / clouds are live layers).
ResultBackground = {}
ResultBackground.__index = ResultBackground
-- FAIL SOFT: a broken layer module must not take the result screen down with it.
local ok_layers, Layers = pcall(require, "result/result_bg_layers")
if not ok_layers then Layers = nil end
function ResultBackground.new(player_num, width)
local self = setmetatable({}, ResultBackground)
self.player_num = player_num
self.width = width
__hss_result_bg_clear = 0.0 -- DAN_RESULT builds no ResultFadeIn, so reset here too
if Layers then
local ok, obj = pcall(Layers.new, player_num)
if ok then self.layers = obj end
end
if not self.layers then
-- last resort: the sky plate alone, static, exactly as rounds 2-10 drew it
self.t_bg = tex.load_texture(player_num == 3 and "result/background/background_2p"
or "result/background/background_1p")
end
return self
end
function ResultBackground:draw()
if self.layers then
self.layers:draw(1.0, __hss_result_bg_clear or 0.0)
elseif self.t_bg then
tex.draw_texture(self.t_bg)
end
end