replace 6 commands in TextBanner with 1 now that Lua can access children

This commit is contained in:
Chris Danford
2007-03-11 20:21:42 +00:00
parent 95b4c3cd5a
commit a4d0ec095a
2 changed files with 16 additions and 6 deletions
@@ -75,6 +75,21 @@ function ScreenString( sName )
return THEME:GetString( sClass, sName )
end
function TextBannerSet(self,param)
local Title=self:GetChild("Title");
local Subtitle=self:GetChild("Subtitle");
local Artist=self:GetChild("Artist");
if Subtitle:GetText() == "" then
(cmd(zoom,1;maxwidth,180;y,-8))(Title);
(cmd(visible,false))(Subtitle);
(cmd(zoom,0.6;maxwidth,266;y,8))(Artist);
else
(cmd(zoom,1;maxwidth,180;y,-10))(Title);
(cmd(visible,true;zoom,.5;maxwidth,360))(Subtitle);
(cmd(zoom,0.6;maxwidth,266;y,10))(Artist);
end
end
-- (c) 2005 Chris Danford
-- All rights reserved.
--
+1 -6
View File
@@ -3166,12 +3166,7 @@ ArtistX=-120
ArtistY=0
ArtistOnCommand=shadowlength,0;horizalign,left
ArtistPrependString="/"
TwoLinesTitleCommand=zoom,1;maxwidth,180;y,-8
TwoLinesSubtitleCommand=hidden,1
TwoLinesArtistCommand=zoom,0.6;maxwidth,266;y,8
ThreeLinesTitleCommand=zoom,1;maxwidth,180;y,-10
ThreeLinesSubtitleCommand=hidden,0;zoom,.5;maxwidth,360
ThreeLinesArtistCommand=zoom,0.6;maxwidth,266;y,10
SetCommand=%TextBannerSet
[TextBannerCourseEntry]
Fallback="TextBanner"