added choice of which points to display for unlocking between dance, arcade, and song points
This commit is contained in:
@@ -24,7 +24,11 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|||||||
PointsUntilNextUnlock.LoadFromFont( THEME->GetPathToF("Common normal") );
|
PointsUntilNextUnlock.LoadFromFont( THEME->GetPathToF("Common normal") );
|
||||||
PointsUntilNextUnlock.SetHorizAlign( Actor::align_left );
|
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++)
|
for(int i=1; i <= THEME->GetMetricI("ScreenUnlock", "NumUnlocks"); i++)
|
||||||
{
|
{
|
||||||
@@ -47,9 +51,18 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|||||||
if( sDP.Left(1) == "-" )
|
if( sDP.Left(1) == "-" )
|
||||||
sDP = "*";
|
sDP = "*";
|
||||||
|
|
||||||
PointsUntilNextUnlock.SetName( "DancePointsDisplay" );
|
PointsUntilNextUnlock.SetName( "PointsDisplay" );
|
||||||
PointsUntilNextUnlock.SetText( sDP );
|
|
||||||
PointsUntilNextUnlock.SetZoom( THEME->GetMetricF("ScreenUnlock","DancePointsZoom") );
|
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 );
|
SET_XY( PointsUntilNextUnlock );
|
||||||
this->AddChild( &PointsUntilNextUnlock );
|
this->AddChild( &PointsUntilNextUnlock );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -245,22 +245,39 @@ bool SongEntry::SelectableRoulette()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
float UnlockSystem::NumPointsUntilNextUnlock()
|
float UnlockSystem::DancePointsUntilNextUnlock()
|
||||||
{
|
{
|
||||||
float fSmallestPoints = 400000000; // or an arbitrarily large value
|
float fSmallestPoints = 400000000; // or an arbitrarily large value
|
||||||
for( unsigned a=0; a<m_SongEntries.size(); a++ )
|
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)
|
if( m_SongEntries[a].m_fDancePointsRequired > PREFSMAN->m_fDancePointsAccumulated)
|
||||||
fSmallestPoints = min(fSmallestPoints, m_SongEntries[a].m_fDancePointsRequired);
|
fSmallestPoints = min(fSmallestPoints, m_SongEntries[a].m_fDancePointsRequired);
|
||||||
}
|
|
||||||
|
|
||||||
if (fSmallestPoints == 400000000) return 0; // no match found
|
if (fSmallestPoints == 400000000) return 0; // no match found
|
||||||
return fSmallestPoints - PREFSMAN->m_fDancePointsAccumulated;
|
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
|
Song *SongEntry::GetSong() const
|
||||||
{
|
{
|
||||||
return SONGMAN->FindSong( "", m_sSongName );
|
return SONGMAN->FindSong( "", m_sSongName );
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ class UnlockSystem
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UnlockSystem();
|
UnlockSystem();
|
||||||
float NumPointsUntilNextUnlock();
|
float DancePointsUntilNextUnlock();
|
||||||
|
float ArcadePointsUntilNextUnlock();
|
||||||
|
float SongPointsUntilNextUnlock();
|
||||||
bool SongIsLocked( const Song *song );
|
bool SongIsLocked( const Song *song );
|
||||||
bool SongIsRoulette( const Song *song );
|
bool SongIsRoulette( const Song *song );
|
||||||
bool LoadFromDATFile( CString sPath );
|
bool LoadFromDATFile( CString sPath );
|
||||||
|
|||||||
Reference in New Issue
Block a user