CourseDifficulty.
This commit is contained in:
@@ -76,7 +76,7 @@ void ThemeMetricCourseDifficultiesToShow::Read()
|
|||||||
FOREACH_CONST( RString, v, i )
|
FOREACH_CONST( RString, v, i )
|
||||||
{
|
{
|
||||||
CourseDifficulty d = StringToCourseDifficulty( *i );
|
CourseDifficulty d = StringToCourseDifficulty( *i );
|
||||||
if( d == Difficulty_Invalid )
|
if( d == CourseDifficulty_Invalid )
|
||||||
RageException::Throw( "Unknown CourseDifficulty \"%s\" in CourseDifficultiesToShow.", i->c_str() );
|
RageException::Throw( "Unknown CourseDifficulty \"%s\" in CourseDifficultiesToShow.", i->c_str() );
|
||||||
m_v.push_back( d );
|
m_v.push_back( d );
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-12
@@ -263,7 +263,7 @@ RString Course::GetTranslitFullTitle() const
|
|||||||
* course difficulty doesn't exist, NULL is returned. */
|
* course difficulty doesn't exist, NULL is returned. */
|
||||||
Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
|
Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
|
||||||
{
|
{
|
||||||
ASSERT( cd != Difficulty_Invalid );
|
ASSERT( cd != CourseDifficulty_Invalid );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check to see if the Trail cache is out of date
|
// Check to see if the Trail cache is out of date
|
||||||
@@ -332,13 +332,13 @@ bool Course::GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) c
|
|||||||
/* Sort according to DIFFICULTY_MEDIUM, since the order of songs
|
/* Sort according to DIFFICULTY_MEDIUM, since the order of songs
|
||||||
* must not change across difficulties. */
|
* must not change across difficulties. */
|
||||||
Trail SortTrail;
|
Trail SortTrail;
|
||||||
if( cd == DIFFICULTY_MEDIUM )
|
if( cd == COURSE_DIFFICULTY_REGULAR )
|
||||||
SortTrail = trail;
|
SortTrail = trail;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool bOK = GetTrailUnsorted( st, DIFFICULTY_MEDIUM, SortTrail );
|
bool bOK = GetTrailUnsorted( st, COURSE_DIFFICULTY_REGULAR, SortTrail );
|
||||||
|
|
||||||
/* If we have any other difficulty, we must have DIFFICULTY_MEDIUM. */
|
/* If we have any other difficulty, we must have COURSE_DIFFICULTY_REGULAR. */
|
||||||
ASSERT( bOK );
|
ASSERT( bOK );
|
||||||
}
|
}
|
||||||
ASSERT_M( trail.m_vEntries.size() == SortTrail.m_vEntries.size(),
|
ASSERT_M( trail.m_vEntries.size() == SortTrail.m_vEntries.size(),
|
||||||
@@ -403,8 +403,8 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
|
|||||||
|
|
||||||
switch( cd )
|
switch( cd )
|
||||||
{
|
{
|
||||||
case DIFFICULTY_BEGINNER:
|
case COURSE_DIFFICULTY_BEGINNER:
|
||||||
case DIFFICULTY_CHALLENGE:
|
case COURSE_DIFFICULTY_CHALLENGE:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -434,7 +434,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
|
|||||||
trail.m_CourseDifficulty = cd;
|
trail.m_CourseDifficulty = cd;
|
||||||
|
|
||||||
/* Set to true if CourseDifficulty is able to change something. */
|
/* Set to true if CourseDifficulty is able to change something. */
|
||||||
bool bCourseDifficultyIsSignificant = (cd == DIFFICULTY_MEDIUM);
|
bool bCourseDifficultyIsSignificant = (cd == COURSE_DIFFICULTY_REGULAR);
|
||||||
|
|
||||||
vector<Song*> vpAllPossibleSongs;
|
vector<Song*> vpAllPossibleSongs;
|
||||||
vector<SongAndSteps> vSongAndSteps;
|
vector<SongAndSteps> vSongAndSteps;
|
||||||
@@ -518,9 +518,9 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
|
|||||||
Difficulty dc = resolved.pSteps->GetDifficulty();
|
Difficulty dc = resolved.pSteps->GetDifficulty();
|
||||||
int iLowMeter = e->stepsCriteria.m_iLowMeter;
|
int iLowMeter = e->stepsCriteria.m_iLowMeter;
|
||||||
int iHighMeter = e->stepsCriteria.m_iHighMeter;
|
int iHighMeter = e->stepsCriteria.m_iHighMeter;
|
||||||
if( cd != DIFFICULTY_MEDIUM && !e->bNoDifficult )
|
if( cd != COURSE_DIFFICULTY_REGULAR && !e->bNoDifficult )
|
||||||
{
|
{
|
||||||
Difficulty new_dc = (Difficulty)(dc + cd - DIFFICULTY_MEDIUM);
|
Difficulty new_dc = (Difficulty)(dc + cd - COURSE_DIFFICULTY_REGULAR);
|
||||||
new_dc = clamp( new_dc, (Difficulty)0, (Difficulty)(DIFFICULTY_EDIT-1) );
|
new_dc = clamp( new_dc, (Difficulty)0, (Difficulty)(DIFFICULTY_EDIT-1) );
|
||||||
|
|
||||||
bool bChangedDifficulty = false;
|
bool bChangedDifficulty = false;
|
||||||
@@ -611,7 +611,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
|
|||||||
trail.m_iSpecifiedMeter = m_iCustomMeter[cd];
|
trail.m_iSpecifiedMeter = m_iCustomMeter[cd];
|
||||||
|
|
||||||
/* If the course difficulty never actually changed anything, then this difficulty
|
/* If the course difficulty never actually changed anything, then this difficulty
|
||||||
* is equivalent to DIFFICULTY_MEDIUM; it doesn't exist. */
|
* is equivalent to COURSE_DIFFICULTY_REGULAR; it doesn't exist. */
|
||||||
return bCourseDifficultyIsSignificant;
|
return bCourseDifficultyIsSignificant;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -752,7 +752,7 @@ bool Course::GetTotalSeconds( StepsType st, float& fSecondsOut ) const
|
|||||||
if( !AllSongsAreFixed() )
|
if( !AllSongsAreFixed() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Trail* pTrail = GetTrail( st, DIFFICULTY_MEDIUM );
|
Trail* pTrail = GetTrail( st, COURSE_DIFFICULTY_REGULAR );
|
||||||
|
|
||||||
fSecondsOut = pTrail->GetLengthSeconds();
|
fSecondsOut = pTrail->GetLengthSeconds();
|
||||||
return true;
|
return true;
|
||||||
@@ -792,7 +792,7 @@ void Course::UpdateCourseStats( StepsType st )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Trail* pTrail = GetTrail( st, DIFFICULTY_MEDIUM );
|
const Trail* pTrail = GetTrail( st, COURSE_DIFFICULTY_REGULAR );
|
||||||
|
|
||||||
m_SortOrder_TotalDifficulty += pTrail != NULL? pTrail->GetTotalMeter():0;
|
m_SortOrder_TotalDifficulty += pTrail != NULL? pTrail->GetTotalMeter():0;
|
||||||
|
|
||||||
|
|||||||
@@ -133,11 +133,11 @@ public:
|
|||||||
RString GetTranslitFullTitle() const;
|
RString GetTranslitFullTitle() const;
|
||||||
|
|
||||||
// Dereferences course_entries and returns only the playable Songs and Steps
|
// Dereferences course_entries and returns only the playable Songs and Steps
|
||||||
Trail* GetTrail( StepsType st, CourseDifficulty cd=DIFFICULTY_MEDIUM ) const;
|
Trail* GetTrail( StepsType st, CourseDifficulty cd=COURSE_DIFFICULTY_REGULAR ) const;
|
||||||
Trail* GetTrailForceRegenCache( StepsType st, CourseDifficulty cd=DIFFICULTY_MEDIUM ) const;
|
Trail* GetTrailForceRegenCache( StepsType st, CourseDifficulty cd=COURSE_DIFFICULTY_REGULAR ) const;
|
||||||
void GetTrails( vector<Trail*> &AddTo, StepsType st ) const;
|
void GetTrails( vector<Trail*> &AddTo, StepsType st ) const;
|
||||||
void GetAllTrails( vector<Trail*> &AddTo ) const;
|
void GetAllTrails( vector<Trail*> &AddTo ) const;
|
||||||
int GetMeter( StepsType st, CourseDifficulty cd=DIFFICULTY_MEDIUM ) const;
|
int GetMeter( StepsType st, CourseDifficulty cd=COURSE_DIFFICULTY_REGULAR ) const;
|
||||||
bool HasMods() const;
|
bool HasMods() const;
|
||||||
bool AllSongsAreFixed() const;
|
bool AllSongsAreFixed() const;
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ public:
|
|||||||
bool IsAnEdit() const { return m_LoadedFromProfile != ProfileSlot_Invalid; }
|
bool IsAnEdit() const { return m_LoadedFromProfile != ProfileSlot_Invalid; }
|
||||||
ProfileSlot m_LoadedFromProfile; // ProfileSlot_Invalid if wasn't loaded from a profile
|
ProfileSlot m_LoadedFromProfile; // ProfileSlot_Invalid if wasn't loaded from a profile
|
||||||
|
|
||||||
typedef pair<StepsType,Difficulty> CacheEntry;
|
typedef pair<StepsType,CourseDifficulty> CacheEntry;
|
||||||
struct CacheData
|
struct CacheData
|
||||||
{
|
{
|
||||||
Trail trail;
|
Trail trail;
|
||||||
|
|||||||
@@ -68,12 +68,12 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
|
|||||||
{
|
{
|
||||||
if( sParams.params.size() == 2 )
|
if( sParams.params.size() == 2 )
|
||||||
{
|
{
|
||||||
out.m_iCustomMeter[DIFFICULTY_MEDIUM] = max( atoi(sParams[1]), 0 ); /* compat */
|
out.m_iCustomMeter[COURSE_DIFFICULTY_REGULAR] = max( atoi(sParams[1]), 0 ); /* compat */
|
||||||
}
|
}
|
||||||
else if( sParams.params.size() == 3 )
|
else if( sParams.params.size() == 3 )
|
||||||
{
|
{
|
||||||
const CourseDifficulty cd = StringToCourseDifficulty( sParams[1] );
|
const CourseDifficulty cd = StringToCourseDifficulty( sParams[1] );
|
||||||
if( cd == Difficulty_Invalid )
|
if( cd == CourseDifficulty_Invalid )
|
||||||
{
|
{
|
||||||
LOG->UserLog( "Course file", sPath, "contains an invalid #METER string: \"%s\"", sParams[1].c_str() );
|
LOG->UserLog( "Course file", sPath, "contains an invalid #METER string: \"%s\"", sParams[1].c_str() );
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ void CourseUtil::SortCoursePointerArrayByAvgDifficulty( vector<Course*> &vpCours
|
|||||||
course_sort_val.clear();
|
course_sort_val.clear();
|
||||||
for( unsigned i = 0; i < vpCoursesInOut.size(); ++i )
|
for( unsigned i = 0; i < vpCoursesInOut.size(); ++i )
|
||||||
{
|
{
|
||||||
int iMeter = vpCoursesInOut[i]->GetMeter( GAMESTATE->GetCurrentStyle()->m_StepsType, DIFFICULTY_MEDIUM );
|
int iMeter = vpCoursesInOut[i]->GetMeter( GAMESTATE->GetCurrentStyle()->m_StepsType, COURSE_DIFFICULTY_REGULAR );
|
||||||
course_sort_val[vpCoursesInOut[i]] = ssprintf( "%06i", iMeter );
|
course_sort_val[vpCoursesInOut[i]] = ssprintf( "%06i", iMeter );
|
||||||
}
|
}
|
||||||
sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByTitle );
|
sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByTitle );
|
||||||
@@ -200,7 +200,7 @@ void CourseUtil::MakeDefaultEditCourseEntry( CourseEntry& out )
|
|||||||
// Autogen
|
// Autogen
|
||||||
//////////////////////////////////
|
//////////////////////////////////
|
||||||
|
|
||||||
void CourseUtil::AutogenEndlessFromGroup( const RString &sGroupName, Difficulty diff, Course &out )
|
void CourseUtil::AutogenEndlessFromGroup( const RString &sGroupName, CourseDifficulty cd, Course &out )
|
||||||
{
|
{
|
||||||
out.m_bIsAutogen = true;
|
out.m_bIsAutogen = true;
|
||||||
out.m_bRepeat = true;
|
out.m_bRepeat = true;
|
||||||
@@ -225,7 +225,7 @@ void CourseUtil::AutogenEndlessFromGroup( const RString &sGroupName, Difficulty
|
|||||||
// but that'd be rare.) -glenn
|
// but that'd be rare.) -glenn
|
||||||
CourseEntry e;
|
CourseEntry e;
|
||||||
e.songCriteria.m_sGroupName = sGroupName;
|
e.songCriteria.m_sGroupName = sGroupName;
|
||||||
e.stepsCriteria.m_difficulty = diff;
|
e.stepsCriteria.m_difficulty = (Difficulty)cd;
|
||||||
e.bSecret = true;
|
e.bSecret = true;
|
||||||
|
|
||||||
vector<Song*> vSongs;
|
vector<Song*> vSongs;
|
||||||
@@ -234,9 +234,9 @@ void CourseUtil::AutogenEndlessFromGroup( const RString &sGroupName, Difficulty
|
|||||||
out.m_vEntries.push_back( e );
|
out.m_vEntries.push_back( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CourseUtil::AutogenNonstopFromGroup( const RString &sGroupName, Difficulty diff, Course &out )
|
void CourseUtil::AutogenNonstopFromGroup( const RString &sGroupName, CourseDifficulty cd, Course &out )
|
||||||
{
|
{
|
||||||
AutogenEndlessFromGroup( sGroupName, diff, out );
|
AutogenEndlessFromGroup( sGroupName, cd, out );
|
||||||
|
|
||||||
out.m_bRepeat = false;
|
out.m_bRepeat = false;
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ namespace CourseUtil
|
|||||||
|
|
||||||
void MakeDefaultEditCourseEntry( CourseEntry &out );
|
void MakeDefaultEditCourseEntry( CourseEntry &out );
|
||||||
|
|
||||||
void AutogenEndlessFromGroup( const RString &sGroupName, Difficulty dc, Course &out );
|
void AutogenEndlessFromGroup( const RString &sGroupName, CourseDifficulty cd, Course &out );
|
||||||
void AutogenNonstopFromGroup( const RString &sGroupName, Difficulty dc, Course &out );
|
void AutogenNonstopFromGroup( const RString &sGroupName, CourseDifficulty cd, Course &out );
|
||||||
void AutogenOniFromArtist( const RString &sArtistName, RString sArtistNameTranslit, vector<Song*> aSongs, Difficulty dc, Course &out );
|
void AutogenOniFromArtist( const RString &sArtistName, RString sArtistNameTranslit, vector<Song*> aSongs, Difficulty dc, Course &out );
|
||||||
|
|
||||||
bool ValidateEditCourseName( const RString &sAnswer, RString &sErrorOut );
|
bool ValidateEditCourseName( const RString &sAnswer, RString &sErrorOut );
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ void DifficultyIcon::SetFromTrail( PlayerNumber pn, const Trail* pTrail )
|
|||||||
if( pTrail == NULL )
|
if( pTrail == NULL )
|
||||||
Unset();
|
Unset();
|
||||||
else
|
else
|
||||||
SetFromDifficulty( pTrail->m_CourseDifficulty );
|
SetFromDifficulty( (Difficulty)pTrail->m_CourseDifficulty );
|
||||||
}
|
}
|
||||||
|
|
||||||
void DifficultyIcon::Unset()
|
void DifficultyIcon::Unset()
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ void DifficultyMeter::SetFromTrail( const Trail* pTrail )
|
|||||||
}
|
}
|
||||||
|
|
||||||
CourseDifficulty cd = pTrail->m_CourseDifficulty;
|
CourseDifficulty cd = pTrail->m_CourseDifficulty;
|
||||||
SetInternal( pTrail->GetMeter(), cd, GetCourseDifficultyCommandName( cd ), RString() );
|
SetInternal( pTrail->GetMeter(), (Difficulty)cd, GetCourseDifficultyCommandName( cd ), RString() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void DifficultyMeter::Unset()
|
void DifficultyMeter::Unset()
|
||||||
@@ -184,7 +184,7 @@ void DifficultyMeter::SetFromMeterAndDifficulty( int iMeter, Difficulty dc )
|
|||||||
|
|
||||||
void DifficultyMeter::SetFromMeterAndCourseDifficulty( int iMeter, CourseDifficulty cd )
|
void DifficultyMeter::SetFromMeterAndCourseDifficulty( int iMeter, CourseDifficulty cd )
|
||||||
{
|
{
|
||||||
SetInternal( 0, cd, GetCourseDifficultyCommandName(cd), RString() );
|
SetInternal( 0, (Difficulty)cd, GetCourseDifficultyCommandName(cd), RString() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void DifficultyMeter::SetInternal( int iMeter, Difficulty dc, const RString &sDifficultyCommand, const RString &sDescription )
|
void DifficultyMeter::SetInternal( int iMeter, Difficulty dc, const RString &sDifficultyCommand, const RString &sDescription )
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ void GameCommand::Init()
|
|||||||
m_pStyle = NULL;
|
m_pStyle = NULL;
|
||||||
m_pm = PlayMode_Invalid;
|
m_pm = PlayMode_Invalid;
|
||||||
m_dc = Difficulty_Invalid;
|
m_dc = Difficulty_Invalid;
|
||||||
m_CourseDifficulty = Difficulty_Invalid;
|
m_CourseDifficulty = CourseDifficulty_Invalid;
|
||||||
m_sPreferredModifiers = "";
|
m_sPreferredModifiers = "";
|
||||||
m_sStageModifiers = "";
|
m_sStageModifiers = "";
|
||||||
m_sAnnouncer = "";
|
m_sAnnouncer = "";
|
||||||
@@ -297,7 +297,7 @@ void GameCommand::LoadOne( const Command& cmd )
|
|||||||
RageException::Throw( "Must set Course and Style to set Steps." );
|
RageException::Throw( "Must set Course and Style to set Steps." );
|
||||||
|
|
||||||
const CourseDifficulty cd = StringToCourseDifficulty( sTrail );
|
const CourseDifficulty cd = StringToCourseDifficulty( sTrail );
|
||||||
ASSERT_M( cd != Difficulty_Invalid, ssprintf("Invalid difficulty '%s'", sTrail.c_str()) );
|
ASSERT_M( cd != CourseDifficulty_Invalid, ssprintf("Invalid difficulty '%s'", sTrail.c_str()) );
|
||||||
|
|
||||||
m_pTrail = pCourse->GetTrail( pStyle->m_StepsType, cd );
|
m_pTrail = pCourse->GetTrail( pStyle->m_StepsType, cd );
|
||||||
if( m_pTrail == NULL )
|
if( m_pTrail == NULL )
|
||||||
@@ -697,7 +697,7 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
|
|||||||
if( m_pTrail )
|
if( m_pTrail )
|
||||||
FOREACH_CONST( PlayerNumber, vpns, pn )
|
FOREACH_CONST( PlayerNumber, vpns, pn )
|
||||||
GAMESTATE->m_pCurTrail[*pn].Set( m_pTrail );
|
GAMESTATE->m_pCurTrail[*pn].Set( m_pTrail );
|
||||||
if( m_CourseDifficulty != Difficulty_Invalid )
|
if( m_CourseDifficulty != CourseDifficulty_Invalid )
|
||||||
FOREACH_CONST( PlayerNumber, vpns, pn )
|
FOREACH_CONST( PlayerNumber, vpns, pn )
|
||||||
GAMESTATE->ChangePreferredCourseDifficulty( *pn, m_CourseDifficulty );
|
GAMESTATE->ChangePreferredCourseDifficulty( *pn, m_CourseDifficulty );
|
||||||
if( m_pCharacter )
|
if( m_pCharacter )
|
||||||
@@ -790,7 +790,7 @@ bool GameCommand::IsZero() const
|
|||||||
m_pCourse != NULL ||
|
m_pCourse != NULL ||
|
||||||
m_pTrail != NULL ||
|
m_pTrail != NULL ||
|
||||||
m_pCharacter != NULL ||
|
m_pCharacter != NULL ||
|
||||||
m_CourseDifficulty != Difficulty_Invalid ||
|
m_CourseDifficulty != CourseDifficulty_Invalid ||
|
||||||
!m_sSongGroup.empty() ||
|
!m_sSongGroup.empty() ||
|
||||||
m_SortOrder != SortOrder_Invalid ||
|
m_SortOrder != SortOrder_Invalid ||
|
||||||
m_iWeightPounds != -1 ||
|
m_iWeightPounds != -1 ||
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ void GameState::Reset()
|
|||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
{
|
{
|
||||||
m_PreferredDifficulty[p].Set( Difficulty_Invalid );
|
m_PreferredDifficulty[p].Set( Difficulty_Invalid );
|
||||||
m_PreferredCourseDifficulty[p].Set( DIFFICULTY_MEDIUM );
|
m_PreferredCourseDifficulty[p].Set( COURSE_DIFFICULTY_REGULAR );
|
||||||
}
|
}
|
||||||
m_SortOrder.Set( SortOrder_Invalid );
|
m_SortOrder.Set( SortOrder_Invalid );
|
||||||
m_PreferredSortOrder = GetDefaultSort();
|
m_PreferredSortOrder = GetDefaultSort();
|
||||||
@@ -394,7 +394,7 @@ void GameState::PlayersFinalized()
|
|||||||
m_PreferredSortOrder = pProfile->m_SortOrder;
|
m_PreferredSortOrder = pProfile->m_SortOrder;
|
||||||
if( pProfile->m_LastDifficulty != Difficulty_Invalid )
|
if( pProfile->m_LastDifficulty != Difficulty_Invalid )
|
||||||
m_PreferredDifficulty[pn].Set( pProfile->m_LastDifficulty );
|
m_PreferredDifficulty[pn].Set( pProfile->m_LastDifficulty );
|
||||||
if( pProfile->m_LastCourseDifficulty != Difficulty_Invalid )
|
if( pProfile->m_LastCourseDifficulty != CourseDifficulty_Invalid )
|
||||||
m_PreferredCourseDifficulty[pn].Set( pProfile->m_LastCourseDifficulty );
|
m_PreferredCourseDifficulty[pn].Set( pProfile->m_LastCourseDifficulty );
|
||||||
if( m_pPreferredSong == NULL )
|
if( m_pPreferredSong == NULL )
|
||||||
m_pPreferredSong = pProfile->m_lastSong.ToSong();
|
m_pPreferredSong = pProfile->m_lastSong.ToSong();
|
||||||
@@ -1424,7 +1424,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
|
|||||||
feat.Type = RankingFeat::COURSE;
|
feat.Type = RankingFeat::COURSE;
|
||||||
feat.pCourse = pCourse;
|
feat.pCourse = pCourse;
|
||||||
feat.Feat = ssprintf("MR #%d in %s", i+1, pCourse->GetDisplayFullTitle().c_str() );
|
feat.Feat = ssprintf("MR #%d in %s", i+1, pCourse->GetDisplayFullTitle().c_str() );
|
||||||
if( cd != DIFFICULTY_MEDIUM )
|
if( cd != COURSE_DIFFICULTY_REGULAR )
|
||||||
feat.Feat += " " + CourseDifficultyToLocalizedString(cd);
|
feat.Feat += " " + CourseDifficultyToLocalizedString(cd);
|
||||||
feat.pStringToFill = hs.GetNameMutable();
|
feat.pStringToFill = hs.GetNameMutable();
|
||||||
feat.grade = Grade_NoData;
|
feat.grade = Grade_NoData;
|
||||||
@@ -1693,7 +1693,7 @@ bool GameState::ChangePreferredCourseDifficulty( PlayerNumber pn, int dir )
|
|||||||
while( 1 )
|
while( 1 )
|
||||||
{
|
{
|
||||||
cd = (CourseDifficulty)(cd+dir);
|
cd = (CourseDifficulty)(cd+dir);
|
||||||
if( cd < 0 || cd >= NUM_Difficulty )
|
if( cd < 0 || cd >= NUM_CourseDifficulty )
|
||||||
return false;
|
return false;
|
||||||
if( find(v.begin(),v.end(),cd) == v.end() )
|
if( find(v.begin(),v.end(),cd) == v.end() )
|
||||||
continue; /* not available */
|
continue; /* not available */
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ void Profile::InitGeneralData()
|
|||||||
|
|
||||||
m_SortOrder = SortOrder_Invalid;
|
m_SortOrder = SortOrder_Invalid;
|
||||||
m_LastDifficulty = Difficulty_Invalid;
|
m_LastDifficulty = Difficulty_Invalid;
|
||||||
m_LastCourseDifficulty = Difficulty_Invalid;
|
m_LastCourseDifficulty = CourseDifficulty_Invalid;
|
||||||
m_lastSong.Unset();
|
m_lastSong.Unset();
|
||||||
m_lastCourse.Unset();
|
m_lastCourse.Unset();
|
||||||
m_iTotalPlays = 0;
|
m_iTotalPlays = 0;
|
||||||
@@ -1906,13 +1906,13 @@ public:
|
|||||||
static int GetTotalNumSongsPlayed( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iNumTotalSongsPlayed ); return 1; }
|
static int GetTotalNumSongsPlayed( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iNumTotalSongsPlayed ); return 1; }
|
||||||
static int IsCodeUnlocked( T* p, lua_State *L ) { lua_pushboolean(L, p->IsCodeUnlocked(SArg(1)) ); return 1; }
|
static int IsCodeUnlocked( T* p, lua_State *L ) { lua_pushboolean(L, p->IsCodeUnlocked(SArg(1)) ); return 1; }
|
||||||
static int GetSongsActual( T* p, lua_State *L ) { lua_pushnumber(L, p->GetSongsActual(Enum::Check<StepsType>(L, 1),Enum::Check<Difficulty>(L, 2)) ); return 1; }
|
static int GetSongsActual( T* p, lua_State *L ) { lua_pushnumber(L, p->GetSongsActual(Enum::Check<StepsType>(L, 1),Enum::Check<Difficulty>(L, 2)) ); return 1; }
|
||||||
static int GetCoursesActual( T* p, lua_State *L ) { lua_pushnumber(L, p->GetCoursesActual(Enum::Check<StepsType>(L, 1),Enum::Check<Difficulty>(L, 2)) ); return 1; }
|
static int GetCoursesActual( T* p, lua_State *L ) { lua_pushnumber(L, p->GetCoursesActual(Enum::Check<StepsType>(L, 1),Enum::Check<CourseDifficulty>(L, 2)) ); return 1; }
|
||||||
static int GetSongsPossible( T* p, lua_State *L ) { lua_pushnumber(L, p->GetSongsPossible(Enum::Check<StepsType>(L, 1),Enum::Check<Difficulty>(L, 2)) ); return 1; }
|
static int GetSongsPossible( T* p, lua_State *L ) { lua_pushnumber(L, p->GetSongsPossible(Enum::Check<StepsType>(L, 1),Enum::Check<Difficulty>(L, 2)) ); return 1; }
|
||||||
static int GetCoursesPossible( T* p, lua_State *L ) { lua_pushnumber(L, p->GetCoursesPossible(Enum::Check<StepsType>(L, 1),Enum::Check<Difficulty>(L, 2)) ); return 1; }
|
static int GetCoursesPossible( T* p, lua_State *L ) { lua_pushnumber(L, p->GetCoursesPossible(Enum::Check<StepsType>(L, 1),Enum::Check<CourseDifficulty>(L, 2)) ); return 1; }
|
||||||
static int GetSongsPercentComplete( T* p, lua_State *L ) { lua_pushnumber(L, p->GetSongsPercentComplete(Enum::Check<StepsType>(L, 1),Enum::Check<Difficulty>(L, 2)) ); return 1; }
|
static int GetSongsPercentComplete( T* p, lua_State *L ) { lua_pushnumber(L, p->GetSongsPercentComplete(Enum::Check<StepsType>(L, 1),Enum::Check<Difficulty>(L, 2)) ); return 1; }
|
||||||
static int GetCoursesPercentComplete( T* p, lua_State *L ) { lua_pushnumber(L, p->GetCoursesPercentComplete(Enum::Check<StepsType>(L, 1),Enum::Check<Difficulty>(L, 2)) ); return 1; }
|
static int GetCoursesPercentComplete( T* p, lua_State *L ) { lua_pushnumber(L, p->GetCoursesPercentComplete(Enum::Check<StepsType>(L, 1),Enum::Check<CourseDifficulty>(L, 2)) ); return 1; }
|
||||||
static int GetTotalStepsWithTopGrade( T* p, lua_State *L ) { lua_pushnumber(L, p->GetTotalStepsWithTopGrade(Enum::Check<StepsType>(L, 1),Enum::Check<Difficulty>(L, 2),Enum::Check<Grade>(L, 3)) ); return 1; }
|
static int GetTotalStepsWithTopGrade( T* p, lua_State *L ) { lua_pushnumber(L, p->GetTotalStepsWithTopGrade(Enum::Check<StepsType>(L, 1),Enum::Check<Difficulty>(L, 2),Enum::Check<Grade>(L, 3)) ); return 1; }
|
||||||
static int GetTotalTrailsWithTopGrade( T* p, lua_State *L ) { lua_pushnumber(L, p->GetTotalTrailsWithTopGrade(Enum::Check<StepsType>(L, 1),Enum::Check<Difficulty>(L, 2),Enum::Check<Grade>(L, 3)) ); return 1; }
|
static int GetTotalTrailsWithTopGrade( T* p, lua_State *L ) { lua_pushnumber(L, p->GetTotalTrailsWithTopGrade(Enum::Check<StepsType>(L, 1),Enum::Check<CourseDifficulty>(L, 2),Enum::Check<Grade>(L, 3)) ); return 1; }
|
||||||
static int GetNumTotalSongsPlayed( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iNumTotalSongsPlayed ); return 1; }
|
static int GetNumTotalSongsPlayed( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iNumTotalSongsPlayed ); return 1; }
|
||||||
static int GetLastPlayedStepsType( T* p, lua_State *L ) { lua_pushnumber(L, p->GetLastPlayedStepsType() ); return 1; }
|
static int GetLastPlayedStepsType( T* p, lua_State *L ) { lua_pushnumber(L, p->GetLastPlayedStepsType() ); return 1; }
|
||||||
static int GetSongsAndCoursesPercentCompleteAllDifficulties( T* p, lua_State *L ) { lua_pushnumber(L, p->GetSongsAndCoursesPercentCompleteAllDifficulties(Enum::Check<StepsType>(L, 1)) ); return 1; }
|
static int GetSongsAndCoursesPercentCompleteAllDifficulties( T* p, lua_State *L ) { lua_pushnumber(L, p->GetSongsAndCoursesPercentCompleteAllDifficulties(Enum::Check<StepsType>(L, 1)) ); return 1; }
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ void ScreenOptionsEditCourseEntry::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
Song *pSong = ce.pSong;
|
Song *pSong = ce.pSong;
|
||||||
Steps *pSteps;
|
Steps *pSteps;
|
||||||
StepsType st = GAMESTATE->m_stEdit;
|
StepsType st = GAMESTATE->m_stEdit;
|
||||||
CourseDifficulty cd = ( ce.stepsCriteria.m_difficulty == Difficulty_Invalid ?
|
CourseDifficulty cd = CourseDifficulty( ce.stepsCriteria.m_difficulty == Difficulty_Invalid ?
|
||||||
GAMESTATE->m_cdEdit : ce.stepsCriteria.m_difficulty );
|
GAMESTATE->m_cdEdit : ce.stepsCriteria.m_difficulty );
|
||||||
|
|
||||||
if( pSong == NULL )
|
if( pSong == NULL )
|
||||||
@@ -274,11 +274,11 @@ void ScreenOptionsEditCourseEntry::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Try to find steps first using st and cd, then st, then cd, then any.
|
// Try to find steps first using st and cd, then st, then cd, then any.
|
||||||
pSteps = SongUtil::GetStepsByDifficulty( pSong, st, cd, false );
|
pSteps = SongUtil::GetStepsByDifficulty( pSong, st, (Difficulty)cd, false );
|
||||||
if( !pSteps )
|
if( !pSteps )
|
||||||
pSteps = SongUtil::GetStepsByDifficulty( pSong, st, Difficulty_Invalid, false );
|
pSteps = SongUtil::GetStepsByDifficulty( pSong, st, Difficulty_Invalid, false );
|
||||||
if( !pSteps )
|
if( !pSteps )
|
||||||
pSteps = SongUtil::GetStepsByDifficulty( pSong, StepsType_Invalid, cd, false );
|
pSteps = SongUtil::GetStepsByDifficulty( pSong, StepsType_Invalid, (Difficulty)cd, false );
|
||||||
if( !pSteps )
|
if( !pSteps )
|
||||||
pSteps = SongUtil::GetStepsByDifficulty( pSong, StepsType_Invalid, Difficulty_Invalid, false );
|
pSteps = SongUtil::GetStepsByDifficulty( pSong, StepsType_Invalid, Difficulty_Invalid, false );
|
||||||
ASSERT( pSteps );
|
ASSERT( pSteps );
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ static void RefreshTrail()
|
|||||||
struct StepsTypeAndDifficulty
|
struct StepsTypeAndDifficulty
|
||||||
{
|
{
|
||||||
StepsType st;
|
StepsType st;
|
||||||
Difficulty cd;
|
CourseDifficulty cd;
|
||||||
|
|
||||||
StepsTypeAndDifficulty( const StepsType &s, const Difficulty &d ) : st( s ), cd( d ) { }
|
StepsTypeAndDifficulty( const StepsType &s, const CourseDifficulty &d ) : st( s ), cd( d ) { }
|
||||||
bool operator==( const StepsTypeAndDifficulty &stad ) const { return st == stad.st && cd == stad.cd; }
|
bool operator==( const StepsTypeAndDifficulty &stad ) const { return st == stad.st && cd == stad.cd; }
|
||||||
};
|
};
|
||||||
static void SetNextCombination()
|
static void SetNextCombination()
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ void ScoreScroller::ConfigureActor( Actor *pActor, int iItem )
|
|||||||
{
|
{
|
||||||
BitmapText* pTextStepsScore = &item.m_textScore[*cd];
|
BitmapText* pTextStepsScore = &item.m_textScore[*cd];
|
||||||
|
|
||||||
const Trail *pTrail = pCourse->GetTrail( m_StepsType, *cd );
|
const Trail *pTrail = pCourse->GetTrail( m_StepsType, (CourseDifficulty)*cd );
|
||||||
if( UNLOCKMAN->CourseIsLocked(pCourse) )
|
if( UNLOCKMAN->CourseIsLocked(pCourse) )
|
||||||
pTrail = NULL;
|
pTrail = NULL;
|
||||||
pTextStepsScore->SetHidden( pTrail==NULL );
|
pTextStepsScore->SetHidden( pTrail==NULL );
|
||||||
@@ -417,7 +417,7 @@ void ScreenRankingScroller::Init()
|
|||||||
if( m_PageType == PageType_AllSteps )
|
if( m_PageType == PageType_AllSteps )
|
||||||
m_sprDifficulty[*d].Load( THEME->GetPathG(m_sName,"difficulty "+DifficultyToString(*d)) );
|
m_sprDifficulty[*d].Load( THEME->GetPathG(m_sName,"difficulty "+DifficultyToString(*d)) );
|
||||||
else
|
else
|
||||||
m_sprDifficulty[*d].Load( THEME->GetPathG(m_sName,"CourseDifficulty "+CourseDifficultyToString(*d)) );
|
m_sprDifficulty[*d].Load( THEME->GetPathG(m_sName,"CourseDifficulty "+CourseDifficultyToString((CourseDifficulty)*d)) );
|
||||||
m_sprDifficulty[*d]->SetName( "Difficulty"+DifficultyToString(*d) );
|
m_sprDifficulty[*d]->SetName( "Difficulty"+DifficultyToString(*d) );
|
||||||
m_sprDifficulty[*d]->SetXY( DIFFICULTY_X(*d), DIFFICULTY_Y );
|
m_sprDifficulty[*d]->SetXY( DIFFICULTY_X(*d), DIFFICULTY_Y );
|
||||||
this->AddChild( m_sprDifficulty[*d] );
|
this->AddChild( m_sprDifficulty[*d] );
|
||||||
|
|||||||
@@ -748,11 +748,11 @@ void SongManager::InitAutogenCourses()
|
|||||||
|
|
||||||
// Generate random courses from each group.
|
// Generate random courses from each group.
|
||||||
pCourse = new Course;
|
pCourse = new Course;
|
||||||
CourseUtil::AutogenEndlessFromGroup( sGroupName, DIFFICULTY_MEDIUM, *pCourse );
|
CourseUtil::AutogenEndlessFromGroup( sGroupName, COURSE_DIFFICULTY_REGULAR, *pCourse );
|
||||||
m_pCourses.push_back( pCourse );
|
m_pCourses.push_back( pCourse );
|
||||||
|
|
||||||
pCourse = new Course;
|
pCourse = new Course;
|
||||||
CourseUtil::AutogenNonstopFromGroup( sGroupName, DIFFICULTY_MEDIUM, *pCourse );
|
CourseUtil::AutogenNonstopFromGroup( sGroupName, COURSE_DIFFICULTY_REGULAR, *pCourse );
|
||||||
m_pCourses.push_back( pCourse );
|
m_pCourses.push_back( pCourse );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -760,7 +760,7 @@ void SongManager::InitAutogenCourses()
|
|||||||
|
|
||||||
// Generate "All Songs" endless course.
|
// Generate "All Songs" endless course.
|
||||||
pCourse = new Course;
|
pCourse = new Course;
|
||||||
CourseUtil::AutogenEndlessFromGroup( "", DIFFICULTY_MEDIUM, *pCourse );
|
CourseUtil::AutogenEndlessFromGroup( "", COURSE_DIFFICULTY_REGULAR, *pCourse );
|
||||||
m_pCourses.push_back( pCourse );
|
m_pCourses.push_back( pCourse );
|
||||||
|
|
||||||
/* Generate Oni courses from artists. Only create courses if we have at least
|
/* Generate Oni courses from artists. Only create courses if we have at least
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public:
|
|||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
m_StepsType = StepsType_Invalid;
|
m_StepsType = StepsType_Invalid;
|
||||||
m_CourseDifficulty = Difficulty_Invalid;
|
m_CourseDifficulty = CourseDifficulty_Invalid;
|
||||||
m_iSpecifiedMeter = -1;
|
m_iSpecifiedMeter = -1;
|
||||||
m_vEntries.clear();
|
m_vEntries.clear();
|
||||||
m_bRadarValuesCached = false;
|
m_bRadarValuesCached = false;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ void TrailID::FromTrail( const Trail *p )
|
|||||||
if( p == NULL )
|
if( p == NULL )
|
||||||
{
|
{
|
||||||
st = StepsType_Invalid;
|
st = StepsType_Invalid;
|
||||||
cd = Difficulty_Invalid;
|
cd = CourseDifficulty_Invalid;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -24,7 +24,7 @@ Trail *TrailID::ToTrail( const Course *p, bool bAllowNull ) const
|
|||||||
{
|
{
|
||||||
ASSERT( p );
|
ASSERT( p );
|
||||||
|
|
||||||
if( st == StepsType_Invalid || cd == Difficulty_Invalid )
|
if( st == StepsType_Invalid || cd == CourseDifficulty_Invalid )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Trail *ret = p->GetTrail( st, cd );
|
Trail *ret = p->GetTrail( st, cd );
|
||||||
@@ -66,7 +66,7 @@ RString TrailID::ToString() const
|
|||||||
|
|
||||||
bool TrailID::IsValid() const
|
bool TrailID::IsValid() const
|
||||||
{
|
{
|
||||||
return st != StepsType_Invalid && cd != Difficulty_Invalid;
|
return st != StepsType_Invalid && cd != CourseDifficulty_Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TrailID::operator<( const TrailID &rhs ) const
|
bool TrailID::operator<( const TrailID &rhs ) const
|
||||||
|
|||||||
Reference in New Issue
Block a user