From ae45448ade63b0e8c2cdb41d5cf55d154e691614 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 16 Feb 2007 07:55:59 +0000 Subject: [PATCH] use File in Lua; use Font in XML, for compatibility. Only XML's paths need manual lookups. --- stepmania/src/BitmapText.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index d999cdd48b..78314e402f 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -106,16 +106,14 @@ void BitmapText::LoadFromNode( const XNode* pNode ) ThemeManager::EvaluateString( sAltText ); RString sFont; - ActorUtil::GetAttrPath( pNode, "Font", sFont ); - if( sFont.empty() ) - ActorUtil::GetAttrPath( pNode, "File", sFont ); // accept "File" for backward compatibility - - if( sFont == "" ) - RageException::Throw( "%s: BitmapText: missing the Font attribute", - ActorUtil::GetWhere(pNode).c_str() ); - - if( sFont.Left(1) != "/" ) + if( !ActorUtil::GetAttrPath(pNode, "File", sFont) ) + { + if( !pNode->GetAttrValue("Font", sFont) ) // accept "File" for backward compatibility + RageException::Throw( "%s: BitmapText: missing the File attribute", + ActorUtil::GetWhere(pNode).c_str() ); sFont = THEME->GetPathF( "", sFont ); + } + LoadFromFont( sFont ); SetText( sText, sAltText );