This commit is contained in:
Glenn Maynard
2007-08-15 21:01:23 +00:00
parent 7729701678
commit 9aead72d03
4 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ void ScreenUnlockStatus::Init()
break;
case UnlockRewardType_Course:
{
const Course *pCourse = entry.m_pCourse;
const Course *pCourse = entry.m_Course.ToCourse();
ASSERT( pCourse );
text->SetMaxWidth( MaxWidth );
+2 -2
View File
@@ -1452,8 +1452,8 @@ void SongManager::UpdatePreferredSort()
FOREACH( UnlockEntry, UNLOCKMAN->m_UnlockEntries, ue )
{
if( ue->m_Type == UnlockRewardType_Course )
if( ue->m_pCourse )
vpUnlockCourses.push_back( ue->m_pCourse );
if( ue->m_Course.IsValid() )
vpUnlockCourses.push_back( ue->m_Course.ToCourse() );
}
FOREACH( CoursePointerVector, m_vPreferredCourseSort, v )
+9 -9
View File
@@ -210,7 +210,7 @@ const UnlockEntry *UnlockManager::FindSteps( const Song *pSong, const Steps *pSt
const UnlockEntry *UnlockManager::FindCourse( const Course *pCourse ) const
{
FOREACH_CONST( UnlockEntry, m_UnlockEntries, e )
if( e->m_pCourse == pCourse )
if( e->m_Course.ToCourse() == pCourse )
return &(*e);
return NULL;
}
@@ -316,7 +316,7 @@ bool UnlockEntry::IsValid() const
return m_Song.IsValid() && m_dc != Difficulty_Invalid;
case UnlockRewardType_Course:
return m_pCourse != NULL;
return m_Course.IsValid();
case UnlockRewardType_Modifier:
return true;
@@ -371,7 +371,7 @@ RString UnlockEntry::GetDescription() const
case UnlockRewardType_Steps:
return (pSong ? pSong->GetDisplayFullTitle() : "") + ", " + DifficultyToLocalizedString( m_dc );
case UnlockRewardType_Course:
return m_pCourse ? m_pCourse->GetDisplayFullTitle() : "";
return m_Course.IsValid() ? m_Course.ToCourse()->GetDisplayFullTitle() : "";
case UnlockRewardType_Modifier:
return CommonMetrics::LocalizeOptionItem( GetModifier(), false );
}
@@ -389,7 +389,7 @@ RString UnlockEntry::GetBannerFile() const
case UnlockRewardType_Steps:
return pSong ? pSong->GetBannerPath() : "";
case UnlockRewardType_Course:
return m_pCourse ? m_pCourse->GetBannerPath() : "";
return m_Course.ToCourse() ? m_Course.ToCourse()->GetBannerPath() : "";
case UnlockRewardType_Modifier:
return "";
}
@@ -499,7 +499,7 @@ void UnlockManager::Load()
str += e->IsLocked()? "locked":"unlocked";
if( e->m_Song.IsValid() )
str += ( " (found song)" );
if( e->m_pCourse )
if( e->m_Course.IsValid() )
str += ( " (found course)" );
LOG->Trace( "%s", str.c_str() );
}
@@ -563,8 +563,8 @@ void UnlockManager::UpdateCachedPointers()
break;
case UnlockRewardType_Course:
e->m_pCourse = SONGMAN->FindCourse( e->m_cmd.GetArg(0).s );
if( e->m_pCourse == NULL )
e->m_Course.FromCourse( SONGMAN->FindCourse(e->m_cmd.GetArg(0).s) );
if( !e->m_Course.IsValid() )
LOG->Warn( "Unlock: Cannot find course matching \"%s\"", e->m_cmd.GetArg(0).s.c_str() );
break;
case UnlockRewardType_Modifier:
@@ -600,8 +600,8 @@ void UnlockManager::PreferUnlockEntryID( RString sUnlockEntryID )
if( pEntry.m_Song.ToSong() != NULL )
GAMESTATE->m_pPreferredSong = pEntry.m_Song.ToSong();
if( pEntry.m_pCourse != NULL )
GAMESTATE->m_pPreferredCourse = pEntry.m_pCourse;
if( pEntry.m_Course.ToCourse() )
GAMESTATE->m_pPreferredCourse = pEntry.m_Course.ToCourse();
}
}
+2 -2
View File
@@ -8,6 +8,7 @@
#include <set>
#include "Difficulty.h"
#include "SongUtil.h"
#include "CourseUtil.h"
class Song;
class Course;
@@ -56,7 +57,6 @@ public:
m_Type = UnlockRewardType_Invalid;
m_dc = Difficulty_Invalid;
m_pCourse = NULL;
ZERO( m_fRequirement );
m_bRequirePassHardSteps = false;
@@ -71,7 +71,7 @@ public:
* these will be non-NULL. */
SongID m_Song;
Difficulty m_dc;
Course *m_pCourse;
CourseID m_Course;
float m_fRequirement[NUM_UnlockRequirement]; // unlocked if any of of these are met
bool m_bRequirePassHardSteps;