add "randomcourse" File keyword

This commit is contained in:
Chris Danford
2004-02-01 23:06:43 +00:00
parent ef8010e998
commit 1620f209b8
+16
View File
@@ -27,6 +27,7 @@
#include "GameState.h"
#include "RageTextureManager.h"
#include "SongManager.h"
#include "Course.h"
Actor* LoadFromActorFile( CString sIniPath, CString sLayer )
@@ -109,6 +110,21 @@ Actor* LoadFromActorFile( CString sIniPath, CString sLayer )
pActor = MakeActor( sFile );
TEXTUREMAN->EnableOddDimensionWarning();
}
else if( sFile.CompareNoCase("coursebanner")==0 )
{
Course *pCourse = GAMESTATE->m_pCurCourse;
if( pCourse == NULL )
pCourse = SONGMAN->GetRandomCourse();
if( pCourse && pCourse->HasBanner() )
sFile = pCourse->m_sBannerPath;
else
sFile = THEME->GetPathToG("Common fallback banner");
TEXTUREMAN->DisableOddDimensionWarning();
pActor = MakeActor( sFile );
TEXTUREMAN->EnableOddDimensionWarning();
}
else if( IsAFile(sDir+sFile) || IsADirectory(sDir+sFile) )
{
// If we know this is an exact match, don't bother with the