Please use real names in copyright notices, not aliases.
Minor cleanup: Indent of 4. Use ssprintf, not sprintf. Fix warnings. Use SET_XY.
This commit is contained in:
@@ -19,48 +19,33 @@
|
||||
|
||||
ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
||||
{
|
||||
LOG->Trace("ScreenUnlock::ScreenUnlock()");
|
||||
PointsUntilNextUnlock.LoadFromFont( THEME->GetPathToF("Common normal") );
|
||||
PointsUntilNextUnlock.SetHorizAlign( Actor::align_left );
|
||||
LOG->Trace("ScreenUnlock::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->NumPointsUntilNextUnlock() );
|
||||
|
||||
for(int i=1; i <= THEME->GetMetricI("ScreenUnlock", "NumUnlocks"); i++)
|
||||
{
|
||||
// new unlock graphic
|
||||
char filename[30];
|
||||
sprintf(filename, "UnlockGraphic%d", i);
|
||||
Unlocks[i].Load( THEME->GetPathToG(filename) );
|
||||
for(int i=1; i <= THEME->GetMetricI("ScreenUnlock", "NumUnlocks"); i++)
|
||||
{
|
||||
// new unlock graphic
|
||||
Unlocks[i].Load( THEME->GetPathToG(ssprintf("UnlockGraphic%d", i)) );
|
||||
|
||||
sprintf(filename, "Unlock%d", i);
|
||||
Unlocks[i].SetName( ssprintf("Unlock%d",i) );
|
||||
SET_XY( Unlocks[i] );
|
||||
|
||||
PointsUntilNextUnlock.SetXY(
|
||||
THEME->GetMetricI("ScreenUnlock",ssprintf("Unlock%dX", i)),
|
||||
THEME->GetMetricI("ScreenUnlock",ssprintf("Unlock%dX", i)) );
|
||||
const bool SongIsLocked = GAMESTATE->m_pUnlockingSys->SongIsLocked
|
||||
(THEME->GetMetric("ScreenUnlock", ssprintf("Unlock%dSong", i)));
|
||||
if ( !SongIsLocked )
|
||||
this->AddChild(&Unlocks[i]);
|
||||
}
|
||||
|
||||
Unlocks[i].SetName( ssprintf("Unlock%d",i) );
|
||||
// No negative numbers
|
||||
if( sDP.Left(1) == "-" )
|
||||
sDP = "*";
|
||||
|
||||
UtilSetXY( Unlocks[i], "ScreenUnlock" );
|
||||
|
||||
if (!GAMESTATE->m_pUnlockingSys->SongIsLocked
|
||||
(THEME->GetMetric
|
||||
("ScreenUnlock", ssprintf
|
||||
("Unlock%dSong", i))))
|
||||
this->AddChild(&Unlocks[i]);
|
||||
}
|
||||
|
||||
/* Remove the decimal
|
||||
if( sDP.Find(".",1) > 0 )
|
||||
{
|
||||
sDP = sDP.Left(sDP.Find(".",1));
|
||||
} no longer necessary since its an int*/
|
||||
|
||||
// No negative numbers
|
||||
if( sDP.Left(1) == "-" )
|
||||
sDP = "*";
|
||||
|
||||
PointsUntilNextUnlock.SetText( sDP );
|
||||
PointsUntilNextUnlock.SetZoom( THEME->GetMetricF("ScreenUnlock","DancePointsZoom") );
|
||||
PointsUntilNextUnlock.SetXY( THEME->GetMetricI("ScreenUnlock","DancePointsDisplayX"), THEME->GetMetricI("ScreenUnlock","DancePointsDisplayY") );
|
||||
this->AddChild( &PointsUntilNextUnlock );
|
||||
PointsUntilNextUnlock.SetName( "DancePointsDisplay" );
|
||||
PointsUntilNextUnlock.SetText( sDP );
|
||||
PointsUntilNextUnlock.SetZoom( THEME->GetMetricF("ScreenUnlock","DancePointsZoom") );
|
||||
SET_XY( PointsUntilNextUnlock );
|
||||
this->AddChild( &PointsUntilNextUnlock );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user