--[[
TwoLinesTitleCommand=zoom,0.75;maxwidth,224;y,-2
TwoLinesSubtitleCommand=hidden,1
TwoLinesArtistCommand=zoom,0.5;maxwidth,300;y,8

ThreeLinesTitleCommand=zoom,0.65;maxwidth,224;y,-8
ThreeLinesSubtitleCommand=hidden,0;zoom,.6;maxwidth,240;y,+5
ThreeLinesArtistCommand=zoom,0.5;maxwidth,300;y,8
--]]

local titleMaxWidth = 260;
local subtitleMaxWidth = 240;
local artistMaxWidth = 300;

function TextBannerAfterSet(self,param)
	local Title = self:GetChild("Title");
	local Subtitle = self:GetChild("Subtitle");
	local Artist = self:GetChild("Artist");

	-- no subtitle
	if Subtitle:GetText() == "" then
		( cmd(zoom,0.75;maxwidth,titleMaxWidth;x,-120;y,-2;shadowlength,1;halign,0) )(Title);
		( cmd(visible,false) )(Subtitle);
		( cmd(zoom,0.5;maxwidth,artistMaxWidth;x,185;y,8;shadowlength,1;horizalign,right) )(Artist);

	-- yes subtitle
	else
		( cmd(zoom,0.65;maxwidth,titleMaxWidth;x,-120;y,-8;shadowlength,1;halign,0) )(Title);
		( cmd(zoom,0.6;maxwidth,subtitleMaxWidth;x,-120;y,5;visible,true;shadowlength,1;halign,0) )(Subtitle);
		( cmd(zoom,0.5;maxwidth,artistMaxWidth;x,185;y,8;shadowlength,1;horizalign,right) )(Artist);
	end;

	-- hack I stole from AJ 187's moonlight
	if Title:GetText() == "DVNO" then
	-- four capital letters, printed in gold
		local attr = {
			Length = 4;
			Diffuse = color("1,0.8,0,1");
		};
		Title:AddAttribute(0,attr);
	-- details make the girls sweat even more
	end;
end;

--[[
TwoLinesTitleCommand=zoom,0.75;maxwidth,224;y,-6
TwoLinesSubtitleCommand=hidden,1
TwoLinesArtistCommand=zoom,0.5;maxwidth,266;y,8

ThreeLinesTitleCommand=zoom,0.6;maxwidth,224;y,-10
ThreeLinesSubtitleCommand=hidden,0;zoom,.5;maxwidth,360;y,+1
ThreeLinesArtistCommand=zoom,0.5;maxwidth,266;y,10
--]]
function TextBannerCourseAfterSet(self,param)
	local Title = self:GetChild("Title");
	local Subtitle = self:GetChild("Subtitle");
	local Artist = self:GetChild("Artist");

	-- no subtitle
	if Subtitle:GetText() == "" then
		( cmd(zoom,0.75;maxwidth,titleMaxWidth;y,-6;shadowlength,1;halign,0) )(Title);
		( cmd(visible,false) )(Subtitle);
		( cmd(zoom,0.5;maxwidth,artistMaxWidth;y,8;shadowlength,1;halign,0) )(Artist);

	-- yes subtitle
	else
		( cmd(zoom,0.6;maxwidth,titleMaxWidth;y,-10;shadowlength,1;halign,0) )(Title);
		( cmd(zoom,0.5;maxwidth,subtitleMaxWidth;y,1;visible,true;shadowlength,1;halign,0) )(Subtitle);
		( cmd(zoom,0.5;maxwidth,artistMaxWidth;y,10;shadowlength,1;halign,0) )(Artist);
	end;

	-- and the DVNO hack again
	if Title:GetText() == "DVNO" then
	-- four capital letters, printed in gold
		local attr = {
			Length = 4;
			Diffuse = color("1,0.8,0,1");
		};
		Title:AddAttribute(0,attr);
	-- no need to ask my name to figure out how cool I am -asg
	end;
end;

function TextBannerEditAfterSet(self,param)
	local Title = self:GetChild("Title");
	local Subtitle = self:GetChild("Subtitle");
	local Artist = self:GetChild("Artist");
	
	(cmd(visible,false))(Artist);
	if Subtitle:GetText() == "" then
		( cmd(zoom,0.75;maxwidth,titleMaxWidth;y,-6;shadowlength,1;halign,0) )(Title);
		(cmd(visible,false))(Subtitle);
	else
		( cmd(zoom,0.6;maxwidth,titleMaxWidth;y,-10;shadowlength,1;halign,0) )(Title);
		( cmd(zoom,0.5;maxwidth,subtitleMaxWidth;y,1;visible,true;shadowlength,1;halign,0) )(Subtitle);
	end;
	-- no dvno hack; not worth it
end;