This commit is contained in:
Glenn Maynard
2003-07-09 04:46:24 +00:00
parent 165bd52e6e
commit f9b12e9e8e
4 changed files with 25 additions and 6 deletions
+2 -2
View File
@@ -316,7 +316,7 @@ void MusicWheel::GetSongList(vector<Song*> &arraySongs, SongSortOrder so, CStrin
continue;
if( so==SORT_ROULETTE && !pSong->RouletteDisplayed() )
continue;
if( so==SORT_ROULETTE && GAMESTATE->m_pUnlockingSys->SongIsRoulette( pSong->GetFullTranslitTitle() ) )
if( so==SORT_ROULETTE && GAMESTATE->m_pUnlockingSys->SongIsRoulette( pSong ) )
continue;
}
@@ -328,7 +328,7 @@ void MusicWheel::GetSongList(vector<Song*> &arraySongs, SongSortOrder so, CStrin
// If we're using unlocks, check it here to prevent from being shown
if( PREFSMAN->m_bUseUnlockSystem )
{
pSong->m_bIsLocked = GAMESTATE->m_pUnlockingSys->SongIsLocked( pSong->GetFullTranslitTitle() );
pSong->m_bIsLocked = GAMESTATE->m_pUnlockingSys->SongIsLocked( pSong );
if( pSong->m_bIsLocked ) { continue; }
}
arraySongs.push_back( pSong );
+6 -2
View File
@@ -16,6 +16,7 @@
#include "GameState.h"
#include "RageLog.h"
#include "UnlockSystem.h"
#include "SongManager.h"
ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
{
@@ -33,8 +34,11 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
Unlocks[i].SetName( ssprintf("Unlock%d",i) );
SET_XY( Unlocks[i] );
const bool SongIsLocked = GAMESTATE->m_pUnlockingSys->SongIsLocked
(THEME->GetMetric("ScreenUnlock", ssprintf("Unlock%dSong", i)));
Song *pSong = SONGMAN->FindSong("", THEME->GetMetric("ScreenUnlock", ssprintf("Unlock%dSong", i)) );
if( pSong == NULL )
continue;
const bool SongIsLocked = GAMESTATE->m_pUnlockingSys->SongIsLocked( pSong );
if ( !SongIsLocked )
this->AddChild(&Unlocks[i]);
}
+11
View File
@@ -13,6 +13,7 @@
#include "global.h"
#include "PrefsManager.h"
#include "RageLog.h"
#include "Song.h"
#include "RageException.h"
#include "RageUtil.h"
#include "UnlockSystem.h"
@@ -27,6 +28,16 @@ UnlockSystem::UnlockSystem()
}
bool UnlockSystem::SongIsLocked( const Song *song )
{
return SongIsLocked( song->GetFullTranslitTitle() );
}
bool UnlockSystem::SongIsRoulette( const Song *song )
{
return SongIsRoulette( song->GetFullTranslitTitle() );
}
bool UnlockSystem::SongIsLocked( CString sSongName )
{
sSongName.MakeUpper(); //Avoid case-sensitive problems
+6 -2
View File
@@ -17,6 +17,8 @@ enum UnlockTypes { UNLOCK_AP, UNLOCK_DP, UNLOCK_SP,
UNLOCK_EC, UNLOCK_EF, UNLOCK_SC,
UNLOCK_TT, UNLOCK_RO};
class Song;
struct SongEntry
{
CString m_sSongName; /* Name of the song in the DWI/SM file itself.. This allows
@@ -50,8 +52,8 @@ class UnlockSystem
public:
UnlockSystem();
float NumPointsUntilNextUnlock();
bool SongIsLocked( CString sSongName );
bool SongIsRoulette( CString sSongName );
bool SongIsLocked( const Song *song );
bool SongIsRoulette( const Song *song );
bool LoadFromDATFile( CString sPath );
vector<SongEntry> m_SongEntries; // All locked songs are stored here
@@ -68,6 +70,8 @@ public:
private:
void SortSongEntriesArray(); // sorts unlocks
bool ParseRow(CString text, CString &type, float &qty, CString &songname);
bool SongIsLocked( CString sSongName );
bool SongIsRoulette( CString sSongName );
};