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