2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2003-01-08 23:43:54 +00:00
|
|
|
#include "ScreenInstructions.h"
|
2002-08-26 05:53:48 +00:00
|
|
|
#include "RageUtil.h"
|
2004-07-08 00:10:34 +00:00
|
|
|
#include "GameSoundManager.h"
|
2002-08-26 05:53:48 +00:00
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "GameState.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "ThemeManager.h"
|
2002-12-17 20:58:53 +00:00
|
|
|
#include "PrefsManager.h"
|
2004-09-21 06:07:12 +00:00
|
|
|
#include "ScreenDimensions.h"
|
2002-08-26 05:53:48 +00:00
|
|
|
|
|
|
|
|
|
2004-05-01 23:19:33 +00:00
|
|
|
ScreenInstructions::ScreenInstructions( CString sName ) : ScreenWithMenuElements( sName )
|
2002-08-26 05:53:48 +00:00
|
|
|
{
|
2003-01-08 23:43:54 +00:00
|
|
|
LOG->Trace( "ScreenInstructions::ScreenInstructions()" );
|
2002-08-26 05:53:48 +00:00
|
|
|
|
2003-01-11 08:55:21 +00:00
|
|
|
//
|
2003-02-15 08:08:36 +00:00
|
|
|
// Skip this screen unless someone chose easy or beginner
|
2003-01-11 08:55:21 +00:00
|
|
|
//
|
2003-03-09 00:55:49 +00:00
|
|
|
if( !PREFSMAN->m_bInstructions )
|
|
|
|
|
{
|
|
|
|
|
HandleScreenMessage( SM_GoToNextScreen );
|
|
|
|
|
return;
|
|
|
|
|
}
|
2004-06-11 06:05:35 +00:00
|
|
|
if( GAMESTATE->m_PlayMode == PLAY_MODE_REGULAR )
|
2003-01-11 08:55:21 +00:00
|
|
|
{
|
2003-02-25 00:33:42 +00:00
|
|
|
Difficulty easiestDifficulty = (Difficulty)(NUM_DIFFICULTIES-1);
|
2004-05-08 05:47:37 +00:00
|
|
|
FOREACH_HumanPlayer(p)
|
2003-02-25 00:33:42 +00:00
|
|
|
easiestDifficulty = min( easiestDifficulty, GAMESTATE->m_PreferredDifficulty[p] );
|
2004-05-08 05:47:37 +00:00
|
|
|
|
2003-02-25 00:33:42 +00:00
|
|
|
if( easiestDifficulty > DIFFICULTY_EASY )
|
|
|
|
|
{
|
2003-03-09 00:55:49 +00:00
|
|
|
HandleScreenMessage( SM_GoToNextScreen );
|
2003-02-25 00:33:42 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2002-09-04 21:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
2004-08-26 04:25:16 +00:00
|
|
|
if( GAMESTATE->m_PlayMode == PLAY_MODE_INVALID )
|
2003-03-09 00:55:49 +00:00
|
|
|
RageException::Throw( "The PlayMode has not been set. A theme must set the PlayMode before showing ScreenInstructions." );
|
2002-08-26 05:53:48 +00:00
|
|
|
|
2004-08-26 04:25:16 +00:00
|
|
|
m_sprHowToPlay.Load( THEME->GetPathG(m_sName,PlayModeToString(GAMESTATE->m_PlayMode)) );
|
2002-08-26 05:53:48 +00:00
|
|
|
m_sprHowToPlay.SetXY( CENTER_X, CENTER_Y );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_sprHowToPlay );
|
2002-08-26 05:53:48 +00:00
|
|
|
|
|
|
|
|
m_sprHowToPlay.SetX( SCREEN_LEFT-SCREEN_WIDTH );
|
2002-09-02 21:59:58 +00:00
|
|
|
m_sprHowToPlay.BeginTweening( 0.4f ); // sleep
|
2003-03-10 00:16:49 +00:00
|
|
|
m_sprHowToPlay.BeginTweening( 0.6f, Actor::TWEEN_DECELERATE );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_sprHowToPlay.SetX( CENTER_X );
|
2002-08-27 16:53:25 +00:00
|
|
|
|
2004-05-08 05:47:37 +00:00
|
|
|
this->SortByDrawOrder();
|
|
|
|
|
|
2004-05-08 06:00:08 +00:00
|
|
|
SOUND->PlayMusic( THEME->GetPathS(m_sName,"music") );
|
2002-08-26 05:53:48 +00:00
|
|
|
}
|
|
|
|
|
|
2003-01-08 23:43:54 +00:00
|
|
|
void ScreenInstructions::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
2002-08-26 05:53:48 +00:00
|
|
|
{
|
2004-05-01 23:19:33 +00:00
|
|
|
if( IsTransitioning() )
|
2002-08-26 05:53:48 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// default input handler
|
|
|
|
|
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
|
|
|
|
}
|
|
|
|
|
|
2003-01-08 23:43:54 +00:00
|
|
|
void ScreenInstructions::MenuBack( PlayerNumber pn )
|
2002-08-26 05:53:48 +00:00
|
|
|
{
|
2004-05-01 23:19:33 +00:00
|
|
|
Back( SM_GoToPrevScreen );
|
2002-08-26 05:53:48 +00:00
|
|
|
}
|
|
|
|
|
|
2003-01-08 23:43:54 +00:00
|
|
|
void ScreenInstructions::MenuStart( PlayerNumber pn )
|
2002-08-26 05:53:48 +00:00
|
|
|
{
|
2004-05-01 23:19:33 +00:00
|
|
|
StartTransitioning( SM_GoToNextScreen );
|
2002-08-26 05:53:48 +00:00
|
|
|
|
2002-09-16 00:56:30 +00:00
|
|
|
m_sprHowToPlay.StopTweening();
|
2003-03-10 00:16:49 +00:00
|
|
|
m_sprHowToPlay.BeginTweening( 0.3f, Actor::TWEEN_ACCELERATE );
|
2003-04-12 06:16:12 +00:00
|
|
|
m_sprHowToPlay.SetX( SCREEN_RIGHT+m_sprHowToPlay.GetUnzoomedWidth()/2 );
|
2002-08-26 05:53:48 +00:00
|
|
|
}
|
2004-06-08 05:22:33 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* (c) 2001-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.
|
|
|
|
|
*/
|