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"
|
2004-05-01 23:19:33 +00:00
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "ThemeManager.h"
|
|
|
|
|
#include "GameState.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "ScreenManager.h"
|
2005-02-27 09:59:38 +00:00
|
|
|
#include "GameSoundManager.h"
|
2005-10-30 21:39:49 +00:00
|
|
|
#include "MemoryCardDisplay.h"
|
2006-11-21 20:04:51 +00:00
|
|
|
#include "InputEventPlus.h"
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2006-03-28 05:42:38 +00:00
|
|
|
#define TIMER_STEALTH THEME->GetMetricB(m_sName,"TimerStealth")
|
2008-03-29 11:27:34 +00:00
|
|
|
#define SHOW_STAGE_DISPLAY THEME->GetMetricB(m_sName,"ShowStageDisplay")
|
2006-03-28 05:42:38 +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")
|
2006-03-28 05:42:38 +00:00
|
|
|
#define STOP_MUSIC_ON_BACK THEME->GetMetricB(m_sName,"StopMusicOnBack")
|
|
|
|
|
#define WAIT_FOR_CHILDREN_BEFORE_TWEENING_OUT THEME->GetMetricB(m_sName,"WaitForChildrenBeforeTweeningOut")
|
2002-05-27 18:36:01 +00:00
|
|
|
|
2008-09-24 08:11:01 +00:00
|
|
|
REGISTER_SCREEN_CLASS( ScreenWithMenuElements );
|
2006-01-15 18:54:03 +00:00
|
|
|
ScreenWithMenuElements::ScreenWithMenuElements()
|
|
|
|
|
{
|
|
|
|
|
m_MenuTimer = NULL;
|
|
|
|
|
FOREACH_PlayerNumber( p )
|
|
|
|
|
m_MemoryCardDisplay[p] = NULL;
|
|
|
|
|
m_MenuTimer = NULL;
|
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()
|
|
|
|
|
{
|
2006-01-15 18:54:03 +00:00
|
|
|
PLAY_MUSIC.Load( m_sName, "PlayMusic" );
|
2008-08-09 22:47:58 +00:00
|
|
|
MUSIC_ALIGN_BEAT.Load( m_sName, "MusicAlignBeat" );
|
2006-02-24 03:01:28 +00:00
|
|
|
CANCEL_TRANSITIONS_OUT.Load( m_sName, "CancelTransitionsOut" );
|
2006-01-15 18:54:03 +00:00
|
|
|
TIMER_SECONDS.Load( m_sName, "TimerSeconds" );
|
2008-03-26 06:06:00 +00:00
|
|
|
TIMER_METRICS_GROUP.Load( m_sName, "TimerMetricsGroup" );
|
2005-02-23 06:29:05 +00:00
|
|
|
Screen::Init();
|
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
|
|
|
|
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-09-07 22:25:10 +00:00
|
|
|
ASSERT( m_MemoryCardDisplay[p] == NULL );
|
|
|
|
|
m_MemoryCardDisplay[p] = new MemoryCardDisplay;
|
|
|
|
|
m_MemoryCardDisplay[p]->Load( p );
|
|
|
|
|
m_MemoryCardDisplay[p]->SetName( ssprintf("MemoryCardDisplayP%d",p+1) );
|
2007-02-19 09:30:07 +00:00
|
|
|
LOAD_ALL_COMMANDS_AND_SET_XY( m_MemoryCardDisplay[p] );
|
2005-09-07 22:25:10 +00:00
|
|
|
this->AddChild( m_MemoryCardDisplay[p] );
|
2003-12-19 04:52:07 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-07 22:25:10 +00:00
|
|
|
if( TIMER_SECONDS != -1 )
|
2003-09-26 23:27:22 +00:00
|
|
|
{
|
2005-09-07 22:25:10 +00:00
|
|
|
ASSERT( m_MenuTimer == NULL ); // don't load twice
|
|
|
|
|
m_MenuTimer = new MenuTimer;
|
2008-03-26 06:06:00 +00:00
|
|
|
m_MenuTimer->Load( TIMER_METRICS_GROUP.GetValue() );
|
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 );
|
2007-02-19 09:30:07 +00:00
|
|
|
LOAD_ALL_COMMANDS_AND_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
|
|
|
|
2008-11-24 06:46:05 +00:00
|
|
|
/* TODO: Remove overlay and underlay in favor of more flexible decorations */
|
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-02-12 20:31:15 +00:00
|
|
|
this->AddChild( m_sprUnderlay );
|
2007-05-02 20:39:56 +00:00
|
|
|
LOAD_ALL_COMMANDS( m_sprUnderlay );
|
2005-02-12 20:31:15 +00:00
|
|
|
|
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-01-05 04:32:12 +00:00
|
|
|
this->AddChild( m_sprOverlay );
|
2007-05-02 20:39:56 +00:00
|
|
|
LOAD_ALL_COMMANDS( m_sprOverlay );
|
2008-03-28 16:28:27 +00:00
|
|
|
|
|
|
|
|
/* Experimental: Load "decorations" and make them children of the screen. */
|
|
|
|
|
{
|
2009-10-26 04:33:38 +00:00
|
|
|
AutoActor decorations;
|
|
|
|
|
decorations.LoadB( m_sName, "decorations" );
|
|
|
|
|
ActorFrame *pFrame = dynamic_cast<ActorFrame*>(static_cast<Actor*>(decorations));
|
2008-03-28 16:28:27 +00:00
|
|
|
if( pFrame )
|
2009-10-26 03:05:08 +00:00
|
|
|
{
|
2009-10-26 04:33:38 +00:00
|
|
|
m_vDecorations = pFrame->GetChildren();
|
|
|
|
|
FOREACH( Actor*, m_vDecorations, child )
|
2009-10-26 03:05:08 +00:00
|
|
|
this->AddChild( *child );
|
2009-10-26 04:33:38 +00:00
|
|
|
pFrame->RemoveAllChildren();
|
2009-10-26 03:05:08 +00:00
|
|
|
}
|
2008-03-28 16:28:27 +00:00
|
|
|
}
|
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 );
|
2007-05-02 20:39:56 +00:00
|
|
|
LOAD_ALL_COMMANDS( 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 );
|
2007-05-02 20:39:56 +00:00
|
|
|
LOAD_ALL_COMMANDS( 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 );
|
2007-05-02 20:39:56 +00:00
|
|
|
LOAD_ALL_COMMANDS( m_Cancel );
|
2005-09-22 01:17:35 +00:00
|
|
|
|
|
|
|
|
/* Grab the music path here; don't GetPath during BeginScreen. */
|
|
|
|
|
if( PLAY_MUSIC )
|
|
|
|
|
m_sPathToMusic = THEME->GetPathS( m_sName, "music" );
|
2005-07-15 01:18:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenWithMenuElements::BeginScreen()
|
|
|
|
|
{
|
2006-07-01 05:24:06 +00:00
|
|
|
Screen::BeginScreen();
|
|
|
|
|
|
2005-07-15 01:18:42 +00:00
|
|
|
m_In.Reset();
|
|
|
|
|
m_Out.Reset();
|
|
|
|
|
m_Cancel.Reset();
|
2005-06-29 05:06:50 +00:00
|
|
|
|
2008-11-24 04:44:12 +00:00
|
|
|
TweenOnScreen();
|
|
|
|
|
|
2006-06-24 17:58:43 +00:00
|
|
|
this->SortByDrawOrder();
|
2005-04-02 02:45:17 +00:00
|
|
|
m_In.StartTransitioning( SM_DoneFadingIn );
|
2005-07-15 01:18:42 +00:00
|
|
|
|
2006-11-21 18:33:54 +00:00
|
|
|
SOUND->PlayOnceFromAnnouncer( m_sName+" intro" );
|
2005-07-29 05:08:57 +00:00
|
|
|
StartPlayingMusic();
|
|
|
|
|
|
|
|
|
|
/* Evaluate FirstUpdateCommand. */
|
2005-09-07 20:47:33 +00:00
|
|
|
this->PlayCommand( "FirstUpdate" );
|
2008-05-27 20:51:18 +00:00
|
|
|
|
2008-06-11 22:19:43 +00:00
|
|
|
/* If AutoJoin and a player is already joined, then try to join a player. (If no players
|
|
|
|
|
* are joined, they'll join on the first JoinInput.) */
|
2008-06-07 03:22:33 +00:00
|
|
|
if( GAMESTATE->GetCoinMode() == CoinMode_Pay && GAMESTATE->m_bAutoJoin.Get() )
|
2008-05-27 20:51:18 +00:00
|
|
|
{
|
2008-06-11 22:19:43 +00:00
|
|
|
if( GAMESTATE->GetNumSidesJoined() > 0 && GAMESTATE->JoinPlayers() )
|
2008-05-27 20:51:18 +00:00
|
|
|
SCREENMAN->PlayStartSound();
|
|
|
|
|
}
|
2003-03-25 01:37:33 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-21 20:04:51 +00:00
|
|
|
void ScreenWithMenuElements::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
if( SM == SM_MenuTimer )
|
|
|
|
|
{
|
|
|
|
|
FOREACH_HumanPlayer(p)
|
|
|
|
|
{
|
|
|
|
|
InputEventPlus iep;
|
|
|
|
|
iep.pn = p;
|
|
|
|
|
MenuStart( iep );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Screen::HandleScreenMessage( SM );
|
|
|
|
|
}
|
|
|
|
|
|
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 );
|
2005-10-30 21:50:05 +00:00
|
|
|
FOREACH_PlayerNumber( p )
|
|
|
|
|
{
|
|
|
|
|
if( m_MemoryCardDisplay[p] != NULL )
|
|
|
|
|
SAFE_DELETE( m_MemoryCardDisplay[p] );
|
|
|
|
|
}
|
2009-10-26 04:33:38 +00:00
|
|
|
FOREACH( Actor*, m_vDecorations, actor )
|
|
|
|
|
delete *actor;
|
2002-05-28 20:01:22 +00:00
|
|
|
}
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2007-03-05 23:27:15 +00:00
|
|
|
void ScreenWithMenuElements::SetHelpText( RString s )
|
2005-04-15 07:18:40 +00:00
|
|
|
{
|
2007-03-05 23:27:15 +00:00
|
|
|
Message msg("SetHelpText");
|
|
|
|
|
msg.SetParam( "Text", s );
|
|
|
|
|
this->HandleMessage( msg );
|
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 )
|
2008-08-09 22:37:03 +00:00
|
|
|
{
|
|
|
|
|
GameSoundManager::PlayMusicParams pmp;
|
|
|
|
|
pmp.sFile = m_sPathToMusic;
|
2008-08-09 22:47:58 +00:00
|
|
|
pmp.bAlignBeat = MUSIC_ALIGN_BEAT;
|
2008-08-09 22:37:03 +00:00
|
|
|
SOUND->PlayMusic( pmp );
|
|
|
|
|
}
|
2005-03-22 22:53:39 +00:00
|
|
|
}
|
|
|
|
|
|
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-09-07 22:25:10 +00:00
|
|
|
if( m_MenuTimer == NULL )
|
2005-07-18 20:42:13 +00:00
|
|
|
return;
|
|
|
|
|
|
2006-11-21 20:14:25 +00:00
|
|
|
if( TIMER_SECONDS > 0.0f && (PREFSMAN->m_bMenuTimer || FORCE_TIMER) )
|
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
|
|
|
}
|
|
|
|
|
|
2005-10-13 22:17:13 +00:00
|
|
|
void ScreenWithMenuElements::StartTransitioningScreen( ScreenMessage smSendWhenDone )
|
2005-04-02 02:45:17 +00:00
|
|
|
{
|
2008-11-24 04:44:12 +00:00
|
|
|
TweenOffScreen();
|
2005-04-02 02:45:17 +00:00
|
|
|
|
2006-06-25 20:08:31 +00:00
|
|
|
m_Out.StartTransitioning( smSendWhenDone );
|
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();
|
2006-06-25 20:08:31 +00:00
|
|
|
float fSecondsUntilBeginOff = max( fSecondsUntilFinished - m_Out.GetTweenTimeLeft(), 0 );
|
2005-06-11 10:31:39 +00:00
|
|
|
m_Out.SetHibernate( fSecondsUntilBeginOff );
|
|
|
|
|
}
|
2005-04-02 02:45:17 +00:00
|
|
|
}
|
|
|
|
|
|
2008-11-24 04:44:12 +00:00
|
|
|
void ScreenWithMenuElements::TweenOnScreen()
|
|
|
|
|
{
|
|
|
|
|
this->PlayCommand( "On" );
|
|
|
|
|
}
|
|
|
|
|
|
2005-04-02 02:45:17 +00:00
|
|
|
void ScreenWithMenuElements::TweenOffScreen()
|
2002-05-28 20:01:22 +00:00
|
|
|
{
|
2005-09-07 22:25:10 +00:00
|
|
|
if( m_MenuTimer )
|
2003-09-26 23:27:22 +00:00
|
|
|
{
|
2003-11-07 20:10:38 +00:00
|
|
|
m_MenuTimer->SetSeconds( 0 );
|
|
|
|
|
m_MenuTimer->Stop();
|
2003-09-26 23:27:22 +00:00
|
|
|
}
|
2002-03-30 20:00:13 +00:00
|
|
|
|
2008-11-24 04:44:12 +00:00
|
|
|
this->PlayCommand( "Off" );
|
2002-12-19 22:24:13 +00:00
|
|
|
|
2006-02-24 03:02:00 +00:00
|
|
|
// If we're a stacked screen, then there's someone else between us and the
|
|
|
|
|
// background, so don't tween it off.
|
|
|
|
|
if( !SCREENMAN->IsStackedScreen(this) )
|
|
|
|
|
SCREENMAN->PlaySharedBackgroundOffCommand();
|
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
|
|
|
{
|
2006-06-25 18:11:09 +00:00
|
|
|
m_sNextScreen = GetPrevScreen();
|
|
|
|
|
|
2006-02-24 03:01:28 +00:00
|
|
|
if( CANCEL_TRANSITIONS_OUT )
|
|
|
|
|
{
|
|
|
|
|
StartTransitioningScreen( smSendWhenDone );
|
2006-06-28 04:18:46 +00:00
|
|
|
COMMAND( m_Out, "Cancel" );
|
2006-02-24 03:01:28 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
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-09-07 22:25:10 +00:00
|
|
|
if( m_MenuTimer )
|
2005-07-18 20:42:13 +00:00
|
|
|
m_MenuTimer->Stop();
|
2005-03-20 06:14:41 +00:00
|
|
|
m_Cancel.StartTransitioning( smSendWhenDone );
|
2006-06-28 04:18:46 +00:00
|
|
|
COMMAND( m_Cancel, "Cancel" );
|
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-09-07 22:25:10 +00:00
|
|
|
if( m_MenuTimer )
|
2005-07-18 20:42:13 +00:00
|
|
|
m_MenuTimer->Stop();
|
2003-11-07 20:10:38 +00:00
|
|
|
}
|
|
|
|
|
|
2006-06-24 18:06:05 +00:00
|
|
|
REGISTER_SCREEN_CLASS( ScreenWithMenuElementsSimple );
|
|
|
|
|
|
2006-09-15 01:47:24 +00:00
|
|
|
void ScreenWithMenuElementsSimple::MenuStart( const InputEventPlus &input )
|
2006-06-24 18:06:05 +00:00
|
|
|
{
|
|
|
|
|
if( IsTransitioning() )
|
|
|
|
|
return;
|
2006-06-27 23:18:22 +00:00
|
|
|
if( m_fLockInputSecs > 0 )
|
|
|
|
|
return;
|
2006-06-24 18:06:05 +00:00
|
|
|
|
|
|
|
|
StartTransitioningScreen( SM_GoToNextScreen );
|
|
|
|
|
}
|
|
|
|
|
|
2006-09-15 01:47:24 +00:00
|
|
|
void ScreenWithMenuElementsSimple::MenuBack( const InputEventPlus &input )
|
2006-06-24 18:06:05 +00:00
|
|
|
{
|
|
|
|
|
if( IsTransitioning() )
|
|
|
|
|
return;
|
2006-06-27 23:18:22 +00:00
|
|
|
if( m_fLockInputSecs > 0 )
|
|
|
|
|
return;
|
2006-06-24 18:06:05 +00:00
|
|
|
|
2006-06-28 04:18:46 +00:00
|
|
|
Cancel( SM_GoToPrevScreen );
|
2006-06-24 18:06:05 +00:00
|
|
|
}
|
|
|
|
|
|
2005-07-12 05:44:54 +00:00
|
|
|
// lua start
|
|
|
|
|
#include "LuaBinding.h"
|
|
|
|
|
|
|
|
|
|
class LunaScreenWithMenuElements: public Luna<ScreenWithMenuElements>
|
|
|
|
|
{
|
|
|
|
|
public:
|
2007-06-19 21:05:42 +00:00
|
|
|
static int Cancel( T* p, lua_State *L ) { p->Cancel( SM_GoToPrevScreen ); return 0; }
|
|
|
|
|
|
2006-09-27 19:47:52 +00:00
|
|
|
LunaScreenWithMenuElements()
|
2005-07-12 05:44:54 +00:00
|
|
|
{
|
2007-06-19 21:05:42 +00:00
|
|
|
ADD_METHOD( Cancel );
|
2005-07-12 05:44:54 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
LUA_REGISTER_DERIVED_CLASS( ScreenWithMenuElements, Screen )
|
2006-06-24 18:06:05 +00:00
|
|
|
|
|
|
|
|
class LunaScreenWithMenuElementsSimple: public Luna<ScreenWithMenuElementsSimple>
|
|
|
|
|
{
|
|
|
|
|
public:
|
2006-09-27 19:47:52 +00:00
|
|
|
LunaScreenWithMenuElementsSimple()
|
2006-06-24 18:06:05 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
LUA_REGISTER_DERIVED_CLASS( ScreenWithMenuElementsSimple, ScreenWithMenuElements )
|
|
|
|
|
|
2005-07-12 05:44:54 +00:00
|
|
|
// 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.
|
|
|
|
|
*/
|