add "course fallback" banner so that we can show "edit" for edit courses

This commit is contained in:
Chris Danford
2005-08-01 05:15:59 +00:00
parent 6dc9a3bbc1
commit 0c7b0b5529
4 changed files with 24 additions and 3 deletions
+6 -1
View File
@@ -99,7 +99,7 @@ void Banner::LoadFromCourse( Course* pCourse ) // NULL means no course
{
if( pCourse == NULL ) LoadFallback();
else if( pCourse->m_sBannerPath != "" ) Load( pCourse->m_sBannerPath );
else LoadFallback();
else LoadCourseFallback();
m_bScrolling = false;
}
@@ -140,6 +140,11 @@ void Banner::LoadFallback()
Load( THEME->GetPathG("Common","fallback banner") );
}
void Banner::LoadCourseFallback()
{
Load( THEME->GetPathG("Banner","course fallback") );
}
void Banner::LoadRoulette()
{
Load( THEME->GetPathG("Banner","roulette") );
+1
View File
@@ -30,6 +30,7 @@ public:
void LoadRoulette();
void LoadRandom();
void LoadFallback();
void LoadCourseFallback();
void SetScrolling( bool bScroll, float Percent = 0);
bool IsScrolling() const { return m_bScrolling; }
+16 -2
View File
@@ -161,7 +161,11 @@ void FadingBanner::LoadFromSong( const Song* pSong )
/* Don't call HasBanner. That'll do disk access and cause the music wheel
* to skip. */
LoadFromCachedBanner( pSong->GetBannerPath() );
CString sPath = pSong->GetBannerPath();
if( sPath.empty() )
LoadFallback();
else
LoadFromCachedBanner( sPath );
}
void FadingBanner::LoadAllMusic()
@@ -192,7 +196,11 @@ void FadingBanner::LoadFromCourse( const Course* pCourse )
/* Don't call HasBanner. That'll do disk access and cause the music wheel
* to skip. */
LoadFromCachedBanner( pCourse->m_sBannerPath );
CString sPath = pCourse->m_sBannerPath;
if( sPath.empty() )
LoadCourseFallback();
else
LoadFromCachedBanner( sPath );
}
void FadingBanner::LoadRoulette()
@@ -213,6 +221,12 @@ void FadingBanner::LoadFallback()
m_Banner[m_iIndexLatest].LoadFallback();
}
void FadingBanner::LoadCourseFallback()
{
BeforeChange();
m_Banner[m_iIndexLatest].LoadCourseFallback();
}
// lua start
#include "LuaBinding.h"
+1
View File
@@ -26,6 +26,7 @@ public:
void LoadRoulette();
void LoadRandom();
void LoadFallback();
void LoadCourseFallback();
bool LoadFromCachedBanner( const CString &path );