diff --git a/Themes/_fallback/BGAnimations/ScreenCredits overlay.lua b/Themes/_fallback/BGAnimations/ScreenCredits overlay.lua index 8609c97488..845316d96c 100644 --- a/Themes/_fallback/BGAnimations/ScreenCredits overlay.lua +++ b/Themes/_fallback/BGAnimations/ScreenCredits overlay.lua @@ -1,156 +1,49 @@ -local function Fooled() - local phrases = { - "hornswaggled", - "bamboozled", - "hoodwinked", - "swindled", - "duped", - "hoaxed", - "fleeced", - "shafted", - "caboodled", - "beguiled", - "finagled", - "two-timed", - "suckered", - "flimflammed" - } - return phrases[math.random(#phrases)] -end +-- To add a section to the credits, use the following: +-- local theme_credits= { +-- name= "Theme Credits", -- the name of your section +-- "Me", -- The people you want to list in your section. +-- "Myself", +-- "My other self", +-- {logo= "pro_dude", name= "Pro self"}, -- Someone who has a logo image. +-- -- This logo image would be "Graphics/CreditsLogo pro_dude.png". +-- } +-- StepManiaCredits.AddSection(theme_credits) +-- +-- If you want to add your section after an existing section, use the following: +-- StepManiaCredits.AddSection(theme_credits, 7) +-- +-- Or position can be the name of a section to insert after: +-- StepManiaCredits.AddSection(theme_credits, "Special Thanks") +-- +-- Or if you want to add your section before a section: +-- StepManiaCredits.AddSection(theme_credits, "Special Thanks", true) -local ssc = { - "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. +-- StepManiaCredits is defined in _fallback/Scripts/04 CreditsHelpers.lua. 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 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 { SecondsPerItem = 0.5; NumItemsToDraw = 40; TransformFunction = function( self, offset, itemIndex, numItems) - self:y(30*offset) + self:y(line_height*offset) end; 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. -for section in ivalues(sections) do - AddLine( section[1], sectionOn ) - for name in ivalues(section[2]) do - AddLine( name ) +for section in ivalues(StepManiaCredits.Get()) do + StepManiaCredits.AddLineToScroller(creditScroller, section.name, sectionOn) + for name in ivalues(section) do + StepManiaCredits.AddLineToScroller(creditScroller, name) end - AddLine() - AddLine() + StepManiaCredits.AddLineToScroller(creditScroller) + StepManiaCredits.AddLineToScroller(creditScroller) end creditScroller.BeginCommand=function(self) diff --git a/Themes/_fallback/Graphics/CreditsLogo kyzentun.png b/Themes/_fallback/Graphics/CreditsLogo kyzentun.png new file mode 100755 index 0000000000..d9431bc99d Binary files /dev/null and b/Themes/_fallback/Graphics/CreditsLogo kyzentun.png differ diff --git a/Themes/_fallback/Scripts/04 CreditsHelpers.lua b/Themes/_fallback/Scripts/04 CreditsHelpers.lua new file mode 100644 index 0000000000..4bd43fe955 --- /dev/null +++ b/Themes/_fallback/Scripts/04 CreditsHelpers.lua @@ -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 +}