steps locking fixes
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
#include "NoteDataUtil.h"
|
#include "NoteDataUtil.h"
|
||||||
#include "ProfileManager.h"
|
#include "ProfileManager.h"
|
||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
|
#include "UnlockManager.h"
|
||||||
|
|
||||||
#include "NotesLoaderSM.h"
|
#include "NotesLoaderSM.h"
|
||||||
#include "NotesLoaderDWI.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 );
|
ASSERT( dc != DIFFICULTY_INVALID );
|
||||||
|
|
||||||
@@ -944,6 +945,9 @@ Steps* Song::GetClosestNotes( StepsType st, Difficulty dc ) const
|
|||||||
|
|
||||||
if( pSteps->GetDifficulty() == DIFFICULTY_EDIT && dc != DIFFICULTY_EDIT )
|
if( pSteps->GetDifficulty() == DIFFICULTY_EDIT && dc != DIFFICULTY_EDIT )
|
||||||
continue;
|
continue;
|
||||||
|
if( bIgnoreLocked && UNLOCKMAN->StepsIsLocked(this, pSteps) )
|
||||||
|
continue;
|
||||||
|
|
||||||
int iDistance = abs(dc - pSteps->GetDifficulty());
|
int iDistance = abs(dc - pSteps->GetDifficulty());
|
||||||
if( iDistance < iClosestDistance )
|
if( iDistance < iClosestDistance )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "XmlFile.h"
|
#include "XmlFile.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
|
#include "UnlockManager.h"
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
@@ -273,28 +274,28 @@ CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
|
|||||||
case SORT_EASY_METER:
|
case SORT_EASY_METER:
|
||||||
{
|
{
|
||||||
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_EASY);
|
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_EASY);
|
||||||
if( pSteps )
|
if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
|
||||||
return ssprintf("%02d", pSteps->GetMeter() );
|
return ssprintf("%02d", pSteps->GetMeter() );
|
||||||
return "N/A";
|
return "N/A";
|
||||||
}
|
}
|
||||||
case SORT_MEDIUM_METER:
|
case SORT_MEDIUM_METER:
|
||||||
{
|
{
|
||||||
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_MEDIUM);
|
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_MEDIUM);
|
||||||
if( pSteps )
|
if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
|
||||||
return ssprintf("%02d", pSteps->GetMeter() );
|
return ssprintf("%02d", pSteps->GetMeter() );
|
||||||
return "N/A";
|
return "N/A";
|
||||||
}
|
}
|
||||||
case SORT_HARD_METER:
|
case SORT_HARD_METER:
|
||||||
{
|
{
|
||||||
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_HARD);
|
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_HARD);
|
||||||
if( pSteps )
|
if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
|
||||||
return ssprintf("%02d", pSteps->GetMeter() );
|
return ssprintf("%02d", pSteps->GetMeter() );
|
||||||
return "N/A";
|
return "N/A";
|
||||||
}
|
}
|
||||||
case SORT_CHALLENGE_METER:
|
case SORT_CHALLENGE_METER:
|
||||||
{
|
{
|
||||||
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_CHALLENGE);
|
Steps* pSteps = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_CHALLENGE);
|
||||||
if( pSteps )
|
if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
|
||||||
return ssprintf("%02d", pSteps->GetMeter() );
|
return ssprintf("%02d", pSteps->GetMeter() );
|
||||||
return "N/A";
|
return "N/A";
|
||||||
}
|
}
|
||||||
@@ -333,7 +334,8 @@ void SongUtil::SortSongPointerArrayByMeter( vector<Song*> &vpSongsInOut, Difficu
|
|||||||
song_sort_val.clear();
|
song_sort_val.clear();
|
||||||
for(unsigned i = 0; i < vpSongsInOut.size(); ++i)
|
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]];
|
CString &s = song_sort_val[vpSongsInOut[i]];
|
||||||
s = ssprintf("%03d", pSteps ? pSteps->GetMeter() : 0);
|
s = ssprintf("%03d", pSteps ? pSteps->GetMeter() : 0);
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ public:
|
|||||||
Steps* GetStepsByDifficulty( StepsType st, Difficulty dc, bool bIncludeAutoGen = true ) const;
|
Steps* GetStepsByDifficulty( StepsType st, Difficulty dc, bool bIncludeAutoGen = true ) const;
|
||||||
Steps* GetStepsByMeter( StepsType st, int iMeterLow, int iMeterHigh ) const;
|
Steps* GetStepsByMeter( StepsType st, int iMeterLow, int iMeterHigh ) const;
|
||||||
Steps* GetStepsByDescription( StepsType st, CString sDescription ) 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 IsEasy( StepsType st ) const;
|
||||||
bool IsTutorial() const;
|
bool IsTutorial() const;
|
||||||
bool HasEdits( StepsType st ) const;
|
bool HasEdits( StepsType st ) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user