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:
+8
-3
@@ -126,11 +126,16 @@ void BitmapText::LoadFromNode( const XNode* pNode )
|
|||||||
ThemeManager::EvaluateString( sAltText );
|
ThemeManager::EvaluateString( sAltText );
|
||||||
|
|
||||||
RString sFont;
|
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
|
if( !pNode->GetAttrValue("Font", sFont) &&
|
||||||
RageException::Throw( "%s: BitmapText: missing the File attribute",
|
!pNode->GetAttrValue("File", sFont) ) // accept "File" for backward compatibility
|
||||||
|
{
|
||||||
|
LOG->Warn( "%s: BitmapText: Font or File attribute not found",
|
||||||
ActorUtil::GetWhere(pNode).c_str() );
|
ActorUtil::GetWhere(pNode).c_str() );
|
||||||
|
sFont = "Common Normal";
|
||||||
|
}
|
||||||
sFont = THEME->GetPathF( "", sFont );
|
sFont = THEME->GetPathF( "", sFont );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user