Created
June 16, 2012 05:48
-
-
Save hookyboysb/2940116 to your computer and use it in GitHub Desktop.
new
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}; | |
Def.Sprite { | |
Name="Banner"; | |
InitCommand=cmd(scaletoclipped,220,220;y,220;rotationx,180;croptop,0.5;diffusealpha,0.6;diffusetopedge,1,1,1,0); | |
-- Commands to make sure each banenr gets the right look. | |
BannerCommand=cmd(scaletoclipped,256,80;y,220;rotationx,180;croptop,0.5;diffusealpha,0.6;diffusetopedge,1,1,1,0); | |
JacketCommand=cmd(scaletoclipped,220,220;y,220;rotationx,180;croptop,0.5;diffusealpha,0.6;diffusetopedge,1,1,1,0); | |
-- 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