2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2002-05-20 08:59:37 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
2002-06-14 22:25:22 +00:00
|
|
|
Class: ScreenSelectMusic
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-06-14 22:25:22 +00:00
|
|
|
Desc: See header.
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-06-14 22:25:22 +00:00
|
|
|
Chris Danford
|
2002-05-20 08:59:37 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "ScreenSelectMusic.h"
|
|
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "SongManager.h"
|
|
|
|
|
#include "GameManager.h"
|
2003-07-26 23:05:16 +00:00
|
|
|
#include "RageSounds.h"
|
2002-05-20 08:59:37 +00:00
|
|
|
#include "GameConstantsAndTypes.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "PrefsManager.h"
|
2002-05-20 08:59:37 +00:00
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "InputMapper.h"
|
|
|
|
|
#include "AnnouncerManager.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "InputMapper.h"
|
|
|
|
|
#include "GameState.h"
|
2002-09-02 21:59:58 +00:00
|
|
|
#include "CodeDetector.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include <math.h>
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "ThemeManager.h"
|
2003-08-03 00:13:55 +00:00
|
|
|
#include "Steps.h"
|
2003-04-13 21:17:14 +00:00
|
|
|
#include "ActorUtil.h"
|
2003-04-23 02:23:51 +00:00
|
|
|
#include "RageDisplay.h"
|
2003-05-15 06:09:19 +00:00
|
|
|
#include "RageTextureManager.h"
|
2003-07-20 05:13:45 +00:00
|
|
|
#include "Course.h"
|
2003-09-08 07:21:41 +00:00
|
|
|
#include "ProfileManager.h"
|
2003-11-07 20:10:38 +00:00
|
|
|
#include "MenuTimer.h"
|
2003-11-16 04:45:12 +00:00
|
|
|
#include "LightsManager.h"
|
2003-12-23 00:26:00 +00:00
|
|
|
#include "StageStats.h"
|
2003-05-15 06:09:19 +00:00
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
|
2003-03-28 23:13:32 +00:00
|
|
|
const int NUM_SCORE_DIGITS = 9;
|
2003-03-24 21:37:13 +00:00
|
|
|
|
2003-05-30 19:30:06 +00:00
|
|
|
#define FOV THEME->GetMetricF("ScreenSelectMusic","FOV")
|
2003-11-16 21:56:18 +00:00
|
|
|
#define FOV_CENTER_X THEME->GetMetricF("ScreenSelectMusic","FOVCenterX")
|
|
|
|
|
#define FOV_CENTER_Y THEME->GetMetricF("ScreenSelectMusic","FOVCenterY")
|
2003-03-24 21:37:13 +00:00
|
|
|
#define BANNER_WIDTH THEME->GetMetricF("ScreenSelectMusic","BannerWidth")
|
|
|
|
|
#define BANNER_HEIGHT THEME->GetMetricF("ScreenSelectMusic","BannerHeight")
|
|
|
|
|
#define SONG_OPTIONS_EXTRA_COMMAND THEME->GetMetric ("ScreenSelectMusic","SongOptionsExtraCommand")
|
|
|
|
|
#define SAMPLE_MUSIC_DELAY THEME->GetMetricF("ScreenSelectMusic","SampleMusicDelay")
|
2003-04-22 08:43:12 +00:00
|
|
|
#define SHOW_RADAR THEME->GetMetricB("ScreenSelectMusic","ShowRadar")
|
|
|
|
|
#define SHOW_GRAPH THEME->GetMetricB("ScreenSelectMusic","ShowGraph")
|
2003-11-17 06:13:12 +00:00
|
|
|
#define SHOW_PANES THEME->GetMetricB("ScreenSelectMusic","ShowPanes")
|
2003-11-17 04:29:14 +00:00
|
|
|
#define SHOW_DIFFICULTY_LIST THEME->GetMetricB("ScreenSelectMusic","ShowDifficultyList")
|
2003-05-20 05:52:40 +00:00
|
|
|
#define CDTITLE_SPIN_SECONDS THEME->GetMetricF("ScreenSelectMusic","CDTitleSpinSeconds")
|
2003-07-03 06:38:57 +00:00
|
|
|
#define PREV_SCREEN( play_mode ) THEME->GetMetric ("ScreenSelectMusic","PrevScreen"+Capitalize(PlayModeToString(play_mode)))
|
|
|
|
|
#define NEXT_SCREEN( play_mode ) THEME->GetMetric ("ScreenSelectMusic","NextScreen"+Capitalize(PlayModeToString(play_mode)))
|
|
|
|
|
#define NEXT_OPTIONS_SCREEN( play_mode ) THEME->GetMetric ("ScreenSelectMusic","NextOptionsScreen"+Capitalize(PlayModeToString(play_mode)))
|
2003-07-20 21:44:04 +00:00
|
|
|
#define SCORE_SORT_CHANGE_COMMAND(i) THEME->GetMetric ("ScreenSelectMusic",ssprintf("ScoreP%iSortChangeCommand", i+1))
|
|
|
|
|
#define SCORE_FRAME_SORT_CHANGE_COMMAND(i) THEME->GetMetric ("ScreenSelectMusic",ssprintf("ScoreFrameP%iSortChangeCommand", i+1))
|
2004-01-11 07:18:51 +00:00
|
|
|
#define DO_ROULETTE_ON_MENU_TIMER THEME->GetMetricB("ScreenSelectMusic","DoRouletteOnMenuTimer")
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-02-17 00:39:33 +00:00
|
|
|
static const ScreenMessage SM_AllowOptionsMenuRepeat = ScreenMessage(SM_User+1);
|
2003-06-30 06:51:05 +00:00
|
|
|
CString g_sFallbackCDTitlePath;
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-05-20 05:31:38 +00:00
|
|
|
/* We make a backface for the CDTitle by rotating it on Y and mirroring it
|
|
|
|
|
* on Y by flipping texture coordinates. */
|
|
|
|
|
static void FlipSpriteHorizontally(Sprite &s)
|
|
|
|
|
{
|
2003-07-10 02:08:18 +00:00
|
|
|
s.StopUsingCustomCoords();
|
|
|
|
|
|
2003-06-23 04:49:28 +00:00
|
|
|
float Coords[8];
|
2003-07-03 06:38:57 +00:00
|
|
|
s.GetActiveTextureCoords(Coords);
|
2003-06-23 04:49:28 +00:00
|
|
|
swap(Coords[0], Coords[6]); /* top left X <-> top right X */
|
|
|
|
|
swap(Coords[1], Coords[7]); /* top left Y <-> top right Y */
|
|
|
|
|
swap(Coords[2], Coords[4]); /* bottom left X <-> bottom left X */
|
|
|
|
|
swap(Coords[3], Coords[5]); /* bottom left Y <-> bottom left Y */
|
|
|
|
|
s.SetCustomTextureCoords(Coords);
|
2003-05-20 05:31:38 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-09-27 22:30:51 +00:00
|
|
|
ScreenSelectMusic::ScreenSelectMusic( CString sClassName ) : Screen( sClassName )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2002-08-04 08:03:41 +00:00
|
|
|
LOG->Trace( "ScreenSelectMusic::ScreenSelectMusic()" );
|
2003-07-20 05:13:45 +00:00
|
|
|
|
2003-11-16 04:45:12 +00:00
|
|
|
LIGHTSMAN->SetLightMode( LIGHTMODE_MENU );
|
|
|
|
|
|
2003-07-20 05:13:45 +00:00
|
|
|
m_bInCourseDisplayMode = GAMESTATE->IsCourseMode();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2004-02-06 03:57:47 +00:00
|
|
|
/* Finish any previous stage. It's OK to call this when we havn't played a stage yet.
|
|
|
|
|
* Do this before anything that might look at GAMESTATE->m_iCurrentStageIndex. */
|
2004-01-22 03:11:40 +00:00
|
|
|
GAMESTATE->FinishStage();
|
|
|
|
|
|
2003-06-30 06:51:05 +00:00
|
|
|
/* Cache: */
|
|
|
|
|
g_sFallbackCDTitlePath = THEME->GetPathToG("ScreenSelectMusic fallback cdtitle");
|
2003-03-16 07:29:58 +00:00
|
|
|
|
|
|
|
|
if( GAMESTATE->m_CurStyle == STYLE_INVALID )
|
|
|
|
|
RageException::Throw( "The Style has not been set. A theme must set the Style before loading ScreenSelectMusic." );
|
|
|
|
|
|
|
|
|
|
if( GAMESTATE->m_PlayMode == PLAY_MODE_INVALID )
|
|
|
|
|
RageException::Throw( "The PlayMode has not been set. A theme must set the PlayMode before loading ScreenSelectMusic." );
|
|
|
|
|
|
2004-02-06 03:57:47 +00:00
|
|
|
m_MusicWheel.Load();
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
int p;
|
|
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
m_Menu.Load( "ScreenSelectMusic" );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_Menu );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-12-04 04:28:19 +00:00
|
|
|
// pop'n music has this under the songwheel...
|
2003-11-21 04:35:06 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
Character* pChar = GAMESTATE->m_pCurCharacters[p];
|
|
|
|
|
m_sprCharacterIcon[p].SetName( ssprintf("CharacterIconP%d",p+1) );
|
|
|
|
|
m_sprCharacterIcon[p].Load( pChar->GetSongSelectIconPath() );
|
|
|
|
|
SET_XY( m_sprCharacterIcon[p] );
|
|
|
|
|
this->AddChild( &m_sprCharacterIcon[p] );
|
|
|
|
|
}
|
|
|
|
|
|
2003-12-04 04:28:19 +00:00
|
|
|
|
|
|
|
|
|
2003-11-18 21:55:29 +00:00
|
|
|
m_MusicWheelUnder.Load( THEME->GetPathToG("ScreenSelectMusic wheel under") );
|
|
|
|
|
m_MusicWheelUnder->SetName( "WheelUnder" );
|
|
|
|
|
SET_XY( m_MusicWheelUnder );
|
|
|
|
|
this->AddChild( m_MusicWheelUnder );
|
|
|
|
|
|
2003-11-18 19:06:35 +00:00
|
|
|
m_MusicWheel.SetName( "MusicWheel", "Wheel" );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_MusicWheel );
|
2003-05-02 20:36:26 +00:00
|
|
|
this->AddChild( &m_MusicWheel );
|
|
|
|
|
|
2003-05-15 06:09:19 +00:00
|
|
|
m_sprBannerMask.SetName( "Banner" ); // use the same metrics and animation as Banner
|
|
|
|
|
m_sprBannerMask.Load( THEME->GetPathToG("ScreenSelectMusic banner mask") );
|
|
|
|
|
m_sprBannerMask.SetBlendMode( BLEND_NO_EFFECT ); // don't draw to color buffer
|
2003-11-18 20:35:45 +00:00
|
|
|
m_sprBannerMask.SetZWrite( true ); // do draw to the zbuffer
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_sprBannerMask );
|
2003-05-15 06:09:19 +00:00
|
|
|
this->AddChild( &m_sprBannerMask );
|
|
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
// this is loaded SetSong and TweenToSong
|
|
|
|
|
m_Banner.SetName( "Banner" );
|
2003-11-18 20:35:45 +00:00
|
|
|
m_Banner.SetZTest( true ); // do have to pass the z test
|
2003-07-03 06:38:57 +00:00
|
|
|
m_Banner.ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_Banner );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_Banner );
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprBannerFrame.Load( THEME->GetPathToG("ScreenSelectMusic banner frame") );
|
2003-11-14 17:56:10 +00:00
|
|
|
m_sprBannerFrame->SetName( "BannerFrame" );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_sprBannerFrame );
|
2003-11-14 17:56:10 +00:00
|
|
|
this->AddChild( m_sprBannerFrame );
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-11-17 03:34:13 +00:00
|
|
|
m_BPMDisplay.SetName( "BPMDisplay" );
|
2003-11-14 18:31:28 +00:00
|
|
|
m_BPMDisplay.Load();
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_BPMDisplay );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_BPMDisplay );
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-11-14 23:11:57 +00:00
|
|
|
m_DifficultyDisplay.SetName( "DifficultyDisplay" );
|
|
|
|
|
m_DifficultyDisplay.EnableShadow( false );
|
|
|
|
|
SET_XY( m_DifficultyDisplay );
|
2003-06-18 07:10:03 +00:00
|
|
|
this->AddChild( &m_DifficultyDisplay );
|
|
|
|
|
|
2003-10-09 04:22:17 +00:00
|
|
|
{
|
|
|
|
|
CStringArray StageTexts;
|
|
|
|
|
GAMESTATE->GetAllStageTexts( StageTexts );
|
|
|
|
|
for( unsigned i = 0; i < StageTexts.size(); ++i )
|
|
|
|
|
{
|
2003-10-24 04:56:17 +00:00
|
|
|
CString path = THEME->GetPathToG( "ScreenSelectMusic stage "+StageTexts[i], true );
|
|
|
|
|
if( path != "" )
|
|
|
|
|
TEXTUREMAN->CacheTexture( path );
|
2003-10-09 04:22:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-11-25 18:25:43 +00:00
|
|
|
// loaded in AfterMusicChange
|
2003-10-09 05:31:44 +00:00
|
|
|
m_sprStage.SetName( "Stage" );
|
|
|
|
|
SET_XY( m_sprStage );
|
|
|
|
|
this->AddChild( &m_sprStage );
|
|
|
|
|
|
2003-05-20 05:31:38 +00:00
|
|
|
m_sprCDTitleFront.SetName( "CDTitle" );
|
|
|
|
|
m_sprCDTitleFront.Load( THEME->GetPathToG("ScreenSelectMusic fallback cdtitle") );
|
2004-02-04 11:05:33 +00:00
|
|
|
m_sprCDTitleFront.SetCullMode( CULL_BACK );
|
2003-05-20 05:31:38 +00:00
|
|
|
m_sprCDTitleFront.SetDiffuse( RageColor(1,1,1,1) );
|
2003-05-20 05:52:40 +00:00
|
|
|
m_sprCDTitleFront.SetEffectSpin( RageVector3(0, 360/CDTITLE_SPIN_SECONDS, 0) );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_sprCDTitleFront );
|
2003-05-20 05:31:38 +00:00
|
|
|
this->AddChild( &m_sprCDTitleFront );
|
|
|
|
|
|
|
|
|
|
m_sprCDTitleBack.SetName( "CDTitle" );
|
|
|
|
|
m_sprCDTitleBack.Load( THEME->GetPathToG("ScreenSelectMusic fallback cdtitle") );
|
|
|
|
|
FlipSpriteHorizontally(m_sprCDTitleBack);
|
2004-02-04 11:05:33 +00:00
|
|
|
m_sprCDTitleBack.SetCullMode( CULL_BACK );
|
2003-05-20 05:31:38 +00:00
|
|
|
m_sprCDTitleBack.SetDiffuse( RageColor(0.2f,0.2f,0.2f,1) );
|
|
|
|
|
m_sprCDTitleBack.SetRotationY( 180 );
|
2003-05-20 05:52:40 +00:00
|
|
|
m_sprCDTitleBack.SetEffectSpin( RageVector3(0, 360/CDTITLE_SPIN_SECONDS, 0) );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_sprCDTitleBack );
|
2003-05-20 05:31:38 +00:00
|
|
|
this->AddChild( &m_sprCDTitleBack );
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_GrooveRadar.SetName( "Radar" );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_GrooveRadar );
|
2003-04-22 08:43:12 +00:00
|
|
|
if( SHOW_RADAR )
|
|
|
|
|
this->AddChild( &m_GrooveRadar );
|
|
|
|
|
|
|
|
|
|
m_GrooveGraph.SetName( "Graph" );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_GrooveGraph );
|
2003-04-22 08:43:12 +00:00
|
|
|
if( SHOW_GRAPH )
|
|
|
|
|
this->AddChild( &m_GrooveGraph );
|
2003-03-24 21:37:13 +00:00
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_textSongOptions.SetName( "SongOptions" );
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textSongOptions.LoadFromFont( THEME->GetPathToF("Common normal") );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_textSongOptions );
|
2003-03-24 21:37:13 +00:00
|
|
|
this->AddChild( &m_textSongOptions );
|
|
|
|
|
|
2003-11-16 21:43:25 +00:00
|
|
|
m_CourseContentsFrame.SetName( "CourseContents" );
|
|
|
|
|
SET_XY( m_CourseContentsFrame );
|
2003-07-20 05:13:45 +00:00
|
|
|
this->AddChild( &m_CourseContentsFrame );
|
|
|
|
|
|
2003-11-17 04:12:11 +00:00
|
|
|
m_Artist.SetName( "ArtistDisplay" );
|
|
|
|
|
m_Artist.Load();
|
|
|
|
|
SET_XY( m_Artist );
|
|
|
|
|
this->AddChild( &m_Artist );
|
|
|
|
|
|
|
|
|
|
m_MachineRank.SetName( "MachineRank" );
|
|
|
|
|
m_MachineRank.LoadFromFont( THEME->GetPathToF("ScreenSelectMusic rank") );
|
|
|
|
|
SET_XY( m_MachineRank );
|
|
|
|
|
this->AddChild( &m_MachineRank );
|
|
|
|
|
|
2003-11-18 04:02:55 +00:00
|
|
|
if( SHOW_DIFFICULTY_LIST )
|
|
|
|
|
{
|
|
|
|
|
m_DifficultyList.SetName( "DifficultyList" );
|
|
|
|
|
m_DifficultyList.Load();
|
|
|
|
|
SET_XY_AND_ON_COMMAND( m_DifficultyList );
|
|
|
|
|
this->AddChild( &m_DifficultyList );
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-04-07 21:24:14 +00:00
|
|
|
if( !GAMESTATE->IsHumanPlayer(p) )
|
2002-09-03 06:33:08 +00:00
|
|
|
continue; // skip
|
|
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_sprDifficultyFrame[p].SetName( ssprintf("DifficultyFrameP%d",p+1) );
|
2003-07-04 23:33:00 +00:00
|
|
|
m_sprDifficultyFrame[p].Load( THEME->GetPathToG(ssprintf("ScreenSelectMusic difficulty frame p%d",p+1)) );
|
2002-09-03 06:33:08 +00:00
|
|
|
m_sprDifficultyFrame[p].StopAnimating();
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_sprDifficultyFrame[p] );
|
2002-09-03 06:33:08 +00:00
|
|
|
this->AddChild( &m_sprDifficultyFrame[p] );
|
|
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_DifficultyIcon[p].SetName( ssprintf("DifficultyIconP%d",p+1) );
|
2004-02-08 01:05:53 +00:00
|
|
|
m_DifficultyIcon[p].Load( THEME->GetPathToG(ssprintf("ScreenSelectMusic difficulty icons 1x%d",NUM_DIFFICULTIES)) );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_DifficultyIcon[p] );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_DifficultyIcon[p] );
|
2003-01-11 08:55:21 +00:00
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_AutoGenIcon[p].SetName( ssprintf("AutogenIconP%d",p+1) );
|
2003-04-12 17:39:27 +00:00
|
|
|
m_AutoGenIcon[p].Load( THEME->GetPathToG("ScreenSelectMusic autogen") );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_AutoGenIcon[p] );
|
2003-01-11 08:55:21 +00:00
|
|
|
this->AddChild( &m_AutoGenIcon[p] );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_OptionIconRow[p].SetName( ssprintf("OptionIconsP%d",p+1) );
|
2004-01-18 20:15:02 +00:00
|
|
|
m_OptionIconRow[p].Load( (PlayerNumber)p );
|
|
|
|
|
m_OptionIconRow[p].Refresh();
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_OptionIconRow[p] );
|
2002-09-03 06:33:08 +00:00
|
|
|
this->AddChild( &m_OptionIconRow[p] );
|
|
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_sprMeterFrame[p].SetName( ssprintf("MeterFrameP%d",p+1) );
|
2003-07-04 23:33:00 +00:00
|
|
|
m_sprMeterFrame[p].Load( THEME->GetPathToG(ssprintf("ScreenSelectMusic meter frame p%d",p+1)) );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_sprMeterFrame[p] );
|
2002-09-03 06:33:08 +00:00
|
|
|
this->AddChild( &m_sprMeterFrame[p] );
|
|
|
|
|
|
2003-11-17 06:13:12 +00:00
|
|
|
if( SHOW_PANES )
|
|
|
|
|
{
|
|
|
|
|
m_PaneDisplay[p].SetName( "PaneDisplay", ssprintf("PaneDisplayP%d",p+1) );
|
|
|
|
|
m_PaneDisplay[p].Load( (PlayerNumber) p );
|
|
|
|
|
this->AddChild( &m_PaneDisplay[p] );
|
|
|
|
|
}
|
|
|
|
|
|
2003-11-17 06:57:53 +00:00
|
|
|
m_DifficultyMeter[p].SetName( "DifficultyMeter", ssprintf("MeterP%d",p+1) );
|
|
|
|
|
m_DifficultyMeter[p].Load();
|
|
|
|
|
SET_XY_AND_ON_COMMAND( m_DifficultyMeter[p] );
|
|
|
|
|
this->AddChild( &m_DifficultyMeter[p] );
|
|
|
|
|
|
2003-11-21 04:35:06 +00:00
|
|
|
// add an icon onto the song select to show what
|
|
|
|
|
// character they're using.
|
|
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_sprHighScoreFrame[p].SetName( ssprintf("ScoreFrameP%d",p+1) );
|
2003-07-04 23:33:00 +00:00
|
|
|
m_sprHighScoreFrame[p].Load( THEME->GetPathToG(ssprintf("ScreenSelectMusic score frame p%d",p+1)) );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_sprHighScoreFrame[p] );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_sprHighScoreFrame[p] );
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_textHighScore[p].SetName( ssprintf("ScoreP%d",p+1) );
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textHighScore[p].LoadFromNumbers( THEME->GetPathToN("ScreenSelectMusic score") );
|
2003-03-28 23:13:32 +00:00
|
|
|
m_textHighScore[p].EnableShadow( false );
|
|
|
|
|
m_textHighScore[p].SetDiffuse( PlayerToColor(p) );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_textHighScore[p] );
|
2003-03-28 23:13:32 +00:00
|
|
|
this->AddChild( &m_textHighScore[p] );
|
2002-08-13 23:26:46 +00:00
|
|
|
}
|
|
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_MusicSortDisplay.SetName( "SortIcon" );
|
2004-03-12 08:31:40 +00:00
|
|
|
m_MusicSortDisplay.Set( GAMESTATE->m_SortOrder );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_MusicSortDisplay );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_MusicSortDisplay );
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-04-21 22:26:07 +00:00
|
|
|
m_sprBalloon.SetName( "Balloon" );
|
|
|
|
|
TEXTUREMAN->CacheTexture( THEME->GetPathToG("ScreenSelectMusic balloon long") );
|
|
|
|
|
TEXTUREMAN->CacheTexture( THEME->GetPathToG("ScreenSelectMusic balloon marathon") );
|
|
|
|
|
this->AddChild( &m_sprBalloon );
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_sprOptionsMessage.SetName( "OptionsMessage" );
|
2003-04-12 17:39:27 +00:00
|
|
|
m_sprOptionsMessage.Load( THEME->GetPathToG("ScreenSelectMusic options message 1x2") );
|
2002-09-22 18:18:50 +00:00
|
|
|
m_sprOptionsMessage.StopAnimating();
|
2003-03-24 21:37:13 +00:00
|
|
|
m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); // invisible
|
2003-03-10 02:29:01 +00:00
|
|
|
//this->AddChild( &m_sprOptionsMessage ); // we have to draw this manually over the top of transitions
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2004-01-22 04:31:31 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsPlayerEnabled( p ))
|
|
|
|
|
{
|
|
|
|
|
m_sprNonPresence[p].SetName( ssprintf("NonPresenceP%d",p+1) );
|
|
|
|
|
m_sprNonPresence[p].Load( THEME->GetPathToG(ssprintf("ScreenSelectMusic nonpresence p%d",p+1)) );
|
|
|
|
|
SET_XY( m_sprNonPresence[p] );
|
|
|
|
|
this->AddChild( &m_sprNonPresence[p] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-12-19 09:30:54 +00:00
|
|
|
m_bgOverlay.SetName( "BGAOverlay");
|
|
|
|
|
m_bgOverlay.LoadFromAniDir( THEME->GetPathToB("ScreenSelectMusic Overlay"));
|
|
|
|
|
this->AddChild( &m_bgOverlay );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2004-02-19 03:56:50 +00:00
|
|
|
m_bgOptionsOut.Load( THEME->GetPathToB(m_sName+" options out") );
|
|
|
|
|
// this->AddChild( &m_bgOptionsOut ); // drawn on top
|
|
|
|
|
m_bgNoOptionsOut.Load( THEME->GetPathToB(m_sName+" no options out") );
|
|
|
|
|
// this->AddChild( &m_bgNoOptionsOut ); // drawn on top
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_soundSelect.Load( THEME->GetPathToS("Common start") );
|
2004-01-10 21:35:39 +00:00
|
|
|
m_soundDifficultyEasier.Load( THEME->GetPathToS("ScreenSelectMusic difficulty easier") );
|
|
|
|
|
m_soundDifficultyHarder.Load( THEME->GetPathToS("ScreenSelectMusic difficulty harder") );
|
2003-04-12 17:39:27 +00:00
|
|
|
m_soundOptionsChange.Load( THEME->GetPathToS("ScreenSelectMusic options") );
|
|
|
|
|
m_soundLocked.Load( THEME->GetPathToS("ScreenSelectMusic locked") );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("select music intro") );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-06-14 22:25:22 +00:00
|
|
|
m_bMadeChoice = false;
|
|
|
|
|
m_bGoToOptions = false;
|
2002-10-06 16:56:58 +00:00
|
|
|
m_fPlaySampleCountdown = 0;
|
2003-02-10 22:10:12 +00:00
|
|
|
m_bAllowOptionsMenu = m_bAllowOptionsMenuRepeat = false;
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-08-04 08:03:41 +00:00
|
|
|
UpdateOptionsDisplays();
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
AfterMusicChange();
|
|
|
|
|
TweenOnScreen();
|
2004-02-13 05:39:15 +00:00
|
|
|
|
2004-02-14 01:48:37 +00:00
|
|
|
// this->SortByZ();
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ScreenSelectMusic::~ScreenSelectMusic()
|
|
|
|
|
{
|
2002-08-04 08:03:41 +00:00
|
|
|
LOG->Trace( "ScreenSelectMusic::~ScreenSelectMusic()" );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::DrawPrimitives()
|
|
|
|
|
{
|
2003-09-21 02:36:28 +00:00
|
|
|
DISPLAY->CameraPushMatrix();
|
2003-11-16 21:56:18 +00:00
|
|
|
DISPLAY->LoadMenuPerspective( FOV, FOV_CENTER_X, FOV_CENTER_Y );
|
2003-04-23 02:23:51 +00:00
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
m_Menu.DrawBottomLayer();
|
|
|
|
|
Screen::DrawPrimitives();
|
|
|
|
|
m_Menu.DrawTopLayer();
|
2003-03-10 02:29:01 +00:00
|
|
|
m_sprOptionsMessage.Draw();
|
2004-02-19 03:56:50 +00:00
|
|
|
m_bgOptionsOut.Draw();
|
|
|
|
|
m_bgNoOptionsOut.Draw();
|
2003-04-23 02:23:51 +00:00
|
|
|
|
2003-09-21 02:36:28 +00:00
|
|
|
DISPLAY->CameraPopMatrix();
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2003-07-20 05:13:45 +00:00
|
|
|
void ScreenSelectMusic::TweenSongPartsOnScreen( bool Initial )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2003-07-20 05:13:45 +00:00
|
|
|
m_GrooveRadar.StopTweening();
|
|
|
|
|
m_GrooveGraph.StopTweening();
|
2003-03-24 21:37:13 +00:00
|
|
|
m_GrooveRadar.TweenOnScreen();
|
2003-04-22 08:43:12 +00:00
|
|
|
m_GrooveGraph.TweenOnScreen();
|
2003-11-17 04:32:58 +00:00
|
|
|
if( SHOW_DIFFICULTY_LIST )
|
|
|
|
|
{
|
|
|
|
|
if( Initial )
|
|
|
|
|
{
|
|
|
|
|
ON_COMMAND( m_DifficultyList );
|
|
|
|
|
m_DifficultyList.TweenOnScreen();
|
|
|
|
|
}
|
2004-02-18 23:58:33 +00:00
|
|
|
// else // do this after SM_SortOrderChanged
|
|
|
|
|
// m_DifficultyList.Show();
|
2003-11-17 04:32:58 +00:00
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
|
2004-01-22 07:15:08 +00:00
|
|
|
int p;
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-07-20 05:13:45 +00:00
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsHumanPlayer(p) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
|
|
|
|
ON_COMMAND( m_sprDifficultyFrame[p] );
|
|
|
|
|
ON_COMMAND( m_sprMeterFrame[p] );
|
|
|
|
|
ON_COMMAND( m_DifficultyIcon[p] );
|
|
|
|
|
ON_COMMAND( m_AutoGenIcon[p] );
|
|
|
|
|
}
|
2004-01-22 07:15:08 +00:00
|
|
|
|
2004-01-22 04:31:31 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2004-01-22 07:15:08 +00:00
|
|
|
if( GAMESTATE->IsPlayerEnabled(p) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
|
|
|
|
ON_COMMAND( m_sprNonPresence[p] );
|
2004-01-22 04:31:31 +00:00
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
}
|
|
|
|
|
|
2003-11-16 21:51:02 +00:00
|
|
|
void ScreenSelectMusic::TweenSongPartsOffScreen( bool Final )
|
2003-07-20 05:13:45 +00:00
|
|
|
{
|
|
|
|
|
m_GrooveRadar.TweenOffScreen();
|
|
|
|
|
m_GrooveGraph.TweenOffScreen();
|
2003-11-17 04:32:58 +00:00
|
|
|
if( SHOW_DIFFICULTY_LIST )
|
|
|
|
|
{
|
|
|
|
|
if( Final )
|
|
|
|
|
{
|
|
|
|
|
OFF_COMMAND( m_DifficultyList );
|
|
|
|
|
m_DifficultyList.TweenOffScreen();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
m_DifficultyList.Hide();
|
|
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
|
2004-01-22 07:15:08 +00:00
|
|
|
int p;
|
|
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
2003-07-20 05:13:45 +00:00
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsHumanPlayer(p) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
|
|
|
|
OFF_COMMAND( m_sprDifficultyFrame[p] );
|
|
|
|
|
OFF_COMMAND( m_sprMeterFrame[p] );
|
|
|
|
|
OFF_COMMAND( m_DifficultyIcon[p] );
|
|
|
|
|
OFF_COMMAND( m_AutoGenIcon[p] );
|
|
|
|
|
}
|
2004-01-22 07:15:08 +00:00
|
|
|
|
2004-01-22 04:31:31 +00:00
|
|
|
for( p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2004-01-22 07:15:08 +00:00
|
|
|
if( GAMESTATE->IsPlayerEnabled( p ))
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
|
|
|
|
OFF_COMMAND( m_sprNonPresence[p] );
|
2004-01-22 04:31:31 +00:00
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::TweenCoursePartsOnScreen( bool Initial )
|
|
|
|
|
{
|
|
|
|
|
m_CourseContentsFrame.SetZoomY( 1 );
|
|
|
|
|
if( Initial )
|
2003-11-17 06:14:52 +00:00
|
|
|
{
|
2004-02-14 03:38:34 +00:00
|
|
|
m_CourseContentsFrame.Command( "ZoomY,0;BounceEnd,0.3;Zoom,1" );
|
2003-11-17 06:14:52 +00:00
|
|
|
COMMAND( m_CourseContentsFrame, "On" );
|
|
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
else
|
2003-11-17 06:14:52 +00:00
|
|
|
{
|
2003-07-20 05:13:45 +00:00
|
|
|
m_CourseContentsFrame.SetFromCourse(NULL);
|
2003-11-17 06:14:52 +00:00
|
|
|
COMMAND( m_CourseContentsFrame, "Show" );
|
|
|
|
|
}
|
|
|
|
|
// XXX: if !Initial, m_CourseContentsFrame.Hide?
|
2003-07-20 05:13:45 +00:00
|
|
|
}
|
|
|
|
|
|
2003-11-16 21:51:02 +00:00
|
|
|
void ScreenSelectMusic::TweenCoursePartsOffScreen( bool Final )
|
2003-07-20 05:13:45 +00:00
|
|
|
{
|
2003-11-17 06:14:52 +00:00
|
|
|
if( Final )
|
|
|
|
|
{
|
|
|
|
|
m_CourseContentsFrame.SetZoomY( 1 );
|
2004-02-14 03:38:34 +00:00
|
|
|
m_CourseContentsFrame.Command( "BounceBegin,0.3;ZoomY,0" );
|
2003-11-17 06:14:52 +00:00
|
|
|
OFF_COMMAND( m_CourseContentsFrame );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
COMMAND( m_CourseContentsFrame, "Hide" );
|
|
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::SkipSongPartTweens()
|
|
|
|
|
{
|
|
|
|
|
m_GrooveRadar.FinishTweening();
|
|
|
|
|
m_GrooveGraph.FinishTweening();
|
2003-11-17 04:29:14 +00:00
|
|
|
if( SHOW_DIFFICULTY_LIST )
|
|
|
|
|
m_DifficultyList.FinishTweening();
|
2003-07-20 05:13:45 +00:00
|
|
|
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsHumanPlayer(p) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
|
|
|
|
m_sprDifficultyFrame[p].FinishTweening();
|
|
|
|
|
m_sprMeterFrame[p].FinishTweening();
|
|
|
|
|
m_DifficultyIcon[p].FinishTweening();
|
|
|
|
|
m_AutoGenIcon[p].FinishTweening();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::SkipCoursePartTweens()
|
|
|
|
|
{
|
|
|
|
|
m_CourseContentsFrame.FinishTweening();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::TweenOnScreen()
|
|
|
|
|
{
|
2003-11-16 21:51:02 +00:00
|
|
|
TweenSongPartsOnScreen( true );
|
|
|
|
|
TweenCoursePartsOnScreen( true );
|
|
|
|
|
|
2004-03-12 08:31:40 +00:00
|
|
|
switch( GAMESTATE->m_SortOrder )
|
2003-07-20 05:13:45 +00:00
|
|
|
{
|
2003-07-20 08:54:31 +00:00
|
|
|
case SORT_ALL_COURSES:
|
|
|
|
|
case SORT_NONSTOP_COURSES:
|
|
|
|
|
case SORT_ONI_COURSES:
|
|
|
|
|
case SORT_ENDLESS_COURSES:
|
2003-11-16 21:51:02 +00:00
|
|
|
TweenSongPartsOffScreen( false );
|
2003-07-20 05:13:45 +00:00
|
|
|
SkipSongPartTweens();
|
2003-07-20 08:54:31 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
2003-11-16 21:51:02 +00:00
|
|
|
TweenCoursePartsOffScreen( false );
|
2003-07-20 05:13:45 +00:00
|
|
|
SkipCoursePartTweens();
|
2003-07-20 08:54:31 +00:00
|
|
|
break;
|
2003-07-20 05:13:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ON_COMMAND( m_sprBannerMask );
|
|
|
|
|
ON_COMMAND( m_Banner );
|
|
|
|
|
ON_COMMAND( m_sprBannerFrame );
|
|
|
|
|
ON_COMMAND( m_BPMDisplay );
|
|
|
|
|
ON_COMMAND( m_DifficultyDisplay );
|
|
|
|
|
ON_COMMAND( m_sprStage );
|
|
|
|
|
ON_COMMAND( m_sprCDTitleFront );
|
|
|
|
|
ON_COMMAND( m_sprCDTitleBack );
|
|
|
|
|
ON_COMMAND( m_GrooveRadar );
|
|
|
|
|
ON_COMMAND( m_GrooveGraph );
|
|
|
|
|
ON_COMMAND( m_textSongOptions );
|
|
|
|
|
ON_COMMAND( m_MusicSortDisplay );
|
2003-11-18 21:55:29 +00:00
|
|
|
ON_COMMAND( m_MusicWheelUnder );
|
2003-03-24 21:37:13 +00:00
|
|
|
m_MusicWheel.TweenOnScreen();
|
2003-07-20 05:13:45 +00:00
|
|
|
ON_COMMAND( m_MusicWheel );
|
2003-11-17 02:52:03 +00:00
|
|
|
ON_COMMAND( m_Artist );
|
2003-11-17 04:12:11 +00:00
|
|
|
ON_COMMAND( m_MachineRank );
|
|
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-04-13 21:17:14 +00:00
|
|
|
if( !GAMESTATE->IsHumanPlayer(p) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
2003-11-21 04:35:06 +00:00
|
|
|
ON_COMMAND( m_sprCharacterIcon[p] );
|
2003-07-20 05:13:45 +00:00
|
|
|
ON_COMMAND( m_OptionIconRow[p] );
|
|
|
|
|
ON_COMMAND( m_sprHighScoreFrame[p] );
|
|
|
|
|
ON_COMMAND( m_textHighScore[p] );
|
2003-11-17 06:13:12 +00:00
|
|
|
if( SHOW_PANES )
|
|
|
|
|
ON_COMMAND( m_PaneDisplay[p] );
|
2003-11-18 16:47:47 +00:00
|
|
|
ON_COMMAND( m_DifficultyMeter[p] );
|
2002-08-13 23:26:46 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
|
|
|
|
m_textSongOptions.Command( SONG_OPTIONS_EXTRA_COMMAND );
|
|
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
void ScreenSelectMusic::TweenOffScreen()
|
|
|
|
|
{
|
2004-03-12 08:31:40 +00:00
|
|
|
switch( GAMESTATE->m_SortOrder )
|
2003-07-20 08:54:31 +00:00
|
|
|
{
|
|
|
|
|
case SORT_ALL_COURSES:
|
|
|
|
|
case SORT_NONSTOP_COURSES:
|
|
|
|
|
case SORT_ONI_COURSES:
|
|
|
|
|
case SORT_ENDLESS_COURSES:
|
2003-11-16 21:51:02 +00:00
|
|
|
TweenCoursePartsOffScreen( true );
|
2003-07-20 08:54:31 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
2003-11-16 21:51:02 +00:00
|
|
|
TweenSongPartsOffScreen( true );
|
2003-07-20 08:54:31 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
|
2003-05-15 06:09:19 +00:00
|
|
|
OFF_COMMAND( m_sprBannerMask );
|
2003-04-13 21:17:14 +00:00
|
|
|
OFF_COMMAND( m_Banner );
|
2003-05-15 06:09:19 +00:00
|
|
|
OFF_COMMAND( m_sprBannerFrame );
|
2003-04-13 21:17:14 +00:00
|
|
|
OFF_COMMAND( m_BPMDisplay );
|
2003-06-18 07:10:03 +00:00
|
|
|
OFF_COMMAND( m_DifficultyDisplay );
|
2003-04-13 21:17:14 +00:00
|
|
|
OFF_COMMAND( m_sprStage );
|
2003-05-20 05:31:38 +00:00
|
|
|
OFF_COMMAND( m_sprCDTitleFront );
|
|
|
|
|
OFF_COMMAND( m_sprCDTitleBack );
|
2003-04-13 21:17:14 +00:00
|
|
|
OFF_COMMAND( m_GrooveRadar );
|
2003-04-22 08:43:12 +00:00
|
|
|
OFF_COMMAND( m_GrooveGraph );
|
2003-04-13 21:17:14 +00:00
|
|
|
OFF_COMMAND( m_textSongOptions );
|
|
|
|
|
OFF_COMMAND( m_MusicSortDisplay );
|
2002-05-20 08:59:37 +00:00
|
|
|
m_MusicWheel.TweenOffScreen();
|
2003-11-18 21:55:29 +00:00
|
|
|
OFF_COMMAND( m_MusicWheelUnder );
|
2003-04-13 21:17:14 +00:00
|
|
|
OFF_COMMAND( m_MusicWheel );
|
2003-04-21 23:43:51 +00:00
|
|
|
OFF_COMMAND( m_sprBalloon );
|
2003-11-17 02:52:03 +00:00
|
|
|
OFF_COMMAND( m_Artist );
|
2003-11-17 04:12:11 +00:00
|
|
|
OFF_COMMAND( m_MachineRank );
|
|
|
|
|
|
2003-03-24 21:37:13 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-04-13 21:17:14 +00:00
|
|
|
if( !GAMESTATE->IsHumanPlayer(p) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
|
2003-11-21 04:35:06 +00:00
|
|
|
OFF_COMMAND(m_sprCharacterIcon[p]);
|
2003-04-13 21:17:14 +00:00
|
|
|
OFF_COMMAND( m_OptionIconRow[p] );
|
|
|
|
|
OFF_COMMAND( m_sprHighScoreFrame[p] );
|
|
|
|
|
OFF_COMMAND( m_textHighScore[p] );
|
2003-11-17 06:13:12 +00:00
|
|
|
if( SHOW_PANES )
|
|
|
|
|
OFF_COMMAND( m_PaneDisplay[p] );
|
2003-11-18 16:47:47 +00:00
|
|
|
OFF_COMMAND( m_DifficultyMeter[p] );
|
2003-03-24 21:37:13 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2003-07-20 05:13:45 +00:00
|
|
|
|
|
|
|
|
/* This hides elements that are only relevant when displaying a single song,
|
|
|
|
|
* and shows elements for course display. XXX: Allow different tween commands. */
|
|
|
|
|
void ScreenSelectMusic::EnterCourseDisplayMode()
|
|
|
|
|
{
|
|
|
|
|
if( m_bInCourseDisplayMode )
|
|
|
|
|
return;
|
|
|
|
|
m_bInCourseDisplayMode = true;
|
|
|
|
|
|
2003-11-16 21:51:02 +00:00
|
|
|
TweenSongPartsOffScreen( false );
|
2003-07-20 05:13:45 +00:00
|
|
|
TweenCoursePartsOnScreen( false );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::ExitCourseDisplayMode()
|
|
|
|
|
{
|
|
|
|
|
if( !m_bInCourseDisplayMode )
|
|
|
|
|
return;
|
|
|
|
|
m_bInCourseDisplayMode = false;
|
|
|
|
|
|
|
|
|
|
TweenSongPartsOnScreen( false );
|
2003-11-16 21:51:02 +00:00
|
|
|
TweenCoursePartsOffScreen( false );
|
2003-07-20 05:13:45 +00:00
|
|
|
}
|
|
|
|
|
|
2002-08-28 22:42:40 +00:00
|
|
|
void ScreenSelectMusic::TweenScoreOnAndOffAfterChangeSort()
|
|
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-07-20 21:44:04 +00:00
|
|
|
if( !GAMESTATE->IsHumanPlayer(p) )
|
|
|
|
|
continue; // skip
|
|
|
|
|
m_textHighScore[p].Command( SCORE_SORT_CHANGE_COMMAND(p) );
|
|
|
|
|
m_sprHighScoreFrame[p].Command( SCORE_FRAME_SORT_CHANGE_COMMAND(p) );
|
2002-08-28 22:42:40 +00:00
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
|
2004-03-12 08:31:40 +00:00
|
|
|
switch( GAMESTATE->m_SortOrder )
|
2003-07-20 08:54:31 +00:00
|
|
|
{
|
|
|
|
|
case SORT_ALL_COURSES:
|
|
|
|
|
case SORT_NONSTOP_COURSES:
|
|
|
|
|
case SORT_ONI_COURSES:
|
|
|
|
|
case SORT_ENDLESS_COURSES:
|
2003-07-20 05:13:45 +00:00
|
|
|
EnterCourseDisplayMode();
|
2003-07-20 08:54:31 +00:00
|
|
|
break;
|
2004-01-11 08:15:44 +00:00
|
|
|
case SORT_SORT_MENU:
|
|
|
|
|
case SORT_MODE_MENU:
|
|
|
|
|
// do nothing
|
|
|
|
|
break;
|
2003-07-20 08:54:31 +00:00
|
|
|
default:
|
2004-01-11 08:15:44 +00:00
|
|
|
ExitCourseDisplayMode();
|
2003-07-20 08:54:31 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2002-08-28 22:42:40 +00:00
|
|
|
}
|
|
|
|
|
|
2002-08-13 23:26:46 +00:00
|
|
|
void ScreenSelectMusic::Update( float fDeltaTime )
|
|
|
|
|
{
|
|
|
|
|
Screen::Update( fDeltaTime );
|
2004-02-19 03:56:50 +00:00
|
|
|
m_bgOptionsOut.Update( fDeltaTime );
|
|
|
|
|
m_bgNoOptionsOut.Update( fDeltaTime );
|
2003-03-10 02:29:01 +00:00
|
|
|
m_sprOptionsMessage.Update( fDeltaTime );
|
|
|
|
|
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2002-10-06 16:56:58 +00:00
|
|
|
if( m_fPlaySampleCountdown > 0 )
|
|
|
|
|
{
|
|
|
|
|
m_fPlaySampleCountdown -= fDeltaTime;
|
2003-01-02 03:00:53 +00:00
|
|
|
/* Make sure we don't start the sample when rouletting is
|
|
|
|
|
* spinning down. */
|
|
|
|
|
if( m_fPlaySampleCountdown <= 0 && !m_MusicWheel.IsRouletting() )
|
2003-03-25 22:23:58 +00:00
|
|
|
{
|
|
|
|
|
if( !m_sSampleMusicToPlay.empty() )
|
|
|
|
|
{
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayMusic(
|
2003-03-25 22:23:58 +00:00
|
|
|
m_sSampleMusicToPlay,
|
2003-12-18 08:53:38 +00:00
|
|
|
m_sSampleMusicTimingData,
|
2003-03-25 22:23:58 +00:00
|
|
|
true,
|
|
|
|
|
m_fSampleStartSeconds,
|
|
|
|
|
m_fSampleLengthSeconds,
|
|
|
|
|
1.5f); /* fade out for 1.5 seconds */
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-10-06 16:56:58 +00:00
|
|
|
}
|
2002-08-13 23:26:46 +00:00
|
|
|
}
|
|
|
|
|
|
2003-01-02 03:00:53 +00:00
|
|
|
void ScreenSelectMusic::Input( const DeviceInput& DeviceI, InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2003-02-25 00:33:42 +00:00
|
|
|
// LOG->Trace( "ScreenSelectMusic::Input()" );
|
2004-01-11 09:42:37 +00:00
|
|
|
|
2004-01-18 04:45:59 +00:00
|
|
|
// debugging?
|
2003-02-11 23:52:18 +00:00
|
|
|
if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == SDLK_F9 )
|
|
|
|
|
{
|
|
|
|
|
if( type != IET_FIRST_PRESS ) return;
|
2003-05-20 04:41:47 +00:00
|
|
|
PREFSMAN->m_bShowNative ^= 1;
|
2003-03-31 23:06:15 +00:00
|
|
|
m_MusicWheel.RebuildMusicWheelItems();
|
2003-07-20 05:13:45 +00:00
|
|
|
Course* pCourse = m_MusicWheel.GetSelectedCourse();
|
|
|
|
|
if(pCourse)
|
|
|
|
|
m_CourseContentsFrame.SetFromCourse( pCourse );
|
2003-02-11 23:52:18 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2004-01-18 04:45:59 +00:00
|
|
|
if( !GameI.IsValid() ) return; // don't care
|
|
|
|
|
|
2004-01-21 06:14:49 +00:00
|
|
|
|
|
|
|
|
/* XXX: What's the difference between this and StyleI.player? */
|
2004-02-12 09:44:16 +00:00
|
|
|
/* StyleI won't be valid if it's a menu button that's pressed.
|
|
|
|
|
* There's got to be a better way of doing this. -Chris */
|
2004-01-21 06:14:49 +00:00
|
|
|
PlayerNumber pn = GAMESTATE->GetCurrentStyleDef()->ControllerToPlayerNumber( GameI.controller );
|
|
|
|
|
if( !GAMESTATE->IsHumanPlayer(pn) )
|
|
|
|
|
return;
|
|
|
|
|
|
2004-01-18 20:15:02 +00:00
|
|
|
if( m_bMadeChoice &&
|
|
|
|
|
MenuI.IsValid() &&
|
|
|
|
|
MenuI.button == MENU_BUTTON_START &&
|
|
|
|
|
type != IET_RELEASE &&
|
2004-02-19 03:56:50 +00:00
|
|
|
m_Menu.IsTransitioning() &&
|
2004-01-18 20:15:02 +00:00
|
|
|
!GAMESTATE->IsExtraStage() &&
|
|
|
|
|
!GAMESTATE->IsExtraStage2() )
|
2004-01-18 04:45:59 +00:00
|
|
|
{
|
|
|
|
|
if(m_bGoToOptions) return; /* got it already */
|
|
|
|
|
if(!m_bAllowOptionsMenu) return; /* not allowed */
|
|
|
|
|
|
|
|
|
|
if( !m_bAllowOptionsMenuRepeat &&
|
|
|
|
|
(type == IET_SLOW_REPEAT || type == IET_FAST_REPEAT ))
|
|
|
|
|
return; /* not allowed yet */
|
|
|
|
|
|
|
|
|
|
m_bGoToOptions = true;
|
|
|
|
|
m_sprOptionsMessage.SetState( 1 );
|
|
|
|
|
SOUND->PlayOnce( THEME->GetPathToS("Common start") );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( m_Menu.IsTransitioning() )
|
|
|
|
|
return; // ignore
|
|
|
|
|
|
|
|
|
|
if( m_bMadeChoice ) return; // ignore
|
2004-01-11 09:42:37 +00:00
|
|
|
|
2003-01-02 03:00:53 +00:00
|
|
|
if( MenuI.button == MENU_BUTTON_RIGHT || MenuI.button == MENU_BUTTON_LEFT )
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/* If we're rouletting, hands off. */
|
|
|
|
|
if(m_MusicWheel.IsRouletting())
|
|
|
|
|
return;
|
|
|
|
|
|
2004-01-11 09:42:37 +00:00
|
|
|
// TRICKY: There's lots of weirdness that can happen here when tapping
|
|
|
|
|
// Left and Right quickly, like when changing sort.
|
|
|
|
|
bool bLeftPressed = INPUTMAPPER->IsButtonDown( MenuInput(MenuI.player, MENU_BUTTON_LEFT) );
|
|
|
|
|
bool bRightPressed = INPUTMAPPER->IsButtonDown( MenuInput(MenuI.player, MENU_BUTTON_RIGHT) );
|
|
|
|
|
bool bLeftAndRightPressed = bLeftPressed && bRightPressed;
|
|
|
|
|
bool bLeftOrRightPressed = bLeftPressed || bRightPressed;
|
|
|
|
|
|
|
|
|
|
switch( type )
|
|
|
|
|
{
|
|
|
|
|
case IET_RELEASE:
|
|
|
|
|
// when a key is released, stop moving the wheel
|
|
|
|
|
if( !bLeftOrRightPressed )
|
|
|
|
|
m_MusicWheel.Move( 0 );
|
|
|
|
|
|
|
|
|
|
// Reset the repeat timer when a key is released.
|
|
|
|
|
// This fixes jumping when you release Left and Right at the same
|
|
|
|
|
// time (e.g. after tapping Left+Right to change sort).
|
|
|
|
|
INPUTMAPPER->ResetKeyRepeat( MenuInput(MenuI.player, MENU_BUTTON_LEFT) );
|
|
|
|
|
INPUTMAPPER->ResetKeyRepeat( MenuInput(MenuI.player, MENU_BUTTON_RIGHT) );
|
|
|
|
|
break;
|
|
|
|
|
case IET_FIRST_PRESS:
|
|
|
|
|
if( MenuI.button == MENU_BUTTON_RIGHT )
|
|
|
|
|
m_MusicWheel.Move( +1 );
|
|
|
|
|
else
|
|
|
|
|
m_MusicWheel.Move( -1 );
|
|
|
|
|
|
|
|
|
|
// The wheel moves faster than one item between FIRST_PRESS
|
|
|
|
|
// and SLOW_REPEAT. Stop the wheel immediately after moving one
|
|
|
|
|
// item if both Left and Right are held. This way, we won't move
|
|
|
|
|
// another item
|
|
|
|
|
if( bLeftAndRightPressed )
|
|
|
|
|
m_MusicWheel.Move( 0 );
|
|
|
|
|
break;
|
|
|
|
|
case IET_SLOW_REPEAT:
|
|
|
|
|
case IET_FAST_REPEAT:
|
|
|
|
|
// We need to handle the repeat events to start the wheel spinning again
|
|
|
|
|
// when Left and Right are being held, then one is released.
|
|
|
|
|
if( bLeftAndRightPressed )
|
|
|
|
|
{
|
|
|
|
|
// Don't spin if holding both buttons
|
|
|
|
|
m_MusicWheel.Move( 0 );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if( MenuI.button == MENU_BUTTON_RIGHT )
|
|
|
|
|
m_MusicWheel.Move( +1 );
|
|
|
|
|
else
|
|
|
|
|
m_MusicWheel.Move( -1 );
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2003-01-02 03:00:53 +00:00
|
|
|
}
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2004-01-11 09:42:37 +00:00
|
|
|
|
2004-01-11 20:40:49 +00:00
|
|
|
// TRICKY: Do default processing of MenuLeft and MenuRight before detecting
|
|
|
|
|
// codes. Do default processing of Start AFTER detecting codes. This gives us a
|
|
|
|
|
// change to return if Start is part of a code because we don't want to process
|
|
|
|
|
// Start as "move to the next screen" if it was just part of a code.
|
|
|
|
|
switch( MenuI.button )
|
|
|
|
|
{
|
|
|
|
|
case MENU_BUTTON_UP: this->MenuUp( MenuI.player, type ); break;
|
|
|
|
|
case MENU_BUTTON_DOWN: this->MenuDown( MenuI.player, type ); break;
|
|
|
|
|
case MENU_BUTTON_LEFT: this->MenuLeft( MenuI.player, type ); break;
|
|
|
|
|
case MENU_BUTTON_RIGHT: this->MenuRight( MenuI.player, type ); break;
|
2004-02-15 01:52:28 +00:00
|
|
|
case MENU_BUTTON_BACK:
|
|
|
|
|
/* Don't make the user hold the back button if they're pressing escape and escape is the back button. */
|
|
|
|
|
if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == SDLK_ESCAPE )
|
|
|
|
|
this->MenuBack( MenuI.player );
|
|
|
|
|
else
|
|
|
|
|
Screen::MenuBack( MenuI.player, type );
|
|
|
|
|
break;
|
2004-01-11 20:40:49 +00:00
|
|
|
// Do the default handler for Start after detecting codes.
|
|
|
|
|
// case MENU_BUTTON_START: this->MenuStart( MenuI.player, type ); break;
|
|
|
|
|
case MENU_BUTTON_COIN: this->MenuCoin( MenuI.player, type ); break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-12-02 09:04:00 +00:00
|
|
|
if( type == IET_FIRST_PRESS )
|
2002-08-20 21:00:56 +00:00
|
|
|
{
|
2003-12-02 09:04:00 +00:00
|
|
|
if( CodeDetector::EnteredEasierDifficulty(GameI.controller) )
|
|
|
|
|
{
|
|
|
|
|
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
|
|
|
|
m_soundLocked.Play();
|
|
|
|
|
else
|
|
|
|
|
EasierDifficulty( pn );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if( CodeDetector::EnteredHarderDifficulty(GameI.controller) )
|
|
|
|
|
{
|
|
|
|
|
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
|
|
|
|
m_soundLocked.Play();
|
|
|
|
|
else
|
|
|
|
|
HarderDifficulty( pn );
|
|
|
|
|
return;
|
|
|
|
|
}
|
2004-01-11 08:15:44 +00:00
|
|
|
if( CodeDetector::EnteredSortMenu(GameI.controller) )
|
|
|
|
|
{
|
2004-01-23 04:56:39 +00:00
|
|
|
/* Ignore the SortMenu when in course mode. However, still check for the code, so
|
|
|
|
|
* if people try pressing left+right+start in course mode, we don't pick the selected
|
|
|
|
|
* course on them. */
|
|
|
|
|
if( GAMESTATE->IsCourseMode() )
|
|
|
|
|
; /* nothing */
|
|
|
|
|
else if( ( GAMESTATE->IsExtraStage() && !PREFSMAN->m_bPickExtraStage ) || GAMESTATE->IsExtraStage2() )
|
2004-01-11 08:15:44 +00:00
|
|
|
m_soundLocked.Play();
|
|
|
|
|
else
|
|
|
|
|
m_MusicWheel.ChangeSort( SORT_SORT_MENU );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if( CodeDetector::EnteredModeMenu(GameI.controller) )
|
2003-12-02 09:04:00 +00:00
|
|
|
{
|
|
|
|
|
if( ( GAMESTATE->IsExtraStage() && !PREFSMAN->m_bPickExtraStage ) || GAMESTATE->IsExtraStage2() )
|
|
|
|
|
m_soundLocked.Play();
|
|
|
|
|
else
|
2004-01-11 08:15:44 +00:00
|
|
|
m_MusicWheel.ChangeSort( SORT_MODE_MENU );
|
2003-12-02 09:04:00 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if( CodeDetector::EnteredNextSort(GameI.controller) )
|
|
|
|
|
{
|
|
|
|
|
if( ( GAMESTATE->IsExtraStage() && !PREFSMAN->m_bPickExtraStage ) || GAMESTATE->IsExtraStage2() )
|
|
|
|
|
m_soundLocked.Play();
|
|
|
|
|
else
|
|
|
|
|
m_MusicWheel.NextSort();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if( !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() && CodeDetector::DetectAndAdjustMusicOptions(GameI.controller) )
|
|
|
|
|
{
|
|
|
|
|
m_soundOptionsChange.Play();
|
|
|
|
|
UpdateOptionsDisplays();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2002-09-02 21:59:58 +00:00
|
|
|
}
|
2004-01-11 20:40:49 +00:00
|
|
|
|
|
|
|
|
switch( MenuI.button )
|
|
|
|
|
{
|
|
|
|
|
case MENU_BUTTON_START: Screen::MenuStart( MenuI.player, type ); break;
|
|
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenSelectMusic::EasierDifficulty( PlayerNumber pn )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2002-09-04 03:49:08 +00:00
|
|
|
LOG->Trace( "ScreenSelectMusic::EasierDifficulty( %d )", pn );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-07 21:24:14 +00:00
|
|
|
if( !GAMESTATE->IsHumanPlayer(pn) )
|
2002-05-20 08:59:37 +00:00
|
|
|
return;
|
2003-07-21 22:57:19 +00:00
|
|
|
|
2004-01-14 06:11:28 +00:00
|
|
|
if( m_MusicWheel.GetSelectedType() == TYPE_COURSE )
|
2003-07-21 22:57:19 +00:00
|
|
|
{
|
2004-01-21 01:35:54 +00:00
|
|
|
if( GAMESTATE->ChangeCourseDifficulty( pn, -1 ) )
|
2004-01-14 06:11:28 +00:00
|
|
|
{
|
|
|
|
|
m_soundDifficultyEasier.Play();
|
|
|
|
|
AfterMusicChange();
|
|
|
|
|
}
|
2003-07-21 22:57:19 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( m_MusicWheel.GetSelectedType() != TYPE_SONG )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if( m_MusicWheel.GetSelectedType() != TYPE_SONG )
|
2002-05-20 08:59:37 +00:00
|
|
|
return;
|
2002-09-04 03:49:08 +00:00
|
|
|
if( m_iSelection[pn] == 0 )
|
2002-05-20 08:59:37 +00:00
|
|
|
return;
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
m_iSelection[pn]--;
|
2002-08-04 08:03:41 +00:00
|
|
|
// the user explicity switched difficulties. Update the preferred difficulty
|
2003-07-21 22:45:18 +00:00
|
|
|
GAMESTATE->m_PreferredDifficulty[pn] = m_arrayNotes[ m_iSelection[pn] ]->GetDifficulty();
|
2002-08-04 08:03:41 +00:00
|
|
|
|
2004-01-10 21:35:39 +00:00
|
|
|
m_soundDifficultyEasier.Play();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
AfterNotesChange( pn );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenSelectMusic::HarderDifficulty( PlayerNumber pn )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2002-09-04 03:49:08 +00:00
|
|
|
LOG->Trace( "ScreenSelectMusic::HarderDifficulty( %d )", pn );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-07 21:24:14 +00:00
|
|
|
if( !GAMESTATE->IsHumanPlayer(pn) )
|
2002-05-20 08:59:37 +00:00
|
|
|
return;
|
2003-07-21 22:57:19 +00:00
|
|
|
|
2004-01-14 06:11:28 +00:00
|
|
|
if( m_MusicWheel.GetSelectedType() == TYPE_COURSE )
|
2003-07-21 22:57:19 +00:00
|
|
|
{
|
2004-01-21 01:35:54 +00:00
|
|
|
if( GAMESTATE->ChangeCourseDifficulty( pn, +1 ) )
|
2004-01-14 06:11:28 +00:00
|
|
|
{
|
|
|
|
|
m_soundDifficultyHarder.Play();
|
|
|
|
|
AfterMusicChange();
|
|
|
|
|
}
|
2003-07-21 22:57:19 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( m_MusicWheel.GetSelectedType() != TYPE_SONG )
|
2002-05-20 08:59:37 +00:00
|
|
|
return;
|
2003-07-21 22:57:19 +00:00
|
|
|
|
2003-07-21 22:45:18 +00:00
|
|
|
if( m_iSelection[pn] == int(m_arrayNotes.size()-1) )
|
2002-05-20 08:59:37 +00:00
|
|
|
return;
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
m_iSelection[pn]++;
|
2002-08-04 08:03:41 +00:00
|
|
|
// the user explicity switched difficulties. Update the preferred difficulty
|
2003-07-21 22:45:18 +00:00
|
|
|
GAMESTATE->m_PreferredDifficulty[pn] = m_arrayNotes[ m_iSelection[pn] ]->GetDifficulty();
|
2002-08-04 08:03:41 +00:00
|
|
|
|
2004-01-10 21:35:39 +00:00
|
|
|
m_soundDifficultyHarder.Play();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
AfterNotesChange( pn );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
Screen::HandleScreenMessage( SM );
|
|
|
|
|
|
|
|
|
|
switch( SM )
|
|
|
|
|
{
|
2003-02-10 22:10:12 +00:00
|
|
|
case SM_AllowOptionsMenuRepeat:
|
|
|
|
|
m_bAllowOptionsMenuRepeat = true;
|
|
|
|
|
break;
|
2002-05-27 08:23:27 +00:00
|
|
|
case SM_MenuTimer:
|
2002-08-20 21:00:56 +00:00
|
|
|
if( m_MusicWheel.IsRouletting() )
|
|
|
|
|
{
|
|
|
|
|
MenuStart(PLAYER_INVALID);
|
2003-11-07 20:10:38 +00:00
|
|
|
m_Menu.m_MenuTimer->SetSeconds( 15 );
|
2003-12-03 02:45:33 +00:00
|
|
|
m_Menu.m_MenuTimer->Start();
|
2002-08-20 21:00:56 +00:00
|
|
|
}
|
2004-01-11 07:18:51 +00:00
|
|
|
else if( DO_ROULETTE_ON_MENU_TIMER )
|
2002-08-20 21:00:56 +00:00
|
|
|
{
|
2004-01-11 07:18:51 +00:00
|
|
|
if( m_MusicWheel.GetSelectedType() != TYPE_SONG )
|
|
|
|
|
{
|
|
|
|
|
m_MusicWheel.StartRoulette();
|
|
|
|
|
m_Menu.m_MenuTimer->SetSeconds( 15 );
|
|
|
|
|
m_Menu.m_MenuTimer->Start();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MenuStart(PLAYER_INVALID);
|
|
|
|
|
}
|
2002-08-20 21:00:56 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-01-11 07:18:51 +00:00
|
|
|
if( m_MusicWheel.GetSelectedType() != TYPE_SONG )
|
|
|
|
|
m_MusicWheel.StartRandom();
|
2002-08-20 21:00:56 +00:00
|
|
|
MenuStart(PLAYER_INVALID);
|
|
|
|
|
}
|
2002-05-27 08:23:27 +00:00
|
|
|
break;
|
2002-08-27 23:31:41 +00:00
|
|
|
case SM_GoToPrevScreen:
|
2003-07-03 06:38:57 +00:00
|
|
|
SCREENMAN->SetNewScreen( PREV_SCREEN(GAMESTATE->m_PlayMode) );
|
2003-02-02 21:49:47 +00:00
|
|
|
/* We may have stray SM_SongChanged messages from the music wheel. We can't
|
|
|
|
|
* handle them anymore, since the title menu (and attract screens) reset
|
|
|
|
|
* the game state, so just discard them. */
|
|
|
|
|
ClearMessageQueue();
|
2002-05-20 08:59:37 +00:00
|
|
|
break;
|
2004-02-19 03:56:50 +00:00
|
|
|
case SM_BeginFadingOut:
|
|
|
|
|
/* XXX: yuck. Later on, maybe this can be done in one BGA with lua ... */
|
|
|
|
|
if( m_bGoToOptions )
|
|
|
|
|
m_bgOptionsOut.StartTransitioning( SM_GoToNextScreen );
|
|
|
|
|
else
|
|
|
|
|
m_bgNoOptionsOut.StartTransitioning( SM_GoToNextScreen );
|
|
|
|
|
break;
|
2002-08-27 23:31:41 +00:00
|
|
|
case SM_GoToNextScreen:
|
2002-08-04 08:03:41 +00:00
|
|
|
if( m_bGoToOptions )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2003-07-03 06:38:57 +00:00
|
|
|
SCREENMAN->SetNewScreen( NEXT_OPTIONS_SCREEN(GAMESTATE->m_PlayMode) );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2003-07-24 03:54:34 +00:00
|
|
|
GAMESTATE->AdjustFailType();
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->StopMusic();
|
2003-07-03 06:38:57 +00:00
|
|
|
SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
break;
|
2002-06-30 23:19:33 +00:00
|
|
|
case SM_SongChanged:
|
|
|
|
|
AfterMusicChange();
|
|
|
|
|
break;
|
2004-02-18 23:58:33 +00:00
|
|
|
case SM_SortOrderChanging: /* happens immediately */
|
2003-07-20 08:54:31 +00:00
|
|
|
// m_MusicSortDisplay.FadeOff( 0, "fade", TWEEN_TIME );
|
|
|
|
|
TweenScoreOnAndOffAfterChangeSort();
|
|
|
|
|
break;
|
2004-02-18 23:58:33 +00:00
|
|
|
case SM_SortOrderChanged: /* happens after the wheel is off and the new song is selected */
|
|
|
|
|
SortOrderChanged();
|
|
|
|
|
break;
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenSelectMusic::MenuStart( PlayerNumber pn )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2003-08-03 00:13:55 +00:00
|
|
|
// this needs to check whether valid Steps are selected!
|
2002-06-24 22:04:31 +00:00
|
|
|
bool bResult = m_MusicWheel.Select();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-01-02 23:20:18 +00:00
|
|
|
/* If false, we don't have a selection just yet. */
|
2002-08-20 21:00:56 +00:00
|
|
|
if( !bResult )
|
2002-09-07 09:37:27 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// a song was selected
|
|
|
|
|
switch( m_MusicWheel.GetSelectedType() )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2002-09-07 09:37:27 +00:00
|
|
|
case TYPE_SONG: {
|
2004-02-09 06:26:13 +00:00
|
|
|
const bool bIsNew = PROFILEMAN->IsSongNew( m_MusicWheel.GetSelectedSong() );
|
2002-09-07 09:37:27 +00:00
|
|
|
bool bIsHard = false;
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
2003-04-07 21:24:14 +00:00
|
|
|
if( !GAMESTATE->IsHumanPlayer( (PlayerNumber)p ) )
|
2002-09-07 09:37:27 +00:00
|
|
|
continue; // skip
|
2003-01-02 22:10:51 +00:00
|
|
|
if( GAMESTATE->m_pCurNotes[p] && GAMESTATE->m_pCurNotes[p]->GetMeter() >= 10 )
|
2002-09-07 09:37:27 +00:00
|
|
|
bIsHard = true;
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
2002-06-24 22:04:31 +00:00
|
|
|
|
2003-09-06 01:57:24 +00:00
|
|
|
/* See if this song is a repeat. If we're in event mode, only check the last five songs. */
|
|
|
|
|
bool bIsRepeat = false;
|
|
|
|
|
int i = 0;
|
|
|
|
|
if( PREFSMAN->m_bEventMode )
|
2003-12-23 00:26:00 +00:00
|
|
|
i = max( 0, int(g_vPlayedStageStats.size())-5 );
|
|
|
|
|
for( ; i < (int)g_vPlayedStageStats.size(); ++i )
|
|
|
|
|
if( g_vPlayedStageStats[i].pSong == m_MusicWheel.GetSelectedSong() )
|
2003-09-06 01:57:24 +00:00
|
|
|
bIsRepeat = true;
|
|
|
|
|
|
|
|
|
|
/* Don't complain about repeats if the user didn't get to pick. */
|
|
|
|
|
if( GAMESTATE->IsExtraStage() && !PREFSMAN->m_bPickExtraStage )
|
|
|
|
|
bIsRepeat = false;
|
|
|
|
|
|
|
|
|
|
if( bIsRepeat )
|
|
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("select music comment repeat") );
|
|
|
|
|
else if( bIsNew )
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("select music comment new") );
|
2002-09-07 09:37:27 +00:00
|
|
|
else if( bIsHard )
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("select music comment hard") );
|
2002-09-07 09:37:27 +00:00
|
|
|
else
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("select music comment general") );
|
2002-09-07 09:37:27 +00:00
|
|
|
|
2003-07-20 05:13:45 +00:00
|
|
|
m_bMadeChoice = true;
|
2002-09-07 09:37:27 +00:00
|
|
|
|
2003-07-20 05:13:45 +00:00
|
|
|
/* If we're in event mode, we may have just played a course (putting us
|
|
|
|
|
* in course mode). Make sure we're in a single song mode. */
|
|
|
|
|
if( GAMESTATE->IsCourseMode() )
|
|
|
|
|
GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case TYPE_COURSE:
|
|
|
|
|
{
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("select course comment general") );
|
2003-07-20 05:13:45 +00:00
|
|
|
|
|
|
|
|
Course *pCourse = m_MusicWheel.GetSelectedCourse();
|
|
|
|
|
ASSERT( pCourse );
|
|
|
|
|
GAMESTATE->m_PlayMode = pCourse->GetPlayMode();
|
|
|
|
|
|
|
|
|
|
// apply #LIVES
|
|
|
|
|
if( pCourse->m_iLives != -1 )
|
|
|
|
|
{
|
|
|
|
|
GAMESTATE->m_SongOptions.m_LifeType = SongOptions::LIFE_BATTERY;
|
|
|
|
|
GAMESTATE->m_SongOptions.m_iBatteryLives = pCourse->m_iLives;
|
|
|
|
|
}
|
2002-09-07 09:37:27 +00:00
|
|
|
|
|
|
|
|
m_bMadeChoice = true;
|
|
|
|
|
|
2003-07-20 05:13:45 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case TYPE_SECTION:
|
|
|
|
|
case TYPE_ROULETTE:
|
|
|
|
|
case TYPE_SORT:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( m_bMadeChoice )
|
|
|
|
|
{
|
|
|
|
|
TweenOffScreen();
|
2002-09-07 09:37:27 +00:00
|
|
|
m_soundSelect.Play();
|
|
|
|
|
|
|
|
|
|
if( !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() )
|
|
|
|
|
{
|
2003-03-25 01:39:01 +00:00
|
|
|
// float fShowSeconds = m_Menu.m_Out.GetLengthSeconds();
|
2003-03-10 02:29:01 +00:00
|
|
|
|
2002-09-07 09:37:27 +00:00
|
|
|
// show "hold START for options"
|
2003-03-24 21:37:13 +00:00
|
|
|
m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,1) ); // visible
|
2003-04-13 21:17:14 +00:00
|
|
|
SET_XY_AND_ON_COMMAND( m_sprOptionsMessage );
|
2003-07-20 05:13:45 +00:00
|
|
|
|
2003-02-10 22:10:12 +00:00
|
|
|
m_bAllowOptionsMenu = true;
|
|
|
|
|
/* Don't accept a held START for a little while, so it's not
|
|
|
|
|
* hit accidentally. Accept an initial START right away, though,
|
|
|
|
|
* so we don't ignore deliberate fast presses (which would be
|
|
|
|
|
* annoying). */
|
2003-03-25 21:17:29 +00:00
|
|
|
this->PostScreenMessage( SM_AllowOptionsMenuRepeat, 0.5f );
|
2002-09-07 09:37:27 +00:00
|
|
|
}
|
|
|
|
|
|
2004-02-19 03:56:50 +00:00
|
|
|
m_Menu.StartTransitioning( SM_BeginFadingOut );
|
2002-09-07 09:37:27 +00:00
|
|
|
}
|
2003-02-05 16:53:21 +00:00
|
|
|
|
|
|
|
|
if( GAMESTATE->IsExtraStage() && PREFSMAN->m_bPickExtraStage )
|
|
|
|
|
{
|
|
|
|
|
/* Check if user selected the real extra stage. */
|
|
|
|
|
Song* pSong;
|
2003-08-03 00:13:55 +00:00
|
|
|
Steps* pNotes;
|
2003-02-05 16:53:21 +00:00
|
|
|
PlayerOptions po;
|
|
|
|
|
SongOptions so;
|
2003-07-30 02:01:19 +00:00
|
|
|
SONGMAN->GetExtraStageInfo( false, GAMESTATE->GetCurrentStyleDef(), pSong, pNotes, po, so );
|
2003-02-05 16:53:21 +00:00
|
|
|
ASSERT(pSong);
|
|
|
|
|
|
|
|
|
|
/* Enable 2nd extra stage if user chose the correct song */
|
|
|
|
|
if( m_MusicWheel.GetSelectedSong() == pSong )
|
|
|
|
|
GAMESTATE->m_bAllow2ndExtraStage = true;
|
|
|
|
|
else
|
|
|
|
|
GAMESTATE->m_bAllow2ndExtraStage = false;
|
|
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenSelectMusic::MenuBack( PlayerNumber pn )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->StopMusic();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
m_Menu.Back( SM_GoToPrevScreen );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenSelectMusic::AfterNotesChange( PlayerNumber pn )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2003-04-07 21:24:14 +00:00
|
|
|
if( !GAMESTATE->IsHumanPlayer(pn) )
|
2002-05-20 08:59:37 +00:00
|
|
|
return;
|
|
|
|
|
|
2003-07-21 22:45:18 +00:00
|
|
|
m_iSelection[pn] = clamp( m_iSelection[pn], 0, int(m_arrayNotes.size()-1) ); // bounds clamping
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2004-02-09 06:26:13 +00:00
|
|
|
Steps* pSteps = m_arrayNotes.empty()? NULL: m_arrayNotes[m_iSelection[pn]];
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2004-02-09 06:26:13 +00:00
|
|
|
GAMESTATE->m_pCurNotes[pn] = pSteps;
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-08-13 23:26:46 +00:00
|
|
|
// m_BPMDisplay.SetZoomY( 0 );
|
|
|
|
|
// m_BPMDisplay.BeginTweening( 0.2f );
|
2003-04-12 06:16:12 +00:00
|
|
|
// m_BPMDisplay.SetZoomY( 1.2f );
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2004-02-09 06:26:13 +00:00
|
|
|
if( pSteps )
|
2003-09-08 07:21:41 +00:00
|
|
|
{
|
2003-10-20 01:06:26 +00:00
|
|
|
int iScore = 0;
|
2003-09-08 07:21:41 +00:00
|
|
|
if( PROFILEMAN->IsUsingProfile(pn) )
|
2004-02-09 06:26:13 +00:00
|
|
|
iScore = PROFILEMAN->GetProfile(pn)->GetStepsHighScoreList(pSteps).GetTopScore().iScore;
|
2003-09-08 07:21:41 +00:00
|
|
|
else
|
2004-02-09 06:26:13 +00:00
|
|
|
iScore = PROFILEMAN->GetMachineProfile()->GetStepsHighScoreList(pSteps).GetTopScore().iScore;
|
2003-10-20 01:06:26 +00:00
|
|
|
m_textHighScore[pn].SetText( ssprintf("%*i", NUM_SCORE_DIGITS, iScore) );
|
2003-09-08 07:21:41 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_textHighScore[pn].SetText( ssprintf("%*i", NUM_SCORE_DIGITS, 0) );
|
|
|
|
|
}
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2004-02-09 06:26:13 +00:00
|
|
|
m_DifficultyIcon[pn].SetFromNotes( pn, pSteps );
|
|
|
|
|
if( pSteps && pSteps->IsAutogen() )
|
2003-01-11 08:55:21 +00:00
|
|
|
{
|
2003-02-18 23:15:38 +00:00
|
|
|
m_AutoGenIcon[pn].SetEffectDiffuseShift();
|
2003-01-11 08:55:21 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_AutoGenIcon[pn].SetEffectNone();
|
|
|
|
|
m_AutoGenIcon[pn].SetDiffuse( RageColor(1,1,1,0) );
|
|
|
|
|
}
|
2003-07-21 22:38:41 +00:00
|
|
|
m_DifficultyMeter[pn].SetFromGameState( pn );
|
2003-11-17 04:29:14 +00:00
|
|
|
if( SHOW_DIFFICULTY_LIST )
|
|
|
|
|
m_DifficultyList.SetFromGameState();
|
2004-02-09 06:26:13 +00:00
|
|
|
m_GrooveRadar.SetFromNotes( pn, pSteps );
|
2002-09-04 03:49:08 +00:00
|
|
|
m_MusicWheel.NotesChanged( pn );
|
2003-11-17 06:13:12 +00:00
|
|
|
if( SHOW_PANES )
|
|
|
|
|
m_PaneDisplay[pn].SetFromGameState();
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2003-06-25 06:30:13 +00:00
|
|
|
void ScreenSelectMusic::SwitchToPreferredDifficulty()
|
|
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
if( !GAMESTATE->IsHumanPlayer( PlayerNumber(p) ) )
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* Find the closest match to the user's preferred difficulty. */
|
|
|
|
|
int CurDifference = -1;
|
2003-07-21 22:45:18 +00:00
|
|
|
for( unsigned i=0; i<m_arrayNotes.size(); i++ )
|
2003-06-25 06:30:13 +00:00
|
|
|
{
|
2003-07-21 22:45:18 +00:00
|
|
|
int Diff = abs(m_arrayNotes[i]->GetDifficulty() - GAMESTATE->m_PreferredDifficulty[p]);
|
2003-06-25 06:30:13 +00:00
|
|
|
|
|
|
|
|
if( CurDifference == -1 || Diff < CurDifference )
|
|
|
|
|
{
|
|
|
|
|
m_iSelection[p] = i;
|
|
|
|
|
CurDifference = Diff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-21 22:45:18 +00:00
|
|
|
m_iSelection[p] = clamp( m_iSelection[p], 0, int(m_arrayNotes.size()) ) ;
|
2003-06-25 06:30:13 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-12-21 03:05:06 +00:00
|
|
|
template<class T>
|
|
|
|
|
int FindCourseIndexOfSameMode( T begin, T end, const Course *p )
|
|
|
|
|
{
|
|
|
|
|
const PlayMode pm = p->GetPlayMode();
|
|
|
|
|
|
|
|
|
|
int n = 0;
|
|
|
|
|
for( T it = begin; it != end; ++it )
|
|
|
|
|
{
|
|
|
|
|
if( *it == p )
|
|
|
|
|
return n;
|
|
|
|
|
|
|
|
|
|
/* If it's not playable in this mode, don't increment. It might result in
|
|
|
|
|
* different output in different modes, but that's better than having holes. */
|
|
|
|
|
if( !(*it)->IsPlayableIn( GAMESTATE->GetCurrentStyleDef()->m_StepsType ) )
|
|
|
|
|
continue;
|
|
|
|
|
if( (*it)->GetPlayMode() != pm )
|
|
|
|
|
continue;
|
|
|
|
|
++n;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
void ScreenSelectMusic::AfterMusicChange()
|
|
|
|
|
{
|
2003-07-30 21:49:21 +00:00
|
|
|
if( !m_MusicWheel.IsRouletting() )
|
2003-11-07 20:10:38 +00:00
|
|
|
m_Menu.m_MenuTimer->Stall();
|
2002-08-20 21:00:56 +00:00
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
Song* pSong = m_MusicWheel.GetSelectedSong();
|
2003-06-16 17:28:58 +00:00
|
|
|
if( pSong )
|
|
|
|
|
GAMESTATE->m_pCurSong = pSong;
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-22 08:43:12 +00:00
|
|
|
m_GrooveGraph.SetFromSong( pSong );
|
|
|
|
|
|
2003-07-20 05:13:45 +00:00
|
|
|
Course* pCourse = m_MusicWheel.GetSelectedCourse();
|
|
|
|
|
if( pCourse )
|
|
|
|
|
GAMESTATE->m_pCurCourse = pCourse;
|
|
|
|
|
|
2002-09-06 08:56:28 +00:00
|
|
|
int pn;
|
|
|
|
|
for( pn = 0; pn < NUM_PLAYERS; ++pn)
|
2003-07-21 22:45:18 +00:00
|
|
|
m_arrayNotes.clear();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-06-11 01:48:25 +00:00
|
|
|
m_Banner.SetMovingFast( !!m_MusicWheel.IsMoving() );
|
2003-01-02 03:00:53 +00:00
|
|
|
|
2003-12-18 08:53:38 +00:00
|
|
|
CString SampleMusicToPlay, SampleMusicTimingData;
|
2003-11-17 02:52:03 +00:00
|
|
|
vector<CString> m_Artists, m_AltArtists;
|
2003-07-15 03:21:50 +00:00
|
|
|
|
2003-11-17 04:12:11 +00:00
|
|
|
m_MachineRank.SetText( "" );
|
2002-05-20 08:59:37 +00:00
|
|
|
switch( m_MusicWheel.GetSelectedType() )
|
|
|
|
|
{
|
|
|
|
|
case TYPE_SECTION:
|
2003-06-16 17:28:58 +00:00
|
|
|
case TYPE_SORT:
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
|
|
|
|
CString sGroup = m_MusicWheel.GetSelectedSection();
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
m_iSelection[p] = -1;
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-06-23 08:37:53 +00:00
|
|
|
m_Banner.LoadFromGroup( sGroup ); // if this isn't a group, it'll default to the fallback banner
|
2003-03-30 19:30:54 +00:00
|
|
|
m_BPMDisplay.NoBPM();
|
2003-05-20 05:31:38 +00:00
|
|
|
m_sprCDTitleFront.UnloadTexture();
|
|
|
|
|
m_sprCDTitleBack.UnloadTexture();
|
2003-06-30 06:51:05 +00:00
|
|
|
m_DifficultyDisplay.UnsetDifficulties();
|
2003-04-21 22:26:07 +00:00
|
|
|
|
2004-01-11 10:38:38 +00:00
|
|
|
m_fSampleStartSeconds = 0;
|
|
|
|
|
m_fSampleLengthSeconds = -1;
|
2003-06-23 08:37:53 +00:00
|
|
|
switch( m_MusicWheel.GetSelectedType() )
|
|
|
|
|
{
|
|
|
|
|
case TYPE_SECTION:
|
2003-07-15 03:21:50 +00:00
|
|
|
SampleMusicToPlay = THEME->GetPathToS("ScreenSelectMusic section music");
|
2003-06-23 08:37:53 +00:00
|
|
|
break;
|
|
|
|
|
case TYPE_SORT:
|
2003-07-15 03:21:50 +00:00
|
|
|
SampleMusicToPlay = THEME->GetPathToS("ScreenSelectMusic sort music");
|
2003-06-23 08:37:53 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
|
2003-04-21 22:26:07 +00:00
|
|
|
m_sprBalloon.StopTweening();
|
|
|
|
|
OFF_COMMAND( m_sprBalloon );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case TYPE_SONG:
|
|
|
|
|
{
|
2003-07-15 03:21:50 +00:00
|
|
|
SampleMusicToPlay = pSong->GetMusicPath();
|
2003-12-18 08:53:38 +00:00
|
|
|
SampleMusicTimingData = pSong->GetCacheFilePath();
|
2003-07-15 03:21:50 +00:00
|
|
|
m_fSampleStartSeconds = pSong->m_fMusicSampleStartSeconds;
|
|
|
|
|
m_fSampleLengthSeconds = pSong->m_fMusicSampleLengthSeconds;
|
2002-10-02 16:56:09 +00:00
|
|
|
|
2003-08-10 08:58:11 +00:00
|
|
|
pSong->GetSteps( m_arrayNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
2003-07-21 22:45:18 +00:00
|
|
|
SortNotesArrayByDifficulty( m_arrayNotes );
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-11-13 00:39:36 +00:00
|
|
|
if ( PREFSMAN->m_bShowBanners )
|
|
|
|
|
m_Banner.LoadFromSong( pSong );
|
|
|
|
|
else
|
|
|
|
|
m_Banner.LoadFallback() ;
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-03-30 19:30:54 +00:00
|
|
|
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
|
|
|
|
{
|
|
|
|
|
m_BPMDisplay.CycleRandomly();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2003-05-23 01:14:43 +00:00
|
|
|
m_BPMDisplay.SetBPM( pSong );
|
2003-03-30 19:30:54 +00:00
|
|
|
}
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-06-30 06:51:05 +00:00
|
|
|
const CString CDTitlePath = pSong->HasCDTitle()? pSong->GetCDTitlePath():g_sFallbackCDTitlePath;
|
2003-07-09 20:28:07 +00:00
|
|
|
TEXTUREMAN->DisableOddDimensionWarning();
|
2003-05-20 05:31:38 +00:00
|
|
|
m_sprCDTitleFront.Load( CDTitlePath );
|
|
|
|
|
m_sprCDTitleBack.Load( CDTitlePath );
|
2003-07-09 20:28:07 +00:00
|
|
|
TEXTUREMAN->EnableOddDimensionWarning();
|
2003-07-10 02:08:18 +00:00
|
|
|
FlipSpriteHorizontally(m_sprCDTitleBack);
|
2003-05-20 05:31:38 +00:00
|
|
|
|
2004-02-08 01:05:53 +00:00
|
|
|
const vector<Song*> best = SONGMAN->GetBestSongs( PROFILE_SLOT_MACHINE );
|
2003-11-17 04:12:11 +00:00
|
|
|
const int index = FindIndex( best.begin(), best.end(), pSong );
|
|
|
|
|
if( index != -1 )
|
|
|
|
|
m_MachineRank.SetText( ssprintf("%i", index+1) );
|
|
|
|
|
|
2003-08-07 06:36:34 +00:00
|
|
|
m_DifficultyDisplay.SetDifficulties( pSong, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
2003-06-25 06:30:13 +00:00
|
|
|
|
2003-07-01 20:12:59 +00:00
|
|
|
SwitchToPreferredDifficulty();
|
2003-02-23 01:53:36 +00:00
|
|
|
|
2003-02-28 09:25:25 +00:00
|
|
|
/* Short delay before actually showing these, so they don't show
|
|
|
|
|
* up when scrolling fast. It'll still show up in "slow" scrolling,
|
|
|
|
|
* but it doesn't look at weird as it does in "fast", and I don't
|
|
|
|
|
* like the effect with a lot of delay. */
|
2003-02-23 01:53:36 +00:00
|
|
|
if( pSong->m_fMusicLengthSeconds > PREFSMAN->m_fMarathonVerSongSeconds )
|
|
|
|
|
{
|
2003-04-21 22:26:07 +00:00
|
|
|
m_sprBalloon.StopTweening();
|
|
|
|
|
m_sprBalloon.Load( THEME->GetPathToG("ScreenSelectMusic balloon marathon") );
|
|
|
|
|
SET_XY_AND_ON_COMMAND( m_sprBalloon );
|
2003-02-23 01:53:36 +00:00
|
|
|
}
|
|
|
|
|
else if( pSong->m_fMusicLengthSeconds > PREFSMAN->m_fLongVerSongSeconds )
|
|
|
|
|
{
|
2003-04-21 22:26:07 +00:00
|
|
|
m_sprBalloon.StopTweening();
|
|
|
|
|
m_sprBalloon.Load( THEME->GetPathToG("ScreenSelectMusic balloon long") );
|
|
|
|
|
SET_XY_AND_ON_COMMAND( m_sprBalloon );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_sprBalloon.StopTweening();
|
|
|
|
|
OFF_COMMAND( m_sprBalloon );
|
2003-02-23 01:53:36 +00:00
|
|
|
}
|
2003-08-03 09:00:12 +00:00
|
|
|
|
2003-11-17 02:52:03 +00:00
|
|
|
m_Artists.push_back( pSong->GetDisplayArtist() );
|
|
|
|
|
m_AltArtists.push_back( pSong->GetTranslitArtist() );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case TYPE_ROULETTE:
|
2003-06-16 17:28:58 +00:00
|
|
|
case TYPE_RANDOM:
|
2003-06-29 21:52:39 +00:00
|
|
|
switch(m_MusicWheel.GetSelectedType())
|
|
|
|
|
{
|
2003-07-03 06:38:57 +00:00
|
|
|
case TYPE_ROULETTE: m_Banner.LoadRoulette(); break;
|
|
|
|
|
case TYPE_RANDOM: m_Banner.LoadRandom(); break;
|
2003-06-29 21:52:39 +00:00
|
|
|
default: ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-30 19:30:54 +00:00
|
|
|
m_BPMDisplay.NoBPM();
|
2003-05-20 05:31:38 +00:00
|
|
|
m_sprCDTitleFront.UnloadTexture();
|
|
|
|
|
m_sprCDTitleBack.UnloadTexture();
|
2003-06-30 06:51:05 +00:00
|
|
|
m_DifficultyDisplay.UnsetDifficulties();
|
2003-03-25 22:23:58 +00:00
|
|
|
|
2004-01-11 10:38:38 +00:00
|
|
|
m_fSampleStartSeconds = 0;
|
|
|
|
|
m_fSampleLengthSeconds = -1;
|
2003-06-16 17:28:58 +00:00
|
|
|
switch( m_MusicWheel.GetSelectedType() )
|
|
|
|
|
{
|
|
|
|
|
case TYPE_ROULETTE:
|
2003-07-15 03:21:50 +00:00
|
|
|
SampleMusicToPlay = THEME->GetPathToS("ScreenSelectMusic roulette music");
|
2003-06-16 17:28:58 +00:00
|
|
|
break;
|
|
|
|
|
case TYPE_RANDOM:
|
2003-07-15 03:21:50 +00:00
|
|
|
SampleMusicToPlay = THEME->GetPathToS("ScreenSelectMusic random music");
|
2003-06-16 17:28:58 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
2003-03-25 22:23:58 +00:00
|
|
|
|
2003-04-21 22:26:07 +00:00
|
|
|
m_sprBalloon.StopTweening();
|
|
|
|
|
OFF_COMMAND( m_sprBalloon );
|
2003-03-13 23:45:52 +00:00
|
|
|
break;
|
2003-07-20 05:13:45 +00:00
|
|
|
case TYPE_COURSE:
|
|
|
|
|
{
|
|
|
|
|
Course* pCourse = m_MusicWheel.GetSelectedCourse();
|
|
|
|
|
|
|
|
|
|
SampleMusicToPlay = THEME->GetPathToS("ScreenSelectMusic course music");
|
|
|
|
|
// m_textNumSongs.SetText( ssprintf("%d", pCourse->GetEstimatedNumStages()) );
|
|
|
|
|
// float fTotalSeconds;
|
|
|
|
|
// if( pCourse->GetTotalSeconds(fTotalSeconds) )
|
|
|
|
|
// m_textTime.SetText( SecondsToTime(fTotalSeconds) );
|
|
|
|
|
// else
|
|
|
|
|
// m_textTime.SetText( "xx:xx:xx" ); // The numbers format doesn't have a '?'. Is there a better solution?
|
|
|
|
|
|
|
|
|
|
m_Banner.LoadFromCourse( pCourse );
|
|
|
|
|
m_BPMDisplay.SetBPM( pCourse );
|
|
|
|
|
|
|
|
|
|
m_CourseContentsFrame.SetFromCourse( pCourse );
|
|
|
|
|
m_CourseContentsFrame.TweenInAfterChangedCourse();
|
|
|
|
|
m_DifficultyDisplay.UnsetDifficulties();
|
|
|
|
|
|
2003-11-17 02:52:03 +00:00
|
|
|
vector<Course::Info> ci;
|
|
|
|
|
pCourse->GetCourseInfo( GAMESTATE->GetCurrentStyleDef()->m_StepsType, ci );
|
|
|
|
|
|
|
|
|
|
for( unsigned i = 0; i < ci.size(); ++i )
|
|
|
|
|
{
|
|
|
|
|
if( ci[i].Mystery )
|
|
|
|
|
{
|
|
|
|
|
m_Artists.push_back( "???" );
|
|
|
|
|
m_AltArtists.push_back( "???" );
|
|
|
|
|
} else {
|
|
|
|
|
m_Artists.push_back( ci[i].pSong->GetDisplayArtist() );
|
|
|
|
|
m_AltArtists.push_back( ci[i].pSong->GetTranslitArtist() );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-02-08 01:05:53 +00:00
|
|
|
const vector<Course*> best = SONGMAN->GetBestCourses( PROFILE_SLOT_MACHINE );
|
2003-12-21 03:05:06 +00:00
|
|
|
const int index = FindCourseIndexOfSameMode( best.begin(), best.end(), pCourse );
|
2003-11-17 04:12:11 +00:00
|
|
|
if( index != -1 )
|
|
|
|
|
m_MachineRank.SetText( ssprintf("%i", index+1) );
|
|
|
|
|
|
2003-07-20 05:13:45 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2003-03-13 23:45:52 +00:00
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2003-11-25 18:25:43 +00:00
|
|
|
// update stage counter display (long versions/marathons)
|
|
|
|
|
m_sprStage.Load( THEME->GetPathToG("ScreenSelectMusic stage "+GAMESTATE->GetStageText()) );
|
|
|
|
|
|
2003-07-15 03:21:50 +00:00
|
|
|
// Don't stop music if it's already playing the right file.
|
|
|
|
|
if( SampleMusicToPlay == "" )
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->StopMusic();
|
|
|
|
|
else if( SOUND->GetMusicPath() != SampleMusicToPlay )
|
2003-07-15 03:21:50 +00:00
|
|
|
{
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->StopMusic();
|
2003-07-15 03:21:50 +00:00
|
|
|
m_sSampleMusicToPlay = SampleMusicToPlay;
|
2003-12-18 08:53:38 +00:00
|
|
|
m_sSampleMusicTimingData = SampleMusicTimingData;
|
2003-07-15 03:21:50 +00:00
|
|
|
m_fPlaySampleCountdown = SAMPLE_MUSIC_DELAY;
|
|
|
|
|
}
|
|
|
|
|
|
2003-11-17 02:52:03 +00:00
|
|
|
m_Artist.SetTips( m_Artists, m_AltArtists );
|
2003-07-15 03:21:50 +00:00
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
AfterNotesChange( (PlayerNumber)p );
|
|
|
|
|
}
|
2003-01-02 03:00:53 +00:00
|
|
|
|
|
|
|
|
/* Make sure we never start the sample when moving fast. */
|
|
|
|
|
if(m_MusicWheel.IsMoving())
|
|
|
|
|
m_fPlaySampleCountdown = 0;
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-08-04 08:03:41 +00:00
|
|
|
void ScreenSelectMusic::UpdateOptionsDisplays()
|
|
|
|
|
{
|
2002-09-02 21:59:58 +00:00
|
|
|
// m_OptionIcons.Load( GAMESTATE->m_PlayerOptions, &GAMESTATE->m_SongOptions );
|
|
|
|
|
|
2002-09-03 06:33:08 +00:00
|
|
|
// m_PlayerOptionIcons.Refresh();
|
|
|
|
|
|
2002-08-04 08:03:41 +00:00
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
2002-08-13 23:26:46 +00:00
|
|
|
{
|
2003-04-07 21:24:14 +00:00
|
|
|
if( GAMESTATE->IsHumanPlayer(p) )
|
2002-08-13 23:26:46 +00:00
|
|
|
{
|
2004-01-20 01:11:47 +00:00
|
|
|
m_OptionIconRow[p].Refresh();
|
|
|
|
|
|
2002-08-13 23:26:46 +00:00
|
|
|
CString s = GAMESTATE->m_PlayerOptions[p].GetString();
|
|
|
|
|
s.Replace( ", ", "\n" );
|
2002-09-03 06:33:08 +00:00
|
|
|
// m_textPlayerOptions[p].SetText( s );
|
2002-08-13 23:26:46 +00:00
|
|
|
}
|
|
|
|
|
}
|
2002-08-04 08:03:41 +00:00
|
|
|
|
2002-08-13 23:26:46 +00:00
|
|
|
CString s = GAMESTATE->m_SongOptions.GetString();
|
|
|
|
|
s.Replace( ", ", "\n" );
|
|
|
|
|
m_textSongOptions.SetText( s );
|
2002-08-04 08:03:41 +00:00
|
|
|
}
|
|
|
|
|
|
2002-08-20 21:00:56 +00:00
|
|
|
void ScreenSelectMusic::SortOrderChanged()
|
|
|
|
|
{
|
2004-03-12 08:31:40 +00:00
|
|
|
m_MusicSortDisplay.Set( GAMESTATE->m_SortOrder );
|
2002-08-20 21:00:56 +00:00
|
|
|
|
2004-03-12 08:31:40 +00:00
|
|
|
switch( GAMESTATE->m_SortOrder )
|
2004-02-18 23:58:33 +00:00
|
|
|
{
|
|
|
|
|
case SORT_ALL_COURSES:
|
|
|
|
|
case SORT_NONSTOP_COURSES:
|
|
|
|
|
case SORT_ONI_COURSES:
|
|
|
|
|
case SORT_ENDLESS_COURSES:
|
|
|
|
|
case SORT_SORT_MENU:
|
|
|
|
|
case SORT_MODE_MENU:
|
|
|
|
|
// do nothing
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
if( SHOW_DIFFICULTY_LIST )
|
|
|
|
|
m_DifficultyList.Show();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2002-08-20 21:00:56 +00:00
|
|
|
// tween music sort on screen
|
2002-10-07 07:16:40 +00:00
|
|
|
// m_MusicSortDisplay.FadeOn( 0, "fade", TWEEN_TIME );
|
2002-08-20 21:00:56 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
|