From 1620f209b8d8923868314a53c0b9b699e52e9925 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 1 Feb 2004 23:06:43 +0000 Subject: [PATCH] add "randomcourse" File keyword --- stepmania/src/ActorUtil.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 4f3c9035f5..fa824ab539 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -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