Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local bannerPath;
- function GetSongBanner(song)
- if song then
- local path = song:GetBannerPath()
- if path then return path end
- end
- return THEME:GetPathG("Common","fallback banner")
- end
- function GetSongBg(song)
- if song then
- local path = song:GetBackgroundPath()
- if path then return path end
- end
- return THEME:GetPathG("Common","fallback background")
- end
- local t = Def.ActorFrame{
- Def.Banner {
- Name="SongBanner";
- InitCommand=cmd(scaletoclipped,220,220;);
- SetMessageCommand=function(self,params)
- local song = params.Song;
- local course = params.Course;
- if song and not course then
- -- first, try to load an actual Jacket file
- if song:HasJacket() then
- self:Load(song:GetJacketPath())
- -- if there isn't a Jacket, look for a Background file
- elseif song:HasBackground() then
- self:Load(song:GetBackgroundPath())
- -- if neither of those, look for a Banner file
- elseif song:HasBanner() then
- self:Load(song:GetBannerPath())
- end
- elseif course and not song then
- self:LoadFromCourse(params.Course);
- else
- self:Load( THEME:GetPathG("Common fallback","banner") );
- end;
- end;
- };
- -- this is above jacket's "reflection"
- Def.Banner {
- InitCommand=cmd(scaletoclipped,220,220;y,220;rotationx,180;croptop,0.5;diffusealpha,0.6;diffusetopedge,1,1,1,0);
- SetMessageCommand=function(self,params)
- local song = params.Song;
- local course = params.Course;
- if song and not course then
- -- first, try to load an actual Jacket file
- if song:HasJacket() then
- self:Load(song:GetJacketPath())
- -- if there isn't a Jacket, look for a Background file
- elseif song:HasBackground() then
- self:Load(song:GetBackgroundPath())
- -- if neither of those, look for a Banner file
- elseif song:HasBanner() then
- self:Load(song:GetBannerPath())
- end
- elseif course and not song then
- self:LoadFromCourse(params.Course);
- else
- self:Load( THEME:GetPathG("Common fallback","banner") );
- end;
- end;
- };
- };
- return t;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement