added choice of which points to display for unlocking between dance, arcade, and song points

This commit is contained in:
Andrew Wong
2003-07-09 06:05:43 +00:00
parent 2af0ab21ed
commit 1bbbab816f
3 changed files with 43 additions and 11 deletions
+17 -4
View File
@@ -24,7 +24,11 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
PointsUntilNextUnlock.LoadFromFont( THEME->GetPathToF("Common normal") );
PointsUntilNextUnlock.SetHorizAlign( Actor::align_left );
CString sDP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->NumPointsUntilNextUnlock() );
CString sDP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->DancePointsUntilNextUnlock() );
CString sAP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->ArcadePointsUntilNextUnlock() );
CString sSP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->SongPointsUntilNextUnlock() );
CString PointDisplay = THEME->GetMetric("ScreenUnlock", "TypeOfPointsToDisplay");
for(int i=1; i <= THEME->GetMetricI("ScreenUnlock", "NumUnlocks"); i++)
{
@@ -47,9 +51,18 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
if( sDP.Left(1) == "-" )
sDP = "*";
PointsUntilNextUnlock.SetName( "DancePointsDisplay" );
PointsUntilNextUnlock.SetText( sDP );
PointsUntilNextUnlock.SetZoom( THEME->GetMetricF("ScreenUnlock","DancePointsZoom") );
PointsUntilNextUnlock.SetName( "PointsDisplay" );
if (PointDisplay == "DP" || PointDisplay == "Dance")
PointsUntilNextUnlock.SetText( sDP );
if (PointDisplay == "AP" || PointDisplay == "Arcade")
PointsUntilNextUnlock.SetText( sAP );
if (PointDisplay == "SP" || PointDisplay == "Song")
PointsUntilNextUnlock.SetText( sSP );
PointsUntilNextUnlock.SetZoom( THEME->GetMetricF("ScreenUnlock","PointsZoom") );
SET_XY( PointsUntilNextUnlock );
this->AddChild( &PointsUntilNextUnlock );
}
+23 -6
View File
@@ -245,22 +245,39 @@ bool SongEntry::SelectableRoulette()
return false;
}
float UnlockSystem::NumPointsUntilNextUnlock()
float UnlockSystem::DancePointsUntilNextUnlock()
{
float fSmallestPoints = 400000000; // or an arbitrarily large value
for( unsigned a=0; a<m_SongEntries.size(); a++ )
{
// old line: if( m_SongEntries[a].m_fDancePointsRequired >= fSmallestPoints )
// new: it makes sure the number of points to the song is positive, AND it is less than
// the currently smallest one. (cure)
if( m_SongEntries[a].m_fDancePointsRequired > PREFSMAN->m_fDancePointsAccumulated)
fSmallestPoints = min(fSmallestPoints, m_SongEntries[a].m_fDancePointsRequired);
}
if (fSmallestPoints == 400000000) return 0; // no match found
return fSmallestPoints - PREFSMAN->m_fDancePointsAccumulated;
}
float UnlockSystem::ArcadePointsUntilNextUnlock()
{
float fSmallestPoints = 400000000; // or an arbitrarily large value
for( unsigned a=0; a<m_SongEntries.size(); a++ )
if( m_SongEntries[a].m_fArcadePointsRequired > PREFSMAN->m_fArcadePointsAccumulated)
fSmallestPoints = min(fSmallestPoints, m_SongEntries[a].m_fArcadePointsRequired);
if (fSmallestPoints == 400000000) return 0; // no match found
return fSmallestPoints - PREFSMAN->m_fArcadePointsAccumulated;
}
float UnlockSystem::SongPointsUntilNextUnlock()
{
float fSmallestPoints = 400000000; // or an arbitrarily large value
for( unsigned a=0; a<m_SongEntries.size(); a++ )
if( m_SongEntries[a].m_fSongPointsRequired > PREFSMAN->m_fSongPointsAccumulated)
fSmallestPoints = min(fSmallestPoints, m_SongEntries[a].m_fSongPointsRequired);
if (fSmallestPoints == 400000000) return 0; // no match found
return fSmallestPoints - PREFSMAN->m_fSongPointsAccumulated;
}
Song *SongEntry::GetSong() const
{
return SONGMAN->FindSong( "", m_sSongName );
+3 -1
View File
@@ -51,7 +51,9 @@ class UnlockSystem
{
public:
UnlockSystem();
float NumPointsUntilNextUnlock();
float DancePointsUntilNextUnlock();
float ArcadePointsUntilNextUnlock();
float SongPointsUntilNextUnlock();
bool SongIsLocked( const Song *song );
bool SongIsRoulette( const Song *song );
bool LoadFromDATFile( CString sPath );