Advertisement
Guest User

Coverflow Fix for SM5 DDRX2 Theme

a guest
May 28th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.06 KB | None | 0 0
  1. local bannerPath;
  2.  
  3. function GetSongBanner(song)
  4.     if song then
  5.         local path = song:GetBannerPath()
  6.         if path then return path end
  7.     end
  8.     return THEME:GetPathG("Common","fallback banner")
  9. end
  10.  
  11. function GetSongBg(song)
  12.     if song then
  13.         local path = song:GetBackgroundPath()
  14.         if path then return path end
  15.     end
  16.     return THEME:GetPathG("Common","fallback background")
  17. end
  18.  
  19. local t = Def.ActorFrame{
  20.  
  21.     Def.Banner {
  22.         Name="SongBanner";
  23.         InitCommand=cmd(scaletoclipped,220,220;);
  24.         SetMessageCommand=function(self,params)
  25.             local song = params.Song;
  26.             local course = params.Course;
  27.             if song and not course then
  28.  
  29.                 -- first, try to load an actual Jacket file
  30.                 if song:HasJacket() then
  31.                     self:Load(song:GetJacketPath())
  32.  
  33.                 -- if there isn't a Jacket, look for a Background file
  34.                 elseif song:HasBackground() then
  35.                     self:Load(song:GetBackgroundPath())
  36.    
  37.                 -- if neither of those, look for a Banner file 
  38.                 elseif song:HasBanner() then
  39.                     self:Load(song:GetBannerPath())
  40.                 end
  41.  
  42.             elseif course and not song then
  43.                 self:LoadFromCourse(params.Course);
  44.             else
  45.                 self:Load( THEME:GetPathG("Common fallback","banner") );
  46.             end;
  47.         end;
  48.     };
  49.    
  50.     -- this is above jacket's "reflection"
  51.     Def.Banner {
  52.         InitCommand=cmd(scaletoclipped,220,220;y,220;rotationx,180;croptop,0.5;diffusealpha,0.6;diffusetopedge,1,1,1,0);
  53.         SetMessageCommand=function(self,params)
  54.             local song = params.Song;
  55.             local course = params.Course;
  56.             if song and not course then
  57.  
  58.                 -- first, try to load an actual Jacket file
  59.                 if song:HasJacket() then
  60.                     self:Load(song:GetJacketPath())
  61.  
  62.                 -- if there isn't a Jacket, look for a Background file
  63.                 elseif song:HasBackground() then
  64.                     self:Load(song:GetBackgroundPath())
  65.    
  66.                 -- if neither of those, look for a Banner file 
  67.                 elseif song:HasBanner() then
  68.                     self:Load(song:GetBannerPath())
  69.                 end
  70.  
  71.             elseif course and not song then
  72.                 self:LoadFromCourse(params.Course);
  73.             else
  74.                 self:Load( THEME:GetPathG("Common fallback","banner") );
  75.             end;
  76.         end;
  77.     };
  78. };
  79.  
  80.  
  81. return t;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement