Background: the collab backgrounds PyTaikoGreen added after background.lua was forked #40

Merged
Yonokid merged 3 commits from GanYiZhong/YataiDONNijiiro:fix/collab-backgrounds into main 2026-09-30 21:55:00 +02:00
2 changed files with 255 additions and 0 deletions

No files matched your search

+55
View File
@@ -23,6 +23,34 @@ local FunassyiBackground = require("background/bg_collabs/funassyi")
local ImasBackground = require("background/bg_collabs/imas") local ImasBackground = require("background/bg_collabs/imas")
local ImasSidemBackground = require("background/bg_collabs/imas_sidem") local ImasSidemBackground = require("background/bg_collabs/imas_sidem")
local OshiriBackground = require("background/bg_collabs/oshiri") local OshiriBackground = require("background/bg_collabs/oshiri")
-- the collabs PyTaikoGreen added after this file was forked (2026-09-07/09): Green's modules
local DQ10Background = require("background/bg_collabs/dq10")
local GbBackground = require("background/bg_collabs/gb")
local GmtBackground = require("background/bg_collabs/gmt")
local GumiBackground = require("background/bg_collabs/gumi")
local I7id7Background = require("background/bg_collabs/i7id7")
local I7natsuBackground = require("background/bg_collabs/i7natsu")
local I7revBackground = require("background/bg_collabs/i7rev")
local I7triBackground = require("background/bg_collabs/i7tri")
local IaBackground = require("background/bg_collabs/ia")
local KobayashiBackground = require("background/bg_collabs/kobayashi")
local KumamonBackground = require("background/bg_collabs/kumamon")
local LoveliveBackground = require("background/bg_collabs/lovelive")
local MarioBackground = require("background/bg_collabs/mario")
local Mh3GBackground = require("background/bg_collabs/mh3G")
local Mh3rdBackground = require("background/bg_collabs/mh3rd")
local MikuBackground = require("background/bg_collabs/miku")
local MomocloBackground = require("background/bg_collabs/momoclo")
local PzdBackground = require("background/bg_collabs/pzd")
local TohoBackground = require("background/bg_collabs/toho")
local TonkatsudjBackground = require("background/bg_collabs/tonkatsudj")
local ToukenBackground = require("background/bg_collabs/touken")
local YmckBackground = require("background/bg_collabs/ymck")
local YokaiBackground = require("background/bg_collabs/yokai")
local YokaiHatsukoiBackground = require("background/bg_collabs/yokai_hatsukoi")
local YokaiMatsuriBackground = require("background/bg_collabs/yokai_matsuri")
local YokaiTokorotenBackground = require("background/bg_collabs/yokai_tokoroten")
local YokaiYougotaBackground = require("background/bg_collabs/yokai_yougota")
local COLLABS = { local COLLABS = {
PRACTICE = { PracticeBackground.new, nil, 1 }, PRACTICE = { PracticeBackground.new, nil, 1 },
@@ -37,6 +65,33 @@ local COLLABS = {
IMAS_ML = { ImasBackground.new, "background/collab/imas_ml", 3 }, IMAS_ML = { ImasBackground.new, "background/collab/imas_ml", 3 },
IMAS_SIDEM = { ImasSidemBackground.new, "background/collab/imas_sidem", 3 }, IMAS_SIDEM = { ImasSidemBackground.new, "background/collab/imas_sidem", 3 },
OSHIRI = { OshiriBackground.new, "background/collab/oshiri", 5 }, OSHIRI = { OshiriBackground.new, "background/collab/oshiri", 5 },
DQ10 = { DQ10Background.new, "background/collab/dq10", 5 },
GB = { GbBackground.new, "background/collab/gb", 5 },
GMT = { GmtBackground.new, "background/collab/gmt", 5 },
GUMI = { GumiBackground.new, "background/collab/gumi", 5 },
I7ID7 = { I7id7Background.new, "background/collab/i7id7", 5 },
I7NATSU = { I7natsuBackground.new, "background/collab/i7natsu", 5 },
I7REV = { I7revBackground.new, "background/collab/i7rev", 5 },
I7TRI = { I7triBackground.new, "background/collab/i7tri", 5 },
IA = { IaBackground.new, "background/collab/ia", 5 },
KOBAYASHI = { KobayashiBackground.new, "background/collab/kobayashi", 5 },
KUMAMON = { KumamonBackground.new, "background/collab/kumamon", 5 },
LOVELIVE = { LoveliveBackground.new, "background/collab/lovelive", 5 },
MARIO = { MarioBackground.new, "background/collab/mario", 5 },
MH3G = { Mh3GBackground.new, "background/collab/mh3G", 5 },
MH3RD = { Mh3rdBackground.new, "background/collab/mh3rd", 5 },
MIKU = { MikuBackground.new, "background/collab/miku", 5 },
MOMOCLO = { MomocloBackground.new, "background/collab/momoclo", 5 },
PZD = { PzdBackground.new, "background/collab/pzd", 5 },
TOHO = { TohoBackground.new, "background/collab/toho", 5 },
TONKATSUDJ = { TonkatsudjBackground.new, "background/collab/tonkatsudj", 1 },
TOUKEN = { ToukenBackground.new, "background/collab/touken", 5 },
YMCK = { YmckBackground.new, "background/collab/ymck", 5 },
YOKAI = { YokaiBackground.new, "background/collab/yokai", 5 },
YOKAI_HATSUKOI = { YokaiHatsukoiBackground.new, "background/collab/yokai_hatsukoi", 5 },
YOKAI_MATSURI = { YokaiMatsuriBackground.new, "background/collab/yokai_matsuri", 5 },
YOKAI_TOKOROTEN = { YokaiTokorotenBackground.new, "background/collab/yokai_tokoroten", 5 },
YOKAI_YOUGOTA = { YokaiYougotaBackground.new, "background/collab/yokai_yougota", 5 },
} }
Background = {} Background = {}
+200
View File
@@ -0,0 +1,200 @@
-- YataiDONNijiiro: PyTaikoGreen's bg_collabs/gumi.lua, with GumiDonBG filling in PyTaikoGreen's
-- DonBG6 fields (this skin overrides donbg/6).
local DonBG6 = require("background/bg_objects/donbg/6")
local Fever = require("background/bg_objects/fever")
local Footer = require("background/bg_objects/footer")
local Dancer = require("background/bg_objects/dancer")
local RendaController = require("background/bg_objects/renda")
local ChibiController = require("background/bg_objects/chibi")
local COLLAB_PATH = "background/collab/gumi"
local MAX_DANCERS = 5
local GumiDonBG = setmetatable({}, { __index = DonBG6 })
GumiDonBG.__index = GumiDonBG
function GumiDonBG.new(index, player_num, path)
local self = setmetatable({}, GumiDonBG)
local base = DonBG6.new(index, player_num, path)
for k, v in pairs(base) do self[k] = v end
-- this skin's donbg/6 is its own (a static band) and leaves out what PyTaikoGreen's DonBG6
-- sets for the scrolling overlays that draw_textures below uses
self.overlay_move = self.overlay_move or tex.get_animation(2)
self.overlay_1_texture = self.overlay_1_texture or tex.get_texture_info(self.name, "overlay_1")
self.overlay_2_texture = self.overlay_2_texture or tex.get_texture_info(self.name, "overlay_2")
self._id_overlay_1 = self._id_overlay_1 or tex.get_texture(self.path .. "/" .. self.name .. "/" .. "overlay_1") or 0
self._id_overlay_2 = self._id_overlay_2 or tex.get_texture(self.path .. "/" .. self.name .. "/" .. "overlay_2") or 0
return self
end
function GumiDonBG:update(current_time_ms)
DonBG6.update(self, current_time_ms)
if self.overlay_move then self.overlay_move:update(current_time_ms) end
end
function GumiDonBG:draw_textures(fade, y, frame)
for i = 0, 4 do
tex.draw_texture(self._id_bg, {
frame = frame,
fade = fade,
x = (i * self.bg_texture.width) + self.move.attribute,
y = y
})
end
for i = 0, 5, 2 do
tex.draw_texture(self._id_overlay_1, {
frame = frame,
fade = fade,
x = (i * self.overlay_1_texture.width) + self.move.attribute * 3,
y = y
})
end
for i = 0, 4 do
tex.draw_texture(self._id_overlay_2, {
frame = frame,
fade = fade,
x = (i * self.overlay_2_texture.width) + self.move.attribute,
y = self.overlay_move.attribute + y
})
end
end
local GumiBGNormal = {}
GumiBGNormal.__index = GumiBGNormal
function GumiBGNormal.new()
local self = setmetatable({}, GumiBGNormal)
self.name = "bg_0"
tex.load_folder(COLLAB_PATH, "bg_normal/" .. self.name)
local bg_info = tex.get_texture_info(self.name, "background")
local frames = (bg_info and bg_info.frame_count) or 1
local textures = {}
for i = 0, frames - 1 do
table.insert(textures, { i * 500, (i + 1) * 500, i })
end
self.letter_cycle = anim.texture_change(frames * 500, textures, { loop = true })
self.letter_cycle:start()
self._id_bg = tex.get_texture(COLLAB_PATH .. "/" .. self.name .. "/" .. "background") or 0
return self
end
function GumiBGNormal:update(current_time_ms) self.letter_cycle:update(current_time_ms) end
function GumiBGNormal:draw()
tex.draw_texture(self._id_bg, { frame = self.letter_cycle.attribute })
end
function GumiBGNormal:destroy() tex.unload_folder(COLLAB_PATH, "bg_normal/" .. self.name) end
local GumiBGFever = {}
GumiBGFever.__index = GumiBGFever
function GumiBGFever.new()
local self = setmetatable({}, GumiBGFever)
self.name = "bg_fever_0"
tex.load_folder(COLLAB_PATH, "bg_fever/" .. self.name)
self.transitioned = false
self._id_bg = tex.get_texture(COLLAB_PATH .. "/" .. self.name .. "/" .. "background") or 0
return self
end
function GumiBGFever:start() end
function GumiBGFever:update(current_time_ms) end
function GumiBGFever:draw() tex.draw_texture(self._id_bg) end
function GumiBGFever:destroy() tex.unload_folder(COLLAB_PATH, "bg_fever/" .. self.name) end
-- Background
local GumiBackground = {}
GumiBackground.__index = GumiBackground
function GumiBackground.new(player_num, bpm)
local self = setmetatable({}, GumiBackground)
self.donbg = GumiDonBG.new(1, player_num, COLLAB_PATH)
self.bg_normal = GumiBGNormal.new()
self.bg_fever = GumiBGFever.new()
self.footer = Footer.new(COLLAB_PATH, -1)
self.fever = Fever.create(0, bpm, COLLAB_PATH)
self.dancer = Dancer.BaseDancerGroup.new(0, bpm, MAX_DANCERS, COLLAB_PATH)
for i, d in ipairs(self.dancer.dancers) do
if d.index == 4 then
self.dancer.dancers[i], self.dancer.dancers[1] = self.dancer.dancers[1], self.dancer.dancers[i]
break
end
end
self.renda = RendaController.new(COLLAB_PATH, 0)
self.chibi = ChibiController.new(bpm, COLLAB_PATH, 1)
self.is_clear = false
self.is_rainbow = false
self.last_milestone = 1
return self
end
function GumiBackground:update(current_ms, bpm)
self.donbg:update(current_ms)
self.bg_normal:update(current_ms)
self.fever:update(current_ms, bpm)
self.dancer:update(current_ms, bpm)
self.renda:update(current_ms)
self.chibi:update(current_ms, bpm)
end
function GumiBackground:handle_good(player_num) self.chibi:add_chibi(player_num, false) end
function GumiBackground:handle_ok(player_num) self.chibi:add_chibi(player_num, false) end
function GumiBackground:handle_bad(player_num) self.chibi:add_chibi(player_num, true) end
function GumiBackground:handle_drumroll(player_num) self.renda:add_renda() end
function GumiBackground:handle_balloon(player_num) self.renda:add_renda() end
function GumiBackground:handle_gauge(player_num, progress, is_clear, is_rainbow)
self.donbg:set_clear(is_clear)
if is_rainbow and not self.is_rainbow then self.fever:start() end
self.is_clear = is_clear
self.is_rainbow = is_rainbow
local current_milestone
if is_clear then
current_milestone = MAX_DANCERS
else
current_milestone = math.min(MAX_DANCERS - 1, math.floor(progress * MAX_DANCERS))
end
if current_milestone > self.last_milestone then
for _ = 1, current_milestone - self.last_milestone do self.dancer:add_dancer() end
self.last_milestone = current_milestone
elseif current_milestone < self.last_milestone then
for _ = 1, self.last_milestone - current_milestone do self.dancer:remove_dancer() end
self.last_milestone = current_milestone
end
end
function GumiBackground:draw_back()
if self.is_clear then
self.bg_fever:draw()
else
self.bg_normal:draw()
end
self.donbg:draw()
self.renda:draw()
self.dancer:draw()
self.footer:draw()
if self.is_rainbow then self.fever:draw() end
self.chibi:draw()
end
function GumiBackground:draw_fore() end
function GumiBackground:destroy()
self.donbg:destroy()
self.bg_normal:destroy()
self.bg_fever:destroy()
self.fever:destroy()
self.dancer:destroy()
self.footer:destroy()
self.renda:destroy()
self.chibi:destroy()
end
return GumiBackground