2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2004-05-01 23:19:33 +00:00
|
|
|
#include "ScreenWithMenuElements.h"
|
2003-11-07 20:10:38 +00:00
|
|
|
#include "MenuTimer.h"
|
2003-11-17 01:01:44 +00:00
|
|
|
#include "HelpDisplay.h"
|
2004-05-01 23:19:33 +00:00
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "ThemeManager.h"
|
|
|
|
|
#include "GameState.h"
|
2004-06-28 07:26:00 +00:00
|
|
|
#include "Style.h"
|
2004-05-01 23:19:33 +00:00
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "ScreenManager.h"
|
2005-02-27 09:59:38 +00:00
|
|
|
#include "GameSoundManager.h"
|
|
|
|
|
#include "AnnouncerManager.h"
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2005-03-26 03:30:08 +00:00
|
|
|
#define TIMER_SECONDS THEME->GetMetricF(m_sName,"TimerSeconds")
|
2004-12-04 21:13:29 +00:00
|
|
|
#define TIMER_STEALTH THEME->GetMetricB(m_sName,"TimerStealth")
|
2003-09-27 04:28:13 +00:00
|
|
|
#define STYLE_ICON THEME->GetMetricB(m_sName,"StyleIcon")
|
2005-05-06 12:29:38 +00:00
|
|
|
#define SHOW_STAGE THEME->GetMetricB(m_sName,"ShowStage")
|
2003-12-19 04:52:07 +00:00
|
|
|
#define MEMORY_CARD_ICONS THEME->GetMetricB(m_sName,"MemoryCardIcons")
|
2005-03-13 04:25:43 +00:00
|
|
|
#define FORCE_TIMER THEME->GetMetricB(m_sName,"ForceTimer")
|
|
|
|
|
#define STOP_MUSIC_ON_BACK THEME->GetMetricB(m_sName,"StopMusicOnBack")
|
2005-06-11 10:31:39 +00:00
|
|
|
#define WAIT_FOR_CHILDREN_BEFORE_TWEENING_OUT THEME->GetMetricB(m_sName,"WaitForChildrenBeforeTweeningOut")
|
2002-05-27 18:36:01 +00:00
|
|
|
|
2004-11-26 17:28:47 +00:00
|
|
|
//REGISTER_SCREEN_CLASS( ScreenWithMenuElements );
|
2004-05-01 23:19:33 +00:00
|
|
|
ScreenWithMenuElements::ScreenWithMenuElements( CString sClassName ) : Screen( sClassName )
|
2002-03-30 20:00:13 +00:00
|
|
|
{
|
2003-11-07 20:10:38 +00:00
|
|
|
m_MenuTimer = new MenuTimer;
|
2003-11-17 01:01:44 +00:00
|
|
|
m_textHelp = new HelpDisplay;
|
2005-03-25 08:58:30 +00:00
|
|
|
|
|
|
|
|
// Needs to be in the constructor in case a derivitive decides to skip
|
|
|
|
|
// itself and sends SM_GoToNextScreen to ScreenAttract.
|
|
|
|
|
PLAY_MUSIC.Load( m_sName, "PlayMusic" );
|
2005-02-23 06:29:05 +00:00
|
|
|
}
|
2003-11-07 20:10:38 +00:00
|
|
|
|
2005-02-23 06:29:05 +00:00
|
|
|
void ScreenWithMenuElements::Init()
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace( "ScreenWithMenuElements::Init()" );
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2005-02-23 06:29:05 +00:00
|
|
|
Screen::Init();
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2005-03-21 01:14:30 +00:00
|
|
|
FIRST_UPDATE_COMMAND.Load( m_sName, "FirstUpdateCommand" );
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2005-02-23 06:29:05 +00:00
|
|
|
ASSERT( this->m_SubActors.empty() ); // don't call Init twice!
|
2003-03-09 00:55:49 +00:00
|
|
|
|
2005-02-06 03:32:53 +00:00
|
|
|
m_autoHeader.Load( THEME->GetPathG(m_sName,"header") );
|
2003-11-04 21:49:38 +00:00
|
|
|
m_autoHeader->SetName("Header");
|
2005-07-14 22:36:50 +00:00
|
|
|
SET_XY( m_autoHeader );
|
2003-11-04 21:49:38 +00:00
|
|
|
this->AddChild( m_autoHeader );
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2004-06-28 07:26:00 +00:00
|
|
|
if( STYLE_ICON && GAMESTATE->m_pCurStyle )
|
2003-03-09 00:55:49 +00:00
|
|
|
{
|
2003-11-04 21:49:38 +00:00
|
|
|
m_sprStyleIcon.SetName( "StyleIcon" );
|
2005-02-06 03:32:53 +00:00
|
|
|
m_sprStyleIcon.Load( THEME->GetPathG("MenuElements",CString("icon ")+GAMESTATE->GetCurrentStyle()->m_szName) );
|
2003-03-09 00:55:49 +00:00
|
|
|
m_sprStyleIcon.StopAnimating();
|
2004-08-11 03:58:25 +00:00
|
|
|
m_sprStyleIcon.SetState( GAMESTATE->m_MasterPlayerNumber );
|
2005-07-14 22:36:50 +00:00
|
|
|
SET_XY( m_sprStyleIcon );
|
2003-03-09 00:55:49 +00:00
|
|
|
this->AddChild( &m_sprStyleIcon );
|
|
|
|
|
}
|
2002-05-27 18:36:01 +00:00
|
|
|
|
2005-05-06 12:29:38 +00:00
|
|
|
if( SHOW_STAGE && GAMESTATE->m_pCurStyle )
|
|
|
|
|
{
|
|
|
|
|
vector<Stage> vStages;
|
|
|
|
|
GAMESTATE->GetPossibleStages( vStages );
|
|
|
|
|
FOREACH_CONST( Stage, vStages, s )
|
|
|
|
|
{
|
|
|
|
|
m_sprStage[*s].Load( THEME->GetPathG(m_sName,"stage "+StageToString(*s)) );
|
|
|
|
|
m_sprStage[*s]->SetName( "Stage" );
|
2005-06-29 09:21:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdateStage to hide/show the appropriate stage graphic. Do this before
|
|
|
|
|
// running the OnCommand so that it won't override the OnCommand if On chooses
|
|
|
|
|
// to hide the graphic.
|
|
|
|
|
UpdateStage();
|
|
|
|
|
|
|
|
|
|
FOREACH_CONST( Stage, vStages, s )
|
|
|
|
|
{
|
2005-07-14 22:36:50 +00:00
|
|
|
SET_XY( m_sprStage[*s] );
|
2005-05-06 12:29:38 +00:00
|
|
|
this->AddChild( m_sprStage[*s] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-12-19 04:52:07 +00:00
|
|
|
if( MEMORY_CARD_ICONS )
|
|
|
|
|
{
|
2004-05-24 06:10:11 +00:00
|
|
|
FOREACH_PlayerNumber( p )
|
2003-12-19 04:52:07 +00:00
|
|
|
{
|
2005-01-31 03:18:46 +00:00
|
|
|
m_MemoryCardDisplay[p].Load( p );
|
2003-12-19 04:52:07 +00:00
|
|
|
m_MemoryCardDisplay[p].SetName( ssprintf("MemoryCardDisplayP%d",p+1) );
|
2005-07-14 22:36:50 +00:00
|
|
|
SET_XY( m_MemoryCardDisplay[p] );
|
2003-12-19 04:52:07 +00:00
|
|
|
this->AddChild( &m_MemoryCardDisplay[p] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-09-27 05:02:04 +00:00
|
|
|
m_bTimerEnabled = (TIMER_SECONDS != -1);
|
2003-09-26 23:27:22 +00:00
|
|
|
if( m_bTimerEnabled )
|
|
|
|
|
{
|
2005-07-18 02:08:15 +00:00
|
|
|
m_MenuTimer->Load();
|
2003-11-07 20:10:38 +00:00
|
|
|
m_MenuTimer->SetName( "Timer" );
|
2004-12-04 21:13:29 +00:00
|
|
|
if( TIMER_STEALTH )
|
|
|
|
|
m_MenuTimer->EnableStealth( true );
|
2005-07-14 22:36:50 +00:00
|
|
|
SET_XY( m_MenuTimer );
|
2004-05-08 06:42:23 +00:00
|
|
|
ResetTimer();
|
2003-11-07 20:10:38 +00:00
|
|
|
this->AddChild( m_MenuTimer );
|
2003-09-26 23:27:22 +00:00
|
|
|
}
|
2002-05-27 08:23:27 +00:00
|
|
|
|
2005-02-06 03:32:53 +00:00
|
|
|
m_autoFooter.Load( THEME->GetPathG(m_sName,"footer") );
|
2003-11-04 21:49:38 +00:00
|
|
|
m_autoFooter->SetName("Footer");
|
2005-07-14 22:36:50 +00:00
|
|
|
SET_XY( m_autoFooter );
|
2003-11-04 21:49:38 +00:00
|
|
|
this->AddChild( m_autoFooter );
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2005-05-31 07:53:13 +00:00
|
|
|
m_textHelp->SetName( "Help" );
|
|
|
|
|
m_textHelp->Load( "HelpDisplay" );
|
2005-07-14 22:36:50 +00:00
|
|
|
SET_XY( m_textHelp );
|
2005-04-15 07:18:40 +00:00
|
|
|
LoadHelpText();
|
2003-11-17 01:01:44 +00:00
|
|
|
this->AddChild( m_textHelp );
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2005-02-12 20:31:15 +00:00
|
|
|
m_sprUnderlay.Load( THEME->GetPathB(m_sName,"underlay") );
|
|
|
|
|
m_sprUnderlay->SetName("Underlay");
|
2005-02-25 01:51:40 +00:00
|
|
|
m_sprUnderlay->SetDrawOrder( DRAW_ORDER_UNDERLAY );
|
2005-07-14 22:36:50 +00:00
|
|
|
SET_XY( m_sprUnderlay );
|
2005-02-12 20:31:15 +00:00
|
|
|
this->AddChild( m_sprUnderlay );
|
|
|
|
|
|
2005-02-06 03:32:53 +00:00
|
|
|
m_sprOverlay.Load( THEME->GetPathB(m_sName,"overlay") );
|
2005-01-05 04:32:12 +00:00
|
|
|
m_sprOverlay->SetName("Overlay");
|
2005-02-25 01:51:40 +00:00
|
|
|
m_sprOverlay->SetDrawOrder( DRAW_ORDER_OVERLAY );
|
2005-07-14 22:36:50 +00:00
|
|
|
SET_XY( m_sprOverlay );
|
2005-01-05 04:32:12 +00:00
|
|
|
this->AddChild( m_sprOverlay );
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2005-03-21 05:16:52 +00:00
|
|
|
m_In.SetName( "In" );
|
2005-02-06 03:32:53 +00:00
|
|
|
m_In.Load( THEME->GetPathB(m_sName,"in") );
|
2004-05-02 03:01:27 +00:00
|
|
|
m_In.SetDrawOrder( DRAW_ORDER_TRANSITIONS );
|
2003-03-09 00:55:49 +00:00
|
|
|
this->AddChild( &m_In );
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2005-03-21 05:16:52 +00:00
|
|
|
m_Out.SetName( "Out" );
|
2005-02-06 03:32:53 +00:00
|
|
|
m_Out.Load( THEME->GetPathB(m_sName,"out") );
|
2004-05-02 03:01:27 +00:00
|
|
|
m_Out.SetDrawOrder( DRAW_ORDER_TRANSITIONS );
|
2003-03-09 00:55:49 +00:00
|
|
|
this->AddChild( &m_Out );
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2005-03-21 05:16:52 +00:00
|
|
|
m_Cancel.SetName( "Cancel" );
|
2005-03-20 06:14:41 +00:00
|
|
|
m_Cancel.Load( THEME->GetPathB(m_sName,"cancel") );
|
|
|
|
|
m_Cancel.SetDrawOrder( DRAW_ORDER_TRANSITIONS );
|
|
|
|
|
this->AddChild( &m_Cancel );
|
2005-07-15 01:18:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenWithMenuElements::BeginScreen()
|
|
|
|
|
{
|
|
|
|
|
m_In.Reset();
|
|
|
|
|
m_Out.Reset();
|
|
|
|
|
m_Cancel.Reset();
|
2005-06-29 05:06:50 +00:00
|
|
|
|
2005-07-14 22:36:50 +00:00
|
|
|
TweenOnScreen();
|
2005-04-02 02:45:17 +00:00
|
|
|
m_In.StartTransitioning( SM_DoneFadingIn );
|
2005-07-15 01:18:42 +00:00
|
|
|
|
|
|
|
|
Screen::BeginScreen();
|
2005-07-29 05:08:57 +00:00
|
|
|
|
|
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo(m_sName+" intro") );
|
|
|
|
|
StartPlayingMusic();
|
|
|
|
|
|
|
|
|
|
/* Evaluate FirstUpdateCommand. */
|
|
|
|
|
this->RunCommands( FIRST_UPDATE_COMMAND );
|
2003-03-25 01:37:33 +00:00
|
|
|
}
|
|
|
|
|
|
2005-07-14 22:36:50 +00:00
|
|
|
void ScreenWithMenuElements::TweenOnScreen()
|
|
|
|
|
{
|
|
|
|
|
ON_COMMAND( m_autoHeader );
|
|
|
|
|
if( STYLE_ICON && GAMESTATE->m_pCurStyle )
|
|
|
|
|
ON_COMMAND( m_sprStyleIcon );
|
|
|
|
|
|
|
|
|
|
if( SHOW_STAGE && GAMESTATE->m_pCurStyle )
|
|
|
|
|
{
|
|
|
|
|
// UpdateStage to hide/show the appropriate stage graphic. Do this before
|
|
|
|
|
// running the OnCommand so that it won't override the OnCommand if On chooses
|
|
|
|
|
// to hide the graphic.
|
|
|
|
|
UpdateStage();
|
|
|
|
|
|
|
|
|
|
vector<Stage> vStages;
|
|
|
|
|
GAMESTATE->GetPossibleStages( vStages );
|
|
|
|
|
FOREACH_CONST( Stage, vStages, s )
|
|
|
|
|
ON_COMMAND( m_sprStage[*s] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( MEMORY_CARD_ICONS )
|
|
|
|
|
{
|
|
|
|
|
FOREACH_PlayerNumber( p )
|
|
|
|
|
ON_COMMAND( m_MemoryCardDisplay[p] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( m_bTimerEnabled )
|
|
|
|
|
ON_COMMAND( m_MenuTimer );
|
|
|
|
|
|
|
|
|
|
ON_COMMAND( m_autoFooter );
|
|
|
|
|
ON_COMMAND( m_textHelp );
|
|
|
|
|
ON_COMMAND( m_sprUnderlay );
|
|
|
|
|
ON_COMMAND( m_sprOverlay );
|
|
|
|
|
|
2005-07-15 02:10:46 +00:00
|
|
|
this->SortByDrawOrder();
|
2005-07-14 22:36:50 +00:00
|
|
|
}
|
|
|
|
|
|
2004-05-01 23:19:33 +00:00
|
|
|
ScreenWithMenuElements::~ScreenWithMenuElements()
|
2003-03-25 01:37:33 +00:00
|
|
|
{
|
2004-05-01 23:19:33 +00:00
|
|
|
SAFE_DELETE( m_MenuTimer );
|
|
|
|
|
SAFE_DELETE( m_textHelp );
|
2002-05-28 20:01:22 +00:00
|
|
|
}
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2005-04-15 07:18:40 +00:00
|
|
|
void ScreenWithMenuElements::LoadHelpText()
|
|
|
|
|
{
|
|
|
|
|
CStringArray asHelpTips;
|
|
|
|
|
split( THEME->GetMetric(m_sName,"HelpText"), "\n", asHelpTips );
|
|
|
|
|
m_textHelp->SetTips( asHelpTips );
|
2005-04-25 03:44:21 +00:00
|
|
|
m_textHelp->PlayCommand( "Changed" );
|
2005-04-15 07:18:40 +00:00
|
|
|
}
|
|
|
|
|
|
2005-03-22 22:53:39 +00:00
|
|
|
void ScreenWithMenuElements::StartPlayingMusic()
|
|
|
|
|
{
|
|
|
|
|
/* Some screens should leave the music alone (eg. ScreenPlayerOptions music
|
|
|
|
|
* sample left over from ScreenSelectMusic). */
|
|
|
|
|
if( PLAY_MUSIC )
|
|
|
|
|
SOUND->PlayMusic( THEME->GetPathS(m_sName,"music") );
|
|
|
|
|
}
|
|
|
|
|
|
2005-02-17 06:13:23 +00:00
|
|
|
void ScreenWithMenuElements::Update( float fDeltaTime )
|
|
|
|
|
{
|
|
|
|
|
Screen::Update( fDeltaTime );
|
|
|
|
|
}
|
|
|
|
|
|
2004-05-08 06:42:23 +00:00
|
|
|
void ScreenWithMenuElements::ResetTimer()
|
|
|
|
|
{
|
2005-07-18 20:42:13 +00:00
|
|
|
if( !m_bTimerEnabled )
|
|
|
|
|
return;
|
|
|
|
|
|
2005-07-14 05:12:56 +00:00
|
|
|
if( TIMER_SECONDS > 0.0f && (PREFSMAN->m_bMenuTimer || FORCE_TIMER) && !GAMESTATE->IsEditing() )
|
2004-05-08 06:42:23 +00:00
|
|
|
{
|
|
|
|
|
m_MenuTimer->SetSeconds( TIMER_SECONDS );
|
|
|
|
|
m_MenuTimer->Start();
|
|
|
|
|
}
|
|
|
|
|
else
|
2004-12-04 10:35:50 +00:00
|
|
|
{
|
2004-05-08 06:42:23 +00:00
|
|
|
m_MenuTimer->Disable();
|
2004-12-04 10:35:50 +00:00
|
|
|
}
|
2004-05-08 06:42:23 +00:00
|
|
|
}
|
|
|
|
|
|
2004-05-01 23:19:33 +00:00
|
|
|
void ScreenWithMenuElements::StartTransitioning( ScreenMessage smSendWhenDone )
|
2005-04-02 02:45:17 +00:00
|
|
|
{
|
|
|
|
|
TweenOffScreen();
|
|
|
|
|
|
2005-06-11 10:31:39 +00:00
|
|
|
if( WAIT_FOR_CHILDREN_BEFORE_TWEENING_OUT )
|
|
|
|
|
{
|
|
|
|
|
// Time the transition so that it finishes exactly when all actors have
|
|
|
|
|
// finished tweening.
|
|
|
|
|
float fSecondsUntilFinished = GetTweenTimeLeft();
|
|
|
|
|
float fSecondsUntilBeginOff = max( fSecondsUntilFinished - m_Out.GetLengthSeconds(), 0 );
|
|
|
|
|
m_Out.SetHibernate( fSecondsUntilBeginOff );
|
|
|
|
|
}
|
|
|
|
|
m_Out.StartTransitioning( smSendWhenDone );
|
2005-04-02 02:45:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenWithMenuElements::TweenOffScreen()
|
2002-05-28 20:01:22 +00:00
|
|
|
{
|
2003-09-26 23:27:22 +00:00
|
|
|
if( m_bTimerEnabled )
|
|
|
|
|
{
|
2003-11-07 20:10:38 +00:00
|
|
|
m_MenuTimer->SetSeconds( 0 );
|
|
|
|
|
m_MenuTimer->Stop();
|
2005-01-17 05:42:52 +00:00
|
|
|
ActorUtil::OffCommand( m_MenuTimer, m_sName );
|
2003-09-26 23:27:22 +00:00
|
|
|
}
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2005-01-17 05:42:52 +00:00
|
|
|
ActorUtil::OffCommand( m_autoHeader, m_sName );
|
|
|
|
|
ActorUtil::OffCommand( m_sprStyleIcon, m_sName );
|
2005-05-06 12:29:38 +00:00
|
|
|
OFF_COMMAND( m_sprStage[GAMESTATE->GetCurrentStage()] );
|
2004-05-24 06:10:11 +00:00
|
|
|
FOREACH_PlayerNumber( p )
|
2005-01-17 05:42:52 +00:00
|
|
|
ActorUtil::OffCommand( m_MemoryCardDisplay[p], m_sName );
|
|
|
|
|
ActorUtil::OffCommand( m_autoFooter, m_sName );
|
|
|
|
|
ActorUtil::OffCommand( m_textHelp, m_sName );
|
2005-02-15 07:58:06 +00:00
|
|
|
OFF_COMMAND( m_sprUnderlay );
|
2005-01-08 00:06:51 +00:00
|
|
|
OFF_COMMAND( m_sprOverlay );
|
2002-12-19 22:24:13 +00:00
|
|
|
|
2004-12-09 08:16:18 +00:00
|
|
|
SCREENMAN->PlaySharedBackgroundOffCommand();
|
2003-07-10 03:37:13 +00:00
|
|
|
|
2002-12-19 22:24:13 +00:00
|
|
|
}
|
|
|
|
|
|
2005-03-20 06:14:41 +00:00
|
|
|
void ScreenWithMenuElements::Cancel( ScreenMessage smSendWhenDone )
|
2002-09-04 22:56:19 +00:00
|
|
|
{
|
2005-03-20 06:14:41 +00:00
|
|
|
if( m_Cancel.IsTransitioning() )
|
2003-03-11 08:52:45 +00:00
|
|
|
return; // ignore
|
|
|
|
|
|
2005-03-13 04:25:43 +00:00
|
|
|
if( STOP_MUSIC_ON_BACK )
|
|
|
|
|
SOUND->StopMusic();
|
|
|
|
|
|
2005-07-18 20:42:13 +00:00
|
|
|
if( m_bTimerEnabled )
|
|
|
|
|
m_MenuTimer->Stop();
|
2005-03-20 06:14:41 +00:00
|
|
|
m_Cancel.StartTransitioning( smSendWhenDone );
|
2002-03-30 20:00:13 +00:00
|
|
|
}
|
|
|
|
|
|
2004-05-01 23:19:33 +00:00
|
|
|
bool ScreenWithMenuElements::IsTransitioning()
|
2002-08-20 21:00:56 +00:00
|
|
|
{
|
2005-03-20 06:14:41 +00:00
|
|
|
return m_In.IsTransitioning() || m_Out.IsTransitioning() || m_Cancel.IsTransitioning();
|
2002-08-27 23:31:41 +00:00
|
|
|
}
|
2003-11-07 20:10:38 +00:00
|
|
|
|
2004-05-01 23:19:33 +00:00
|
|
|
void ScreenWithMenuElements::StopTimer()
|
2003-11-07 20:10:38 +00:00
|
|
|
{
|
2005-07-18 20:42:13 +00:00
|
|
|
if( m_bTimerEnabled )
|
|
|
|
|
m_MenuTimer->Stop();
|
2003-11-07 20:10:38 +00:00
|
|
|
}
|
|
|
|
|
|
2005-05-06 12:29:38 +00:00
|
|
|
void ScreenWithMenuElements::HandleMessage( const CString& sMessage )
|
|
|
|
|
{
|
2005-08-14 07:29:48 +00:00
|
|
|
if( sMessage == MessageToString(Message_CurrentSongChanged) )
|
2005-05-06 12:29:38 +00:00
|
|
|
UpdateStage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenWithMenuElements::UpdateStage()
|
|
|
|
|
{
|
2005-06-29 09:21:30 +00:00
|
|
|
// Refresh the stage counter display. This is useful when changing
|
|
|
|
|
// between long versions/marathons songs on the wheel.
|
2005-05-06 12:29:38 +00:00
|
|
|
FOREACH_Stage( s )
|
|
|
|
|
m_sprStage[s]->SetHidden( s != GAMESTATE->GetCurrentStage() );
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-12 05:44:54 +00:00
|
|
|
// lua start
|
|
|
|
|
#include "LuaBinding.h"
|
|
|
|
|
|
|
|
|
|
class LunaScreenWithMenuElements: public Luna<ScreenWithMenuElements>
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
LunaScreenWithMenuElements() { LUA->Register( Register ); }
|
|
|
|
|
|
|
|
|
|
static void Register( Lua *L )
|
|
|
|
|
{
|
|
|
|
|
Luna<T>::Register( L );
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
LUA_REGISTER_DERIVED_CLASS( ScreenWithMenuElements, Screen )
|
|
|
|
|
// lua end
|
|
|
|
|
|
2004-06-08 05:22:33 +00:00
|
|
|
/*
|
|
|
|
|
* (c) 2004 Chris Danford
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the
|
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
* distribute, and/or sell copies of the Software, and to permit persons to
|
|
|
|
|
* whom the Software is furnished to do so, provided that the above
|
|
|
|
|
* copyright notice(s) and this permission notice appear in all copies of
|
|
|
|
|
* the Software and that both the above copyright notice(s) and this
|
|
|
|
|
* permission notice appear in supporting documentation.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
|
|
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
|
|
|
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
|
|
|
|
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
|
|
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
|
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
*/
|