Files
itgmania212121/stepmania/src/ScreenInstructions.cpp
T

103 lines
3.5 KiB
C++
Raw Normal View History

2003-02-16 04:01:45 +00:00
#include "global.h"
#include "ScreenInstructions.h"
#include "RageUtil.h"
2004-07-08 00:10:34 +00:00
#include "GameSoundManager.h"
#include "ScreenManager.h"
#include "GameConstantsAndTypes.h"
#include "RageLog.h"
#include "GameState.h"
#include "ThemeManager.h"
2002-12-17 20:58:53 +00:00
#include "PrefsManager.h"
#include "ScreenDimensions.h"
ScreenInstructions::ScreenInstructions( CString sName ) : ScreenWithMenuElements( sName )
{
LOG->Trace( "ScreenInstructions::ScreenInstructions()" );
//
// Skip this screen unless someone chose easy or beginner
//
2003-03-09 00:55:49 +00:00
if( !PREFSMAN->m_bInstructions )
{
HandleScreenMessage( SM_GoToNextScreen );
return;
}
if( GAMESTATE->m_PlayMode == PLAY_MODE_REGULAR )
{
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;
}
}
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." );
2004-08-26 04:25:16 +00:00
m_sprHowToPlay.Load( THEME->GetPathG(m_sName,PlayModeToString(GAMESTATE->m_PlayMode)) );
m_sprHowToPlay.SetXY( CENTER_X, CENTER_Y );
this->AddChild( &m_sprHowToPlay );
m_sprHowToPlay.SetX( SCREEN_LEFT-SCREEN_WIDTH );
m_sprHowToPlay.BeginTweening( 0.4f ); // sleep
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") );
}
void ScreenInstructions::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
if( IsTransitioning() )
return;
// default input handler
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
}
void ScreenInstructions::MenuBack( PlayerNumber pn )
{
Back( SM_GoToPrevScreen );
}
void ScreenInstructions::MenuStart( PlayerNumber pn )
{
StartTransitioning( SM_GoToNextScreen );
m_sprHowToPlay.StopTweening();
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 );
}
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.
*/