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")
|
ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
||||||
{
|
{
|
||||||
LOG->Trace("ScreenUnlock::ScreenUnlock()");
|
LOG->Trace("ScreenUnlock::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->NumPointsUntilNextUnlock() );
|
||||||
|
|
||||||
for(int i=1; i <= THEME->GetMetricI("ScreenUnlock", "NumUnlocks"); i++)
|
for(int i=1; i <= THEME->GetMetricI("ScreenUnlock", "NumUnlocks"); i++)
|
||||||
{
|
{
|
||||||
// new unlock graphic
|
// new unlock graphic
|
||||||
char filename[30];
|
Unlocks[i].Load( THEME->GetPathToG(ssprintf("UnlockGraphic%d", i)) );
|
||||||
sprintf(filename, "UnlockGraphic%d", i);
|
|
||||||
Unlocks[i].Load( THEME->GetPathToG(filename) );
|
|
||||||
|
|
||||||
sprintf(filename, "Unlock%d", i);
|
Unlocks[i].SetName( ssprintf("Unlock%d",i) );
|
||||||
|
SET_XY( Unlocks[i] );
|
||||||
|
|
||||||
PointsUntilNextUnlock.SetXY(
|
const bool SongIsLocked = GAMESTATE->m_pUnlockingSys->SongIsLocked
|
||||||
THEME->GetMetricI("ScreenUnlock",ssprintf("Unlock%dX", i)),
|
(THEME->GetMetric("ScreenUnlock", ssprintf("Unlock%dSong", i)));
|
||||||
THEME->GetMetricI("ScreenUnlock",ssprintf("Unlock%dX", 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" );
|
PointsUntilNextUnlock.SetName( "DancePointsDisplay" );
|
||||||
|
PointsUntilNextUnlock.SetText( sDP );
|
||||||
if (!GAMESTATE->m_pUnlockingSys->SongIsLocked
|
PointsUntilNextUnlock.SetZoom( THEME->GetMetricF("ScreenUnlock","DancePointsZoom") );
|
||||||
(THEME->GetMetric
|
SET_XY( PointsUntilNextUnlock );
|
||||||
("ScreenUnlock", ssprintf
|
this->AddChild( &PointsUntilNextUnlock );
|
||||||
("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 );
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user