2003-07-09 03:10:01 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: ScreenUnlock
|
|
|
|
|
|
|
|
|
|
Desc: See header.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2003 by the person(s) listed below. All rights reserved.
|
2003-07-10 07:22:31 +00:00
|
|
|
Andrew Wong
|
2003-07-09 03:10:01 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "global.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "ScreenUnlock.h"
|
|
|
|
|
#include "ThemeManager.h"
|
|
|
|
|
#include "GameState.h"
|
|
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "UnlockSystem.h"
|
2003-07-09 04:46:24 +00:00
|
|
|
#include "SongManager.h"
|
2003-07-12 20:35:48 +00:00
|
|
|
#include "ActorUtil.h"
|
2003-07-09 03:10:01 +00:00
|
|
|
|
|
|
|
|
ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace("ScreenUnlock::ScreenUnlock()");
|
|
|
|
|
PointsUntilNextUnlock.LoadFromFont( THEME->GetPathToF("Common normal") );
|
|
|
|
|
PointsUntilNextUnlock.SetHorizAlign( Actor::align_left );
|
|
|
|
|
|
2003-07-13 14:18:26 +00:00
|
|
|
// get unlock data first
|
|
|
|
|
// GAMESTATE->m_pUnlockingSys->LoadFromDATFile("Data\\MemCard.ini");
|
|
|
|
|
|
2003-07-09 06:05:43 +00:00
|
|
|
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");
|
2003-07-10 07:22:31 +00:00
|
|
|
|
2003-07-11 09:35:28 +00:00
|
|
|
CString IconCommand = THEME->GetMetric("ScreenUnlock", "UnlockIconCommand");
|
2003-07-09 03:10:01 +00:00
|
|
|
|
|
|
|
|
for(int i=1; i <= THEME->GetMetricI("ScreenUnlock", "NumUnlocks"); i++)
|
|
|
|
|
{
|
|
|
|
|
// new unlock graphic
|
2003-07-10 14:44:13 +00:00
|
|
|
Unlocks[i].Load( THEME->GetPathToG(ssprintf("ScreenUnlock %d icon", i)) );
|
2003-07-09 03:10:01 +00:00
|
|
|
|
2003-07-10 14:44:13 +00:00
|
|
|
// set graphic location
|
2003-07-09 03:10:01 +00:00
|
|
|
Unlocks[i].SetName( ssprintf("Unlock%d",i) );
|
|
|
|
|
SET_XY( Unlocks[i] );
|
|
|
|
|
|
2003-07-10 14:44:13 +00:00
|
|
|
// 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)
|
2003-07-09 04:46:24 +00:00
|
|
|
continue;
|
|
|
|
|
|
2003-07-10 07:22:31 +00:00
|
|
|
Unlocks[i].Command(IconCommand);
|
|
|
|
|
|
2003-07-10 14:44:13 +00:00
|
|
|
if ( !pSong->isLocked )
|
2003-07-09 03:10:01 +00:00
|
|
|
this->AddChild(&Unlocks[i]);
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-09 06:05:43 +00:00
|
|
|
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") );
|
2003-07-09 03:10:01 +00:00
|
|
|
SET_XY( PointsUntilNextUnlock );
|
|
|
|
|
this->AddChild( &PointsUntilNextUnlock );
|
2003-07-10 07:22:31 +00:00
|
|
|
|
|
|
|
|
this->ClearMessageQueue( SM_BeginFadingOut ); // ignore ScreenAttract's SecsToShow
|
|
|
|
|
|
|
|
|
|
this->PostScreenMessage( SM_BeginFadingOut,
|
2003-07-12 20:33:19 +00:00
|
|
|
THEME->GetMetricF("ScreenUnlock", "TimeToDisplay") );
|
2003-07-09 03:10:01 +00:00
|
|
|
}
|