updated course unlocking to take transliterated (non-translated) titles
redid code for unlock screen so courses and songs are displayed
This commit is contained in:
@@ -121,8 +121,10 @@ void Course::LoadFromCRSFile( CString sPath )
|
||||
|
||||
// handle the data
|
||||
if( 0 == stricmp(sValueName, "COURSE") )
|
||||
{
|
||||
m_sName = sParams[1];
|
||||
|
||||
m_sTranslitName = m_sName;
|
||||
}
|
||||
else if( 0 == stricmp(sValueName, "REPEAT") )
|
||||
{
|
||||
CString str = sParams[1];
|
||||
|
||||
@@ -44,9 +44,10 @@ class Course
|
||||
public:
|
||||
Course();
|
||||
|
||||
bool m_bIsAutogen; // was this created by AutoGen?
|
||||
bool m_bIsAutogen; // was this created by AutoGen?
|
||||
CString m_sPath;
|
||||
CString m_sName;
|
||||
CString m_sTranslitName; // used for unlocks
|
||||
|
||||
bool HasBanner() const;
|
||||
|
||||
|
||||
@@ -36,19 +36,26 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
||||
for(int i=1; i <= THEME->GetMetricI("ScreenUnlock", "NumUnlocks"); i++)
|
||||
{
|
||||
// new unlock graphic
|
||||
Unlocks[i].Load( THEME->GetPathToG(ssprintf("ScreenUnlock icon %d", i)) );
|
||||
Unlocks[i].Load( THEME->GetPathToG(ssprintf("ScreenUnlock %d icon", i)) );
|
||||
|
||||
// set graphic location
|
||||
Unlocks[i].SetName( ssprintf("Unlock%d",i) );
|
||||
SET_XY( Unlocks[i] );
|
||||
|
||||
Song *pSong = SONGMAN->FindSong("", THEME->GetMetric("ScreenUnlock", ssprintf("Unlock%dSong", i)) );
|
||||
if( pSong == NULL )
|
||||
// get pertaining songentry
|
||||
SongEntry *pSong = GAMESTATE->m_pUnlockingSys->FindSong(
|
||||
THEME->GetMetric("ScreenUnlock",
|
||||
ssprintf("Unlock%dSong", i)) );
|
||||
|
||||
LOG->Trace("UnlockScreen: Searching for %s", THEME->GetMetric("ScreenUnlock",
|
||||
ssprintf("Unlock%dSong", i)).c_str() );
|
||||
|
||||
if( pSong == NULL)
|
||||
continue;
|
||||
|
||||
Unlocks[i].Command(IconCommand);
|
||||
|
||||
const bool SongIsLocked = GAMESTATE->m_pUnlockingSys->SongIsLocked( pSong );
|
||||
if ( !SongIsLocked )
|
||||
if ( !pSong->isLocked )
|
||||
this->AddChild(&Unlocks[i]);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ bool UnlockSystem::CourseIsLocked( const Course *course )
|
||||
|
||||
if (p)
|
||||
{
|
||||
p->isCourse = true; // updates flag here
|
||||
p->updateLocked();
|
||||
|
||||
if (!p->isLocked) tmp = "un";
|
||||
@@ -91,14 +92,25 @@ bool UnlockSystem::SongIsRoulette( const Song *song )
|
||||
return p && (p->m_iRouletteSeed != 0) ;
|
||||
}
|
||||
|
||||
SongEntry *UnlockSystem::FindSong( CString songname )
|
||||
{
|
||||
songname.MakeUpper();
|
||||
for(int i = 0; i < m_SongEntries.size(); i++)
|
||||
if (songname == m_SongEntries[i].m_sSongName)
|
||||
return &m_SongEntries[i];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SongEntry *UnlockSystem::FindCourse( const Course *pCourse )
|
||||
{
|
||||
CString CourseName = pCourse->m_sName;
|
||||
CString CourseName = pCourse->m_sTranslitName;
|
||||
|
||||
CourseName.MakeUpper();
|
||||
|
||||
for(unsigned i = 0; i < m_SongEntries.size(); i++)
|
||||
{
|
||||
|
||||
if( CourseName == m_SongEntries[i].m_sSongName )
|
||||
return &m_SongEntries[i];
|
||||
}
|
||||
@@ -106,7 +118,6 @@ SongEntry *UnlockSystem::FindCourse( const Course *pCourse )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SongEntry *UnlockSystem::FindSong( const Song *pSong )
|
||||
{
|
||||
/* Manual binary searches are a bad idea; they're insanely easy to get
|
||||
@@ -165,6 +176,7 @@ SongEntry::SongEntry()
|
||||
m_iRouletteSeed = 0;
|
||||
|
||||
isLocked = true;
|
||||
isCourse = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ struct SongEntry
|
||||
int m_iRouletteSeed;
|
||||
|
||||
bool isLocked; // cached locked tag
|
||||
bool isCourse; // used for unlock screen
|
||||
|
||||
SongEntry();
|
||||
|
||||
@@ -56,6 +57,9 @@ public:
|
||||
float ArcadePointsUntilNextUnlock();
|
||||
float SongPointsUntilNextUnlock();
|
||||
|
||||
SongEntry *FindSong( CString songname );
|
||||
// used for screen unlock
|
||||
|
||||
bool SongIsLocked( const Song *song );
|
||||
bool CourseIsLocked( const Course *course );
|
||||
|
||||
@@ -74,6 +78,8 @@ public:
|
||||
float UnlockToasty();
|
||||
bool RouletteUnlock( const Song *song );
|
||||
|
||||
|
||||
|
||||
void DebugPrint();
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user