Rewrote ScreenCredits to move StepMania credits to Scripts/04 CreditsHelpers.lua and provide an API for adding sections so that themers don't have toe duplicate stepmania credits to theme the screen.
This commit is contained in:
@@ -1,156 +1,49 @@
|
|||||||
local function Fooled()
|
-- To add a section to the credits, use the following:
|
||||||
local phrases = {
|
-- local theme_credits= {
|
||||||
"hornswaggled",
|
-- name= "Theme Credits", -- the name of your section
|
||||||
"bamboozled",
|
-- "Me", -- The people you want to list in your section.
|
||||||
"hoodwinked",
|
-- "Myself",
|
||||||
"swindled",
|
-- "My other self",
|
||||||
"duped",
|
-- {logo= "pro_dude", name= "Pro self"}, -- Someone who has a logo image.
|
||||||
"hoaxed",
|
-- -- This logo image would be "Graphics/CreditsLogo pro_dude.png".
|
||||||
"fleeced",
|
-- }
|
||||||
"shafted",
|
-- StepManiaCredits.AddSection(theme_credits)
|
||||||
"caboodled",
|
--
|
||||||
"beguiled",
|
-- If you want to add your section after an existing section, use the following:
|
||||||
"finagled",
|
-- StepManiaCredits.AddSection(theme_credits, 7)
|
||||||
"two-timed",
|
--
|
||||||
"suckered",
|
-- Or position can be the name of a section to insert after:
|
||||||
"flimflammed"
|
-- StepManiaCredits.AddSection(theme_credits, "Special Thanks")
|
||||||
}
|
--
|
||||||
return phrases[math.random(#phrases)]
|
-- Or if you want to add your section before a section:
|
||||||
end
|
-- StepManiaCredits.AddSection(theme_credits, "Special Thanks", true)
|
||||||
|
|
||||||
local ssc = {
|
-- StepManiaCredits is defined in _fallback/Scripts/04 CreditsHelpers.lua.
|
||||||
"AJ Kelly as freem",
|
|
||||||
"Jonathan Payne (Midiman)",
|
|
||||||
"Colby Klein (shakesoda)",
|
|
||||||
}
|
|
||||||
|
|
||||||
local sm_ssc = {
|
|
||||||
"Jason Felds (wolfman2000)", -- Timing Segments, Split Timing, optimization
|
|
||||||
"Thai Pangsakulyanont (theDtTvB)", -- BMS, Split Timing, optimization
|
|
||||||
"Alberto Ramos (Daisuke Master)",
|
|
||||||
"Jack Walstrom (FSX)",
|
|
||||||
}
|
|
||||||
|
|
||||||
local stepmania = {
|
|
||||||
"Chris Danford",
|
|
||||||
"Glenn Maynard",
|
|
||||||
"Steve Checkoway",
|
|
||||||
-- and various other contributors
|
|
||||||
}
|
|
||||||
|
|
||||||
local oitg = {
|
|
||||||
"infamouspat",
|
|
||||||
"Mark Cannon (vyhd)",
|
|
||||||
}
|
|
||||||
|
|
||||||
local contrib = {
|
|
||||||
"Aldo Fregoso (Aldo_MX)", -- delays and much more. StepMania AMX creator
|
|
||||||
"A.C/@waiei", -- custom scoring fixes + Hybrid scoring
|
|
||||||
"cerbo", -- lua bindings and other fun stuff
|
|
||||||
"cesarmades", -- pump/cmd* noteskins
|
|
||||||
"Chris Eldridge (kurisu)", -- dance-threepanel stepstype support
|
|
||||||
"Christophe Goulet-LeBlanc (Kommisar)", -- songs
|
|
||||||
"corec", -- various fixes
|
|
||||||
"cybik", -- Android port
|
|
||||||
"galopin", -- piu PlayStation2 usb mat support
|
|
||||||
"gholms", -- automake 1.11 support
|
|
||||||
"juanelote", -- SongManager:GetSongGroupByIndex, JumpToNext/PrevGroup logic mods
|
|
||||||
"Kaox", -- pump/default noteskin
|
|
||||||
"Kyzentun",
|
|
||||||
"Mad Matt",
|
|
||||||
"NitroX72", -- pump/frame noteskin
|
|
||||||
"Petriform", -- default theme music
|
|
||||||
"桜為小鳩/Sakurana-Kobato (@sakuraponila)", -- custom scoring fixes
|
|
||||||
"Samuel Kim (1a2a3a2a1a)", -- various beat mode fixes
|
|
||||||
"hanubeki (@803832)", -- beginner helper fix, among various other things
|
|
||||||
"v1toko", -- x-mode from StepNXA
|
|
||||||
"Alfred Sorenson", -- new lua bindings
|
|
||||||
}
|
|
||||||
|
|
||||||
local translators = {
|
|
||||||
"John Reactor (Polish)",
|
|
||||||
"DHalens (Spanish)",
|
|
||||||
"@Niler_jp (Japanese)",
|
|
||||||
"Deamon007 (Dutch)"
|
|
||||||
}
|
|
||||||
|
|
||||||
local thanks = {
|
|
||||||
"A Pseudonymous Coder", -- support
|
|
||||||
"Bill Shillito (DM Ashura)", -- Music (not yet though)
|
|
||||||
"cpubasic13", -- testing (a lot)
|
|
||||||
"Dreamwoods",
|
|
||||||
"Jason Bolt (LightningXCE)",
|
|
||||||
"Jousway", -- Noteskins
|
|
||||||
"Luizsan", -- creator of Delta theme
|
|
||||||
"Matt1360", -- Automake magic + oitg bro
|
|
||||||
"Renard",
|
|
||||||
"Ryan McKanna (Plaguefox)",
|
|
||||||
"Sta Kousin", --help with Japanese bug reports
|
|
||||||
}
|
|
||||||
|
|
||||||
local shoutout = {
|
|
||||||
"The Lua team", -- lua project lead or some shit. super nerdy but oh hell.
|
|
||||||
"Mojang AB", -- minecraft forever -freem
|
|
||||||
"Wolfire Games", -- piles of inspiration
|
|
||||||
"NAKET Coder",
|
|
||||||
"Ciera Boyd", -- you bet your ass I'm putting my girlfriend in the credits
|
|
||||||
--Image(), -- we should have some logos probably to look super pro
|
|
||||||
"#KBO",
|
|
||||||
"Celestia Radio", -- LOVE AND TOLERANCE
|
|
||||||
"You showed us... your ultimate dance",
|
|
||||||
}
|
|
||||||
|
|
||||||
local copyright = {
|
|
||||||
"StepMania is released under the terms of the MIT license.",
|
|
||||||
"If you paid for the program you've been " .. Fooled() .. ".",
|
|
||||||
"All content is the sole property of their respectful owners."
|
|
||||||
}
|
|
||||||
|
|
||||||
local sections = {
|
|
||||||
{ "the spinal shark collective (project lead)", ssc },
|
|
||||||
{ "sm-ssc Team", sm_ssc },
|
|
||||||
{ "StepMania Team", stepmania },
|
|
||||||
{ "OpenITG Team", oitg },
|
|
||||||
{ "Translators", translators },
|
|
||||||
{ "Other Contributors", contrib },
|
|
||||||
{ "Special Thanks", thanks },
|
|
||||||
{ "Shoutouts", shoutout },
|
|
||||||
{ "Copyright", copyright },
|
|
||||||
}
|
|
||||||
|
|
||||||
-- To add people or sections modify the above.
|
|
||||||
|
|
||||||
local lineOn = cmd(zoom,0.875;strokecolor,color("#444444");shadowcolor,color("#444444");shadowlength,3)
|
local lineOn = cmd(zoom,0.875;strokecolor,color("#444444");shadowcolor,color("#444444");shadowlength,3)
|
||||||
local sectionOn = cmd(diffuse,color("#88DDFF");strokecolor,color("#446688");shadowcolor,color("#446688");shadowlength,3)
|
local sectionOn = cmd(diffuse,color("#88DDFF");strokecolor,color("#446688");shadowcolor,color("#446688");shadowlength,3)
|
||||||
local item_padding_start = 4;
|
local item_padding_start = 4;
|
||||||
|
local line_height= 30
|
||||||
|
-- Tell the credits table the line height so it can use it for logo sizing.
|
||||||
|
StepManiaCredits.SetLineHeight(line_height)
|
||||||
|
|
||||||
local creditScroller = Def.ActorScroller {
|
local creditScroller = Def.ActorScroller {
|
||||||
SecondsPerItem = 0.5;
|
SecondsPerItem = 0.5;
|
||||||
NumItemsToDraw = 40;
|
NumItemsToDraw = 40;
|
||||||
TransformFunction = function( self, offset, itemIndex, numItems)
|
TransformFunction = function( self, offset, itemIndex, numItems)
|
||||||
self:y(30*offset)
|
self:y(line_height*offset)
|
||||||
end;
|
end;
|
||||||
OnCommand = cmd(scrollwithpadding,item_padding_start,15);
|
OnCommand = cmd(scrollwithpadding,item_padding_start,15);
|
||||||
}
|
}
|
||||||
|
|
||||||
local function AddLine( text, command )
|
|
||||||
local text = Def.ActorFrame{
|
|
||||||
LoadFont("Common normal")..{
|
|
||||||
Text = text or "";
|
|
||||||
OnCommand = command or lineOn;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
table.insert( creditScroller, text )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Add sections with padding.
|
-- Add sections with padding.
|
||||||
for section in ivalues(sections) do
|
for section in ivalues(StepManiaCredits.Get()) do
|
||||||
AddLine( section[1], sectionOn )
|
StepManiaCredits.AddLineToScroller(creditScroller, section.name, sectionOn)
|
||||||
for name in ivalues(section[2]) do
|
for name in ivalues(section) do
|
||||||
AddLine( name )
|
StepManiaCredits.AddLineToScroller(creditScroller, name)
|
||||||
end
|
end
|
||||||
AddLine()
|
StepManiaCredits.AddLineToScroller(creditScroller)
|
||||||
AddLine()
|
StepManiaCredits.AddLineToScroller(creditScroller)
|
||||||
end
|
end
|
||||||
|
|
||||||
creditScroller.BeginCommand=function(self)
|
creditScroller.BeginCommand=function(self)
|
||||||
|
|||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,280 @@
|
|||||||
|
local function Fooled()
|
||||||
|
local phrases = {
|
||||||
|
"hornswaggled",
|
||||||
|
"bamboozled",
|
||||||
|
"hoodwinked",
|
||||||
|
"swindled",
|
||||||
|
"duped",
|
||||||
|
"hoaxed",
|
||||||
|
"fleeced",
|
||||||
|
"shafted",
|
||||||
|
"caboodled",
|
||||||
|
"beguiled",
|
||||||
|
"finagled",
|
||||||
|
"two-timed",
|
||||||
|
"suckered",
|
||||||
|
"flimflammed",
|
||||||
|
"generous"
|
||||||
|
}
|
||||||
|
return phrases[math.random(#phrases)]
|
||||||
|
end
|
||||||
|
|
||||||
|
local line_height= 30 -- so that actor logos can use it.
|
||||||
|
|
||||||
|
local stepmania_credits= {
|
||||||
|
{
|
||||||
|
name= "the spinal shark collective (project lead)",
|
||||||
|
"AJ Kelly as freem",
|
||||||
|
"Jonathan Payne (Midiman)",
|
||||||
|
"Colby Klein (shakesoda)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name= "sm-ssc Team",
|
||||||
|
"Jason Felds (wolfman2000)", -- Timing Segments, Split Timing, optimization
|
||||||
|
"Thai Pangsakulyanont (theDtTvB)", -- BMS, Split Timing, optimization
|
||||||
|
"Alberto Ramos (Daisuke Master)",
|
||||||
|
"Jack Walstrom (FSX)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name= "StepMania Team",
|
||||||
|
"Chris Danford",
|
||||||
|
"Glenn Maynard",
|
||||||
|
"Steve Checkoway",
|
||||||
|
-- and various other contributors
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name= "OpenITG Team",
|
||||||
|
"infamouspat",
|
||||||
|
"Mark Cannon (vyhd)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name= "Translators",
|
||||||
|
"John Reactor (Polish)",
|
||||||
|
"DHalens (Spanish)",
|
||||||
|
"@Niler_jp (Japanese)",
|
||||||
|
"Deamon007 (Dutch)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name= "Other Contributors",
|
||||||
|
"Aldo Fregoso (Aldo_MX)", -- delays and much more. StepMania AMX creator
|
||||||
|
"A.C/@waiei", -- custom scoring fixes + Hybrid scoring
|
||||||
|
"cerbo", -- lua bindings and other fun stuff
|
||||||
|
"cesarmades", -- pump/cmd* noteskins
|
||||||
|
"Chris Eldridge (kurisu)", -- dance-threepanel stepstype support
|
||||||
|
"Christophe Goulet-LeBlanc (Kommisar)", -- songs
|
||||||
|
"corec", -- various fixes
|
||||||
|
"cybik", -- Android port
|
||||||
|
"galopin", -- piu PlayStation2 usb mat support
|
||||||
|
"gholms", -- automake 1.11 support
|
||||||
|
"juanelote", -- SongManager:GetSongGroupByIndex, JumpToNext/PrevGroup logic mods
|
||||||
|
"Kaox", -- pump/default noteskin
|
||||||
|
-- Add Graphics/CreditsLogo name.png and change your entry to a table like this to look super pro.
|
||||||
|
{logo= "kyzentun", name= "Kyzentun"}, -- new lua bindings
|
||||||
|
"Mad Matt", -- new lua bindings
|
||||||
|
"NitroX72", -- pump/frame noteskin
|
||||||
|
"Petriform", -- default theme music
|
||||||
|
"桜為小鳩/Sakurana-Kobato (@sakuraponila)", -- custom scoring fixes
|
||||||
|
"Samuel Kim (1a2a3a2a1a)", -- various beat mode fixes
|
||||||
|
"hanubeki (@803832)", -- beginner helper fix, among various other things
|
||||||
|
"v1toko", -- x-mode from StepNXA
|
||||||
|
"Alfred Sorenson", -- new lua bindings
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name= "Special Thanks",
|
||||||
|
"A Pseudonymous Coder", -- support
|
||||||
|
"Bill Shillito (DM Ashura)", -- Music (not yet though)
|
||||||
|
"cpubasic13", -- testing (a lot)
|
||||||
|
"dbk2", -- mac builds, a couple actor behavior fixes
|
||||||
|
"Dreamwoods",
|
||||||
|
"Jason Bolt (LightningXCE)",
|
||||||
|
"Jousway", -- Noteskins
|
||||||
|
"Luizsan", -- creator of Delta theme
|
||||||
|
"Matt1360", -- Automake magic + oitg bro
|
||||||
|
"Renard",
|
||||||
|
"Ryan McKanna (Plaguefox)",
|
||||||
|
"Sta Kousin", --help with Japanese bug reports
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name= "Shoutouts",
|
||||||
|
"The Lua team", -- lua project lead or some shit. super nerdy but oh hell.
|
||||||
|
"Mojang AB", -- minecraft forever -freem
|
||||||
|
"Wolfire Games", -- piles of inspiration
|
||||||
|
"NAKET Coder",
|
||||||
|
"Ciera Boyd", -- you bet your ass I'm putting my girlfriend in the credits -shakesoda
|
||||||
|
"#KBO",
|
||||||
|
"Celestia Radio", -- LOVE AND TOLERANCE
|
||||||
|
"You showed us... your ultimate dance",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local kyzentuns_fancy_value= 16
|
||||||
|
|
||||||
|
local special_logos= {
|
||||||
|
kyzentun= Def.ActorMultiVertex{
|
||||||
|
Texture= THEME:GetPathG("CreditsLogo", "kyzentun"),
|
||||||
|
OnCommand= function(self)
|
||||||
|
self:SetDrawState{Mode= "DrawMode_Quads"}
|
||||||
|
kyzentuns_fancy_value= math.random(2, 32)
|
||||||
|
self:playcommand("fancy", {state= 0})
|
||||||
|
self:queuecommand("normal_state")
|
||||||
|
end,
|
||||||
|
fancyCommand= function(self, params)
|
||||||
|
local verts= {}
|
||||||
|
local rlh= line_height - 2
|
||||||
|
local sx= rlh * -1
|
||||||
|
local sy= rlh * -.5
|
||||||
|
local sp= rlh / kyzentuns_fancy_value
|
||||||
|
local spt= 1 / kyzentuns_fancy_value
|
||||||
|
local c= color("#ffffff")
|
||||||
|
for x= 1, kyzentuns_fancy_value do
|
||||||
|
local lx= sx + (sp * (x-1))
|
||||||
|
local rx= sx + (sp * x)
|
||||||
|
local ltx= spt * (x-1)
|
||||||
|
local rtx= spt * x
|
||||||
|
for y= 1, kyzentuns_fancy_value do
|
||||||
|
local ty= sy + (sp * (y-1))
|
||||||
|
local by= sy + (sp * y)
|
||||||
|
local tty= spt * (y-1)
|
||||||
|
local bty= spt * y
|
||||||
|
if params.state == 1 then
|
||||||
|
ltx= 0
|
||||||
|
rtx= 1
|
||||||
|
tty= 0
|
||||||
|
bty= 1
|
||||||
|
end
|
||||||
|
verts[#verts+1]= {{lx, ty, 0}, {ltx, tty}, c}
|
||||||
|
verts[#verts+1]= {{rx, ty, 0}, {rtx, tty}, c}
|
||||||
|
verts[#verts+1]= {{rx, by, 0}, {rtx, bty}, c}
|
||||||
|
verts[#verts+1]= {{lx, by, 0}, {ltx, bty}, c}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self:SetVertices(verts)
|
||||||
|
end,
|
||||||
|
normal_stateCommand= function(self)
|
||||||
|
self:linear(1)
|
||||||
|
self:playcommand("fancy", {state= 0})
|
||||||
|
self:queuecommand("split_state")
|
||||||
|
end,
|
||||||
|
split_stateCommand= function(self)
|
||||||
|
self:linear(1)
|
||||||
|
self:playcommand("fancy", {state= 1})
|
||||||
|
self:queuecommand("normal_state")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Go through the credits and swap in the special logos.
|
||||||
|
for section in ivalues(stepmania_credits) do
|
||||||
|
for entry in ivalues(section) do
|
||||||
|
if type(entry) == "table" and special_logos[entry.logo] then
|
||||||
|
entry.logo= special_logos[entry.logo]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function position_logo(self)
|
||||||
|
local name= self:GetParent():GetChild("name")
|
||||||
|
local name_width= name:GetZoomedWidth()
|
||||||
|
local logo_width= self:GetZoomedWidth()
|
||||||
|
self:x(0 - (name_width / 2) - 4 - (logo_width / 2))
|
||||||
|
end
|
||||||
|
|
||||||
|
StepManiaCredits= {
|
||||||
|
AddSection= function(section, pos, insert_before)
|
||||||
|
if not section.name then
|
||||||
|
lua.ReportScriptError("A section being added to the credits must have a name field.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if #section < 1 then
|
||||||
|
lua.ReportScriptError("Adding a blank section to the credits doesn't make sense.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if type(pos) == "string" then
|
||||||
|
for i, section in ipairs(stepmania_credits) do
|
||||||
|
if section.name == pos then
|
||||||
|
pos= i -- insert_after is default behavior
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if pos and type(pos) ~= "number" then
|
||||||
|
lua.ReportScriptError("Credits section '" .. tostring(pos) .. " not found, cannot use position to add new section.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
pos= pos or #stepmania_credits
|
||||||
|
if insert_before then
|
||||||
|
pos= pos - 1
|
||||||
|
end
|
||||||
|
-- table.insert does funny things if you pass an index <= 0
|
||||||
|
if pos < 1 then
|
||||||
|
lua.ReportScriptError("Cannot add credits section at position " .. tostring(pos) .. ".")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
table.insert(stepmania_credits, pos, section)
|
||||||
|
end,
|
||||||
|
AddLineToScroller= function(scroller, text, command)
|
||||||
|
if type(scroller) ~= "table" then
|
||||||
|
lua.ReportScriptError("scroller passed to AddLineToScroller must be an actor table.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local actor_to_insert
|
||||||
|
if type(text) == "string" or not text then
|
||||||
|
actor_to_insert= Def.ActorFrame{
|
||||||
|
Def.BitmapText{
|
||||||
|
Font= "Common Normal",
|
||||||
|
Text = text or "";
|
||||||
|
OnCommand = command or lineOn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif type(text) == "table" then
|
||||||
|
actor_to_insert= Def.ActorFrame{
|
||||||
|
Def.BitmapText{
|
||||||
|
Name= "name", Font= "Common Normal",
|
||||||
|
Text = text.name or "",
|
||||||
|
InitCommand = command or lineOn,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
if text.logo then
|
||||||
|
if type(text.logo) == "string" then
|
||||||
|
actor_to_insert[#actor_to_insert+1]= Def.Sprite{
|
||||||
|
Name= "logo",
|
||||||
|
InitCommand= function(self)
|
||||||
|
-- Use LoadBanner to disable the odd dimension warning.
|
||||||
|
self:LoadBanner(THEME:GetPathG("CreditsLogo", text.logo))
|
||||||
|
-- Scale to slightly less than the line height for padding.
|
||||||
|
local yscale= (line_height-2) / self:GetHeight()
|
||||||
|
self:zoom(yscale)
|
||||||
|
-- Position logo to the left of the name.
|
||||||
|
position_logo(self)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
else -- assume logo is an actor
|
||||||
|
-- Insert positioning InitCommand.
|
||||||
|
text.logo.InitCommand= position_logo
|
||||||
|
actor_to_insert[#actor_to_insert+1]= text.logo
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.insert(scroller, actor_to_insert)
|
||||||
|
end,
|
||||||
|
Get= function()
|
||||||
|
-- Copy the base credits and add the copyright message at the end.
|
||||||
|
local ret= DeepCopy(stepmania_credits)
|
||||||
|
ret[#ret+1]= StepManiaCredits.RandomCopyrightMessage()
|
||||||
|
return ret
|
||||||
|
end,
|
||||||
|
RandomCopyrightMessage= function()
|
||||||
|
return {
|
||||||
|
name= "Copyright",
|
||||||
|
"StepMania is released under the terms of the MIT license.",
|
||||||
|
"If you paid for the program you've been " .. Fooled() .. ".",
|
||||||
|
"All content is the sole property of their respectful owners."
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
SetLineHeight= function(height)
|
||||||
|
if type(height) ~= "number" then
|
||||||
|
lua.ReportScriptError("height passed to StepManiaCredits.SetLineHeight must be a number.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
line_height= height
|
||||||
|
end
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user