make BitmapText accept Font property
This commit is contained in:
@@ -83,6 +83,7 @@ Actor* ActorUtil::LoadFromActorFile( const CString& sAniDir, const XNode* pNode
|
|||||||
else if( sFile.CompareNoCase("coursebanner") == 0 )
|
else if( sFile.CompareNoCase("coursebanner") == 0 )
|
||||||
sType = "CourseBanner";
|
sType = "CourseBanner";
|
||||||
|
|
||||||
|
|
||||||
if( sType == "BGAnimation" )
|
if( sType == "BGAnimation" )
|
||||||
{
|
{
|
||||||
BGAnimation *p = new BGAnimation;
|
BGAnimation *p = new BGAnimation;
|
||||||
@@ -123,15 +124,18 @@ Actor* ActorUtil::LoadFromActorFile( const CString& sAniDir, const XNode* pNode
|
|||||||
ThemeManager::EvaluateString( sText );
|
ThemeManager::EvaluateString( sText );
|
||||||
ThemeManager::EvaluateString( sAlttext );
|
ThemeManager::EvaluateString( sAlttext );
|
||||||
|
|
||||||
|
CString sFont = sFile; // accept "File" for backward compatibility
|
||||||
|
pNode->GetAttrValue("Font", sFont );
|
||||||
|
|
||||||
BitmapText* pBitmapText = new BitmapText;
|
BitmapText* pBitmapText = new BitmapText;
|
||||||
|
|
||||||
/* Be careful: if sFile is "", and we don't check it, then we can end up recursively
|
/* Be careful: if sFile is "", and we don't check it, then we can end up recursively
|
||||||
* loading the BGAnimationLayer that we're in. */
|
* loading the BGAnimationLayer that we're in. */
|
||||||
if( sFile == "" )
|
if( sFont == "" )
|
||||||
RageException::Throw( "A BitmapText in '%s' is missing the File attribute",
|
RageException::Throw( "A BitmapText in '%s' is missing the Font attribute",
|
||||||
sAniDir.c_str() );
|
sAniDir.c_str() );
|
||||||
|
|
||||||
pBitmapText->LoadFromFont( THEME->GetPathToF( sFile ) );
|
pBitmapText->LoadFromFont( THEME->GetPathToF( sFont ) );
|
||||||
pBitmapText->SetText( sText, sAlttext );
|
pBitmapText->SetText( sText, sAlttext );
|
||||||
pActor = pBitmapText;
|
pActor = pBitmapText;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user