33 lines
1.0 KiB
Lua
33 lines
1.0 KiB
Lua
-- YataiDON-HSS override of PyTaikoGreen/background/bg_objects/footer.lua
|
|
--
|
|
-- ROUND 60 (r60-collab-fix-all): the parent's Footer:draw() passes
|
|
-- tex.get_id("footer", index) straight to tex.draw_texture; when the collab
|
|
-- ships no footer folder (funassyi asks for footer index 2 but has no footer
|
|
-- art at all) get_id returns nil and the draw call raises a per-frame Lua
|
|
-- error, aborting the rest of that frame's draw_back. Same logic, nil-safe.
|
|
local Footer = {}
|
|
Footer.__index = Footer
|
|
|
|
function Footer.new(path, index)
|
|
local self = setmetatable({}, Footer)
|
|
self.path = path or "background"
|
|
self.index = (index ~= nil) and index or math.random(0, 2)
|
|
if self.index ~= -1 then
|
|
tex.load_folder(self.path, "footer")
|
|
end
|
|
return self
|
|
end
|
|
|
|
function Footer:draw()
|
|
if self.index == -1 then return end
|
|
local id = tex.get_id("footer", tostring(self.index))
|
|
if id then tex.draw_texture(id) end
|
|
end
|
|
|
|
function Footer:destroy()
|
|
if self.index == -1 then return end
|
|
tex.unload_folder(self.path, "footer")
|
|
end
|
|
|
|
return Footer
|