BitmapText: check both File and Font as path

Allow BitmapText to specify font from Theme/Fonts as well as locally,
using either the Font or the old-style File attribute.
This commit is contained in:
Devin J. Pohly
2013-10-13 15:03:26 -04:00
parent 000498ba63
commit 59674ad6f2
+8 -3
View File
@@ -126,11 +126,16 @@ void BitmapText::LoadFromNode( const XNode* pNode )
ThemeManager::EvaluateString( sAltText );
RString sFont;
if( !ActorUtil::GetAttrPath(pNode, "File", sFont) )
if( !ActorUtil::GetAttrPath(pNode, "Font", sFont) &&
!ActorUtil::GetAttrPath(pNode, "File", sFont) )
{
if( !pNode->GetAttrValue("Font", sFont) ) // accept "File" for backward compatibility
RageException::Throw( "%s: BitmapText: missing the File attribute",
if( !pNode->GetAttrValue("Font", sFont) &&
!pNode->GetAttrValue("File", sFont) ) // accept "File" for backward compatibility
{
LOG->Warn( "%s: BitmapText: Font or File attribute not found",
ActorUtil::GetWhere(pNode).c_str() );
sFont = "Common Normal";
}
sFont = THEME->GetPathF( "", sFont );
}