2002-08-26 05:53:48 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: ScreenHowToPlay
|
|
|
|
|
|
|
|
|
|
Desc: See header.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenHowToPlay.h"
|
|
|
|
|
#include "RageTextureManager.h"
|
|
|
|
|
#include "RageUtil.h"
|
|
|
|
|
#include "RageMusic.h"
|
|
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "GameState.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "ThemeManager.h"
|
2002-08-26 05:53:48 +00:00
|
|
|
|
|
|
|
|
|
2002-08-27 03:59:22 +00:00
|
|
|
#define HELP_TEXT THEME->GetMetric("ScreenHowToPlay","HelpText")
|
|
|
|
|
#define TIMER_SECONDS THEME->GetMetricI("ScreenHowToPlay","TimerSeconds")
|
|
|
|
|
#define NEXT_SCREEN_ARCADE THEME->GetMetric("ScreenHowToPlay","NextScreenArcade")
|
|
|
|
|
#define NEXT_SCREEN_ONI THEME->GetMetric("ScreenHowToPlay","NextScreenOni")
|
|
|
|
|
|
|
|
|
|
|
2002-08-28 22:42:40 +00:00
|
|
|
const ScreenMessage SM_GoToPrevScreen = ScreenMessage(SM_User+1);
|
|
|
|
|
const ScreenMessage SM_GoToNextScreen = ScreenMessage(SM_User+2);
|
2002-08-26 05:53:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
ScreenHowToPlay::ScreenHowToPlay()
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace( "ScreenHowToPlay::ScreenHowToPlay()" );
|
|
|
|
|
|
|
|
|
|
m_Menu.Load(
|
2002-09-23 07:35:47 +00:00
|
|
|
THEME->GetPathTo("BGAnimations","How To Play"),
|
2002-08-26 05:53:48 +00:00
|
|
|
THEME->GetPathTo("Graphics","How To Play Top Edge"),
|
2002-09-03 22:31:06 +00:00
|
|
|
HELP_TEXT, false, true, TIMER_SECONDS
|
2002-08-26 05:53:48 +00:00
|
|
|
);
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_Menu );
|
2002-08-26 05:53:48 +00:00
|
|
|
|
2002-09-04 21:08:52 +00:00
|
|
|
if(!PREFSMAN->m_bHowToPlay)
|
|
|
|
|
{
|
2002-09-04 22:56:35 +00:00
|
|
|
m_Menu.ImmedOffScreenToMenu();
|
2002-09-04 21:08:52 +00:00
|
|
|
this->SendScreenMessage( SM_GoToNextScreen, 0.f );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-09 22:11:34 +00:00
|
|
|
m_Menu.TweenOnScreenFromMenu( SM_None, true );
|
2002-09-04 21:08:52 +00:00
|
|
|
|
2002-08-26 05:53:48 +00:00
|
|
|
CString sHowToPlayPath;
|
|
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_ARCADE:
|
2002-09-05 03:45:07 +00:00
|
|
|
sHowToPlayPath = THEME->GetPathTo("Graphics","how to play arcade");
|
|
|
|
|
break;
|
2002-08-26 05:53:48 +00:00
|
|
|
case PLAY_MODE_ENDLESS:
|
2002-09-05 03:45:07 +00:00
|
|
|
sHowToPlayPath = THEME->GetPathTo("Graphics","how to play endless");
|
2002-08-26 05:53:48 +00:00
|
|
|
break;
|
|
|
|
|
case PLAY_MODE_ONI:
|
2002-09-05 03:45:07 +00:00
|
|
|
sHowToPlayPath = THEME->GetPathTo("Graphics","how to play oni");
|
2002-08-26 05:53:48 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_sprHowToPlay.Load( sHowToPlayPath );
|
|
|
|
|
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
|
|
|
|
|
m_sprHowToPlay.BeginTweening( 0.6f, Actor::TWEEN_BIAS_BEGIN );
|
2002-08-27 03:59:22 +00:00
|
|
|
m_sprHowToPlay.SetTweenX( CENTER_X );
|
2002-08-27 16:53:25 +00:00
|
|
|
|
|
|
|
|
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","how to play music") );
|
2002-08-26 05:53:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScreenHowToPlay::~ScreenHowToPlay()
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace( "ScreenHowToPlay::~ScreenHowToPlay()" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenHowToPlay::Update( float fDeltaTime )
|
|
|
|
|
{
|
|
|
|
|
//LOG->Trace( "ScreenHowToPlay::Update(%f)", fDeltaTime );
|
|
|
|
|
|
|
|
|
|
Screen::Update( fDeltaTime );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenHowToPlay::DrawPrimitives()
|
|
|
|
|
{
|
|
|
|
|
m_Menu.DrawBottomLayer();
|
|
|
|
|
m_Menu.DrawTopLayer();
|
2002-09-09 22:11:34 +00:00
|
|
|
Screen::DrawPrimitives(); // draw How To Play graphic on top of all the others!
|
2002-08-26 05:53:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenHowToPlay::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
|
|
|
|
if( m_Menu.IsClosing() )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// default input handler
|
|
|
|
|
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenHowToPlay::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
switch( SM )
|
|
|
|
|
{
|
|
|
|
|
case SM_MenuTimer:
|
|
|
|
|
this->MenuStart(PLAYER_1);
|
|
|
|
|
break;
|
2002-08-28 22:42:40 +00:00
|
|
|
case SM_GoToPrevScreen:
|
|
|
|
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
|
|
|
|
break;
|
2002-08-27 23:31:41 +00:00
|
|
|
case SM_GoToNextScreen:
|
2002-08-26 05:53:48 +00:00
|
|
|
switch( GAMESTATE->m_PlayMode )
|
|
|
|
|
{
|
|
|
|
|
case PLAY_MODE_ARCADE:
|
2002-08-27 03:59:22 +00:00
|
|
|
SCREENMAN->SetNewScreen( NEXT_SCREEN_ARCADE );
|
2002-08-26 05:53:48 +00:00
|
|
|
break;
|
|
|
|
|
case PLAY_MODE_ONI:
|
|
|
|
|
case PLAY_MODE_ENDLESS:
|
2002-08-27 03:59:22 +00:00
|
|
|
SCREENMAN->SetNewScreen( NEXT_SCREEN_ONI );
|
2002-08-26 05:53:48 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenHowToPlay::MenuBack( PlayerNumber pn )
|
2002-08-26 05:53:48 +00:00
|
|
|
{
|
2002-08-28 22:42:40 +00:00
|
|
|
m_Menu.TweenOffScreenToBlack( SM_GoToPrevScreen, true );
|
2002-08-26 05:53:48 +00:00
|
|
|
}
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenHowToPlay::MenuStart( PlayerNumber pn )
|
2002-08-26 05:53:48 +00:00
|
|
|
{
|
2002-08-27 23:31:41 +00:00
|
|
|
m_Menu.TweenOffScreenToMenu( SM_GoToNextScreen );
|
2002-08-26 05:53:48 +00:00
|
|
|
|
2002-09-16 00:56:30 +00:00
|
|
|
m_sprHowToPlay.StopTweening();
|
2002-08-26 05:53:48 +00:00
|
|
|
m_sprHowToPlay.BeginTweening( 0.3f, Actor::TWEEN_BIAS_END );
|
2002-08-27 03:59:22 +00:00
|
|
|
m_sprHowToPlay.SetTweenX( SCREEN_RIGHT+m_sprHowToPlay.GetUnzoomedWidth()/2 );
|
2002-08-26 05:53:48 +00:00
|
|
|
}
|