steps locking fixes

This commit is contained in:
Glenn Maynard
2005-05-08 11:55:56 +00:00
parent ed1c6ff32f
commit f2bb1b373f
3 changed files with 13 additions and 7 deletions
+5 -1
View File
@@ -23,6 +23,7 @@
#include "NoteDataUtil.h"
#include "ProfileManager.h"
#include "Foreach.h"
#include "UnlockManager.h"
#include "NotesLoaderSM.h"
#include "NotesLoaderDWI.h"
@@ -931,7 +932,7 @@ Steps* Song::GetStepsByDescription( StepsType st, CString sDescription ) const
}
Steps* Song::GetClosestNotes( StepsType st, Difficulty dc ) const
Steps* Song::GetClosestNotes( StepsType st, Difficulty dc, bool bIgnoreLocked ) const
{
ASSERT( dc != DIFFICULTY_INVALID );
@@ -944,6 +945,9 @@ Steps* Song::GetClosestNotes( StepsType st, Difficulty dc ) const
if( pSteps->GetDifficulty() == DIFFICULTY_EDIT && dc != DIFFICULTY_EDIT )
continue;
if( bIgnoreLocked && UNLOCKMAN->StepsIsLocked(this, pSteps) )
continue;
int iDistance = abs(dc - pSteps->GetDifficulty());
if( iDistance < iClosestDistance )
{
+7 -5
View File
@@ -10,6 +10,7 @@
#include "XmlFile.h"
#include "PrefsManager.h"
#include "Foreach.h"
#include "UnlockManager.h"
/////////////////////////////////////
@@ -273,28 +274,28 @@ CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
case SORT_EASY_METER:
{
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_EASY);
if( pSteps )
if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
return ssprintf("%02d", pSteps->GetMeter() );
return "N/A";
}
case SORT_MEDIUM_METER:
{
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_MEDIUM);
if( pSteps )
if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
return ssprintf("%02d", pSteps->GetMeter() );
return "N/A";
}
case SORT_HARD_METER:
{
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_HARD);
if( pSteps )
if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
return ssprintf("%02d", pSteps->GetMeter() );
return "N/A";
}
case SORT_CHALLENGE_METER:
{
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_CHALLENGE);
if( pSteps )
if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
return ssprintf("%02d", pSteps->GetMeter() );
return "N/A";
}
@@ -333,7 +334,8 @@ void SongUtil::SortSongPointerArrayByMeter( vector<Song*> &vpSongsInOut, Difficu
song_sort_val.clear();
for(unsigned i = 0; i < vpSongsInOut.size(); ++i)
{
const Steps* pSteps = vpSongsInOut[i]->GetClosestNotes( GAMESTATE->GetCurrentStyle()->m_StepsType, dc );
/* Ignore locked steps. */
const Steps* pSteps = vpSongsInOut[i]->GetClosestNotes( GAMESTATE->GetCurrentStyle()->m_StepsType, dc, true );
CString &s = song_sort_val[vpSongsInOut[i]];
s = ssprintf("%03d", pSteps ? pSteps->GetMeter() : 0);
+1 -1
View File
@@ -203,7 +203,7 @@ public:
Steps* GetStepsByDifficulty( StepsType st, Difficulty dc, bool bIncludeAutoGen = true ) const;
Steps* GetStepsByMeter( StepsType st, int iMeterLow, int iMeterHigh ) const;
Steps* GetStepsByDescription( StepsType st, CString sDescription ) const;
Steps* GetClosestNotes( StepsType st, Difficulty dc ) const;
Steps* GetClosestNotes( StepsType st, Difficulty dc, bool bIgnoreLocked=false ) const;
bool IsEasy( StepsType st ) const;
bool IsTutorial() const;
bool HasEdits( StepsType st ) const;