Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Midiman
Created June 15, 2012 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Midiman/2938977 to your computer and use it in GitHub Desktop.
Save Midiman/2938977 to your computer and use it in GitHub Desktop.
StepMania 5 - Jacket Display
local sBannerPath = THEME:GetPathG("Common", "fallback banner");
local sJacketPath = THEME:GetPathG("Common", "fallback jacket");
local bAllowJackets = true
local t = Def.ActorFrame {
Def.Sprite {
Name="Banner";
InitCommand=cmd(scaletoclipped,220,220;);
-- Commands to make sure each banenr gets the right look.
BannerCommand=cmd(scaletoclipped,256,80);
JacketCommand=cmd(scaletoclipped,220,220);
-- Set em up the graphics.
SetMessageCommand=function(self,params)
local Song = params.Song;
local Course = params.Course;
-- We have a song, not course
if Song then
-- Have Jacket
if ( Song:GetJacketPath() ~= nil ) and ( bAllowJackets ) then
self:Load( Song:GetJacketPath() );
self:playcommand("Jacket");
-- Use Background if we want Jackets
elseif ( Song:GetBackgroundPath() ~= nil ) and ( bAllowJackets ) then
self:Load( Song:GetBackgroundPath() );
self:playcommand("Jacket");
-- Use Banner if we dont care
elseif ( Song:GetBannerPath() ~= nil ) then
self:Load( Song:GetBannerPath() );
self:playcommand("Banner");
-- Use Default
else
self:Load( bAllowJackets and sBannerPath or sJacketPath );
self:playcommand( bAllowJackets and "Jacket" or "Banner" );
end;
elseif Course then
-- We have a background (for jackets)
if ( Course:GetBackgroundPath() ~= nil ) and ( bAllowJackets ) then
self:Load( Course:GetBackgroundPath() );
self:playcommand("Jacket");
-- We have a banner
elseif ( Course:GetBannerPath() ~= nil ) then
self:Load( Course:GetBannerPath() );
self:playcommand("Banner");
-- Get your defaults
else
self:Load( sJacketPath );
self:playcommand( bAllowJackets and "Jacket" or "Banner" );
end
-- What the hell did you do?!
else
self:Load( bAllowJackets and sJacketPath or sBannerPath );
self:playcommand( bAllowJackets and "Jacket" or "Banner" );
end;
end;
};
};
return t;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment