2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2002-05-20 08:59:37 +00:00
|
|
|
#include "ScreenSelectMusic.h"
|
|
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "SongManager.h"
|
|
|
|
|
#include "GameManager.h"
|
2004-07-08 00:10:34 +00:00
|
|
|
#include "GameSoundManager.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"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "GameState.h"
|
2002-09-02 21:59:58 +00:00
|
|
|
#include "CodeDetector.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#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-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"
|
2005-07-01 05:07:22 +00:00
|
|
|
#include "Profile.h"
|
2003-11-07 20:10:38 +00:00
|
|
|
#include "MenuTimer.h"
|
2003-11-16 04:45:12 +00:00
|
|
|
#include "LightsManager.h"
|
2005-02-16 03:25:45 +00:00
|
|
|
#include "StatsManager.h"
|
2004-04-18 07:34:37 +00:00
|
|
|
#include "StepsUtil.h"
|
2004-05-23 00:53:20 +00:00
|
|
|
#include "Foreach.h"
|
2004-09-12 05:56:24 +00:00
|
|
|
#include "Style.h"
|
2004-12-20 06:25:59 +00:00
|
|
|
#include "PlayerState.h"
|
2005-01-26 11:21:43 +00:00
|
|
|
#include "Command.h"
|
2005-02-12 21:03:39 +00:00
|
|
|
#include "CommonMetrics.h"
|
2005-03-08 01:39:32 +00:00
|
|
|
#include "BannerCache.h"
|
2005-09-03 06:12:43 +00:00
|
|
|
#include "song.h"
|
2005-09-05 02:26:50 +00:00
|
|
|
#include "InputEventPlus.h"
|
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
|
|
|
|
2004-11-06 23:13:47 +00:00
|
|
|
#define SCORE_SORT_CHANGE_COMMAND(i) THEME->GetMetricA(m_sName,ssprintf("ScoreP%iSortChangeCommand", i+1))
|
|
|
|
|
#define SCORE_FRAME_SORT_CHANGE_COMMAND(i) THEME->GetMetricA(m_sName,ssprintf("ScoreFrameP%iSortChangeCommand", i+1))
|
2005-05-04 19:01:03 +00:00
|
|
|
#define METER_TYPE THEME->GetMetric (m_sName,"MeterType")
|
2005-06-11 10:30:13 +00:00
|
|
|
#define SHOW_OPTIONS_MESSAGE_SECONDS THEME->GetMetricF(m_sName,"ShowOptionsMessageSeconds")
|
|
|
|
|
#define TWEEN_OFF_OPTIONS_MESSAGE_IMMEDIATELY THEME->GetMetricB(m_sName,"TweenOptionsMessageOffImmediately")
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2005-03-28 08:01:36 +00:00
|
|
|
AutoScreenMessage( SM_AllowOptionsMenuRepeat )
|
|
|
|
|
AutoScreenMessage( SM_SongChanged )
|
|
|
|
|
AutoScreenMessage( SM_SortOrderChanging )
|
|
|
|
|
AutoScreenMessage( SM_SortOrderChanged )
|
2005-06-11 10:30:13 +00:00
|
|
|
AutoScreenMessage( SM_TweenOffOptionsMessage )
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2004-09-08 02:53:54 +00:00
|
|
|
static CString g_sCDTitlePath;
|
|
|
|
|
static bool g_bWantFallbackCdTitle;
|
|
|
|
|
static bool g_bCDTitleWaiting = false;
|
|
|
|
|
static CString g_sBannerPath;
|
|
|
|
|
static bool g_bBannerWaiting = false;
|
|
|
|
|
static bool g_bSampleMusicWaiting = false;
|
|
|
|
|
static RageTimer g_StartedLoadingAt(RageZeroTimer);
|
|
|
|
|
|
2004-11-26 17:28:47 +00:00
|
|
|
REGISTER_SCREEN_CLASS( ScreenSelectMusic );
|
2005-02-02 04:17:38 +00:00
|
|
|
ScreenSelectMusic::ScreenSelectMusic( CString sClassName ) : ScreenWithMenuElements( sClassName ),
|
|
|
|
|
BANNER_WIDTH( m_sName, "BannerWidth" ),
|
|
|
|
|
BANNER_HEIGHT( m_sName, "BannerHeight" ),
|
|
|
|
|
SAMPLE_MUSIC_DELAY( m_sName, "SampleMusicDelay" ),
|
|
|
|
|
SHOW_RADAR( m_sName, "ShowRadar" ),
|
|
|
|
|
SHOW_PANES( m_sName, "ShowPanes" ),
|
|
|
|
|
SHOW_DIFFICULTY_LIST( m_sName, "ShowDifficultyList" ),
|
2005-03-30 07:39:41 +00:00
|
|
|
SHOW_COURSE_CONTENTS( m_sName, "ShowCourseContents" ),
|
2005-02-02 04:17:38 +00:00
|
|
|
DO_ROULETTE_ON_MENU_TIMER( m_sName, "DoRouletteOnMenuTimer" ),
|
|
|
|
|
ALIGN_MUSIC_BEATS( m_sName, "AlignMusicBeat" ),
|
2005-03-17 09:34:05 +00:00
|
|
|
CODES( m_sName, "Codes" ),
|
2005-04-23 01:06:43 +00:00
|
|
|
MUSIC_WHEEL_TYPE( m_sName, "MusicWheelType" ),
|
2005-04-26 06:41:57 +00:00
|
|
|
OPTIONS_MENU_AVAILABLE( m_sName, "OptionsMenuAvailable" ),
|
2005-04-27 04:35:55 +00:00
|
|
|
SELECT_MENU_AVAILABLE( m_sName, "SelectMenuAvailable" ),
|
|
|
|
|
MODE_MENU_AVAILABLE( m_sName, "ModeMenuAvailable" )
|
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
|
|
|
|
2004-03-23 06:11:10 +00:00
|
|
|
LIGHTSMAN->SetLightsMode( LIGHTSMODE_MENU );
|
2003-11-16 04:45:12 +00:00
|
|
|
|
2005-04-01 05:26:59 +00:00
|
|
|
if( PREFSMAN->m_bScreenTestMode )
|
|
|
|
|
{
|
2005-07-25 03:59:24 +00:00
|
|
|
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
2005-05-07 08:34:20 +00:00
|
|
|
GAMESTATE->m_pCurStyle.Set( GAMEMAN->GameAndStringToStyle(GAMEMAN->GetDefaultGame(),"versus") );
|
2005-04-01 05:26:59 +00:00
|
|
|
GAMESTATE->m_bSideIsJoined[PLAYER_1] = true;
|
|
|
|
|
GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
|
|
|
|
}
|
|
|
|
|
|
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();
|
2005-02-23 06:29:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::Init()
|
|
|
|
|
{
|
2005-04-26 06:41:57 +00:00
|
|
|
m_bSelectIsDown = false; // used by LoadHelpText which is called by ScreenWithMenuElements::Init()
|
|
|
|
|
|
2005-02-23 06:29:05 +00:00
|
|
|
ScreenWithMenuElements::Init();
|
|
|
|
|
|
|
|
|
|
m_DisplayMode = GAMESTATE->IsCourseMode() ? DISPLAY_COURSES : DISPLAY_SONGS;
|
2004-01-22 03:11:40 +00:00
|
|
|
|
2003-06-30 06:51:05 +00:00
|
|
|
/* Cache: */
|
2005-03-08 06:48:31 +00:00
|
|
|
m_sSectionMusicPath = THEME->GetPathS(m_sName,"section music");
|
|
|
|
|
m_sSortMusicPath = THEME->GetPathS(m_sName,"sort music");
|
|
|
|
|
m_sRouletteMusicPath = THEME->GetPathS(m_sName,"roulette music");
|
|
|
|
|
m_sRandomMusicPath = THEME->GetPathS(m_sName,"random music");
|
|
|
|
|
m_sCourseMusicPath = THEME->GetPathS(m_sName,"course music");
|
|
|
|
|
m_sFallbackCDTitlePath = THEME->GetPathG(m_sName,"fallback cdtitle");
|
|
|
|
|
|
|
|
|
|
|
2005-06-30 22:41:22 +00:00
|
|
|
m_TexturePreload.Load( m_sFallbackCDTitlePath );
|
2003-03-16 07:29:58 +00:00
|
|
|
|
2005-07-07 01:44:24 +00:00
|
|
|
if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_OFF )
|
|
|
|
|
{
|
|
|
|
|
m_TexturePreload.Load( Banner::SongBannerTexture(THEME->GetPathG("Banner","all music")) );
|
|
|
|
|
m_TexturePreload.Load( Banner::SongBannerTexture(THEME->GetPathG("Common","fallback banner")) );
|
|
|
|
|
m_TexturePreload.Load( Banner::SongBannerTexture(THEME->GetPathG("Banner","roulette")) );
|
|
|
|
|
m_TexturePreload.Load( Banner::SongBannerTexture(THEME->GetPathG("Banner","random")) );
|
2005-09-09 05:51:29 +00:00
|
|
|
m_TexturePreload.Load( Banner::SongBannerTexture(THEME->GetPathG("Banner","mode")) );
|
2005-07-07 01:44:24 +00:00
|
|
|
}
|
|
|
|
|
|
2004-06-28 07:26:00 +00:00
|
|
|
if( GAMESTATE->m_pCurStyle == NULL )
|
2003-03-16 07:29:58 +00:00
|
|
|
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." );
|
|
|
|
|
|
2005-03-08 01:39:32 +00:00
|
|
|
/* Load low-res banners, if needed. */
|
|
|
|
|
BANNERCACHE->Demand();
|
|
|
|
|
|
2005-03-17 09:34:05 +00:00
|
|
|
m_MusicWheel.Load( MUSIC_WHEEL_TYPE );
|
2004-02-06 03:57:47 +00:00
|
|
|
|
2004-05-22 02:24:40 +00:00
|
|
|
m_MusicWheelUnder.Load( THEME->GetPathG(m_sName,"wheel under") );
|
2003-11-18 21:55:29 +00:00
|
|
|
m_MusicWheelUnder->SetName( "WheelUnder" );
|
|
|
|
|
SET_XY( m_MusicWheelUnder );
|
|
|
|
|
this->AddChild( m_MusicWheelUnder );
|
|
|
|
|
|
2005-05-31 07:37:57 +00:00
|
|
|
m_MusicWheel.SetName( "MusicWheel" );
|
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
|
2004-05-22 02:24:40 +00:00
|
|
|
m_sprBannerMask.Load( THEME->GetPathG(m_sName,"banner mask") );
|
2003-05-15 06:09:19 +00:00
|
|
|
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" );
|
2004-05-15 18:35:03 +00:00
|
|
|
m_Banner.SetZTestMode( ZTEST_WRITE_ON_PASS ); // 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
|
|
|
|
2004-05-22 02:24:40 +00:00
|
|
|
m_sprBannerFrame.Load( THEME->GetPathG(m_sName,"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" );
|
2004-03-20 02:59:08 +00:00
|
|
|
m_DifficultyDisplay.SetShadowLength( 0 );
|
2003-11-14 23:11:57 +00:00
|
|
|
SET_XY( m_DifficultyDisplay );
|
2003-06-18 07:10:03 +00:00
|
|
|
this->AddChild( &m_DifficultyDisplay );
|
|
|
|
|
|
2003-05-20 05:31:38 +00:00
|
|
|
m_sprCDTitleFront.SetName( "CDTitle" );
|
2004-05-22 02:24:40 +00:00
|
|
|
m_sprCDTitleFront.Load( THEME->GetPathG(m_sName,"fallback cdtitle") );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_sprCDTitleFront );
|
2004-06-03 02:55:47 +00:00
|
|
|
COMMAND( m_sprCDTitleFront, "Front" );
|
2003-05-20 05:31:38 +00:00
|
|
|
this->AddChild( &m_sprCDTitleFront );
|
|
|
|
|
|
|
|
|
|
m_sprCDTitleBack.SetName( "CDTitle" );
|
2004-05-22 02:24:40 +00:00
|
|
|
m_sprCDTitleBack.Load( THEME->GetPathG(m_sName,"fallback cdtitle") );
|
2003-07-20 05:13:45 +00:00
|
|
|
SET_XY( m_sprCDTitleBack );
|
2004-06-03 02:55:47 +00:00
|
|
|
COMMAND( m_sprCDTitleBack, "Back" );
|
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 );
|
|
|
|
|
|
2004-05-22 22:56:58 +00:00
|
|
|
m_textNumSongs.SetName( "NumSongs" );
|
2004-07-25 06:29:50 +00:00
|
|
|
m_textNumSongs.LoadFromFont( THEME->GetPathF(m_sName,"num songs") );
|
2004-05-22 22:56:58 +00:00
|
|
|
SET_XY( m_textNumSongs );
|
|
|
|
|
this->AddChild( &m_textNumSongs );
|
|
|
|
|
|
|
|
|
|
m_textTotalTime.SetName( "TotalTime" );
|
2004-07-25 06:29:50 +00:00
|
|
|
m_textTotalTime.LoadFromFont( THEME->GetPathF(m_sName,"total time") );
|
2004-05-22 22:56:58 +00:00
|
|
|
SET_XY( m_textTotalTime );
|
|
|
|
|
this->AddChild( &m_textTotalTime );
|
|
|
|
|
|
2003-11-17 04:12:11 +00:00
|
|
|
m_Artist.SetName( "ArtistDisplay" );
|
2005-05-31 07:53:13 +00:00
|
|
|
m_Artist.Load( "ArtistDisplay" );
|
2003-11-17 04:12:11 +00:00
|
|
|
SET_XY( m_Artist );
|
|
|
|
|
this->AddChild( &m_Artist );
|
|
|
|
|
|
|
|
|
|
m_MachineRank.SetName( "MachineRank" );
|
2004-05-22 02:24:40 +00:00
|
|
|
m_MachineRank.LoadFromFont( THEME->GetPathF(m_sName,"rank") );
|
2003-11-17 04:12:11 +00:00
|
|
|
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();
|
2005-07-22 22:38:53 +00:00
|
|
|
SET_XY( m_DifficultyList );
|
2003-11-18 04:02:55 +00:00
|
|
|
this->AddChild( &m_DifficultyList );
|
|
|
|
|
}
|
|
|
|
|
|
2005-03-30 07:39:41 +00:00
|
|
|
if( SHOW_COURSE_CONTENTS )
|
|
|
|
|
{
|
|
|
|
|
m_CourseContents.SetName( "CourseContents" );
|
2005-03-30 17:43:34 +00:00
|
|
|
m_CourseContents.Load();
|
2005-03-30 07:39:41 +00:00
|
|
|
SET_XY( m_CourseContents );
|
|
|
|
|
this->AddChild( &m_CourseContents );
|
|
|
|
|
}
|
|
|
|
|
|
2004-06-03 08:22:02 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2003-04-13 21:17:14 +00:00
|
|
|
m_sprDifficultyFrame[p].SetName( ssprintf("DifficultyFrameP%d",p+1) );
|
2004-05-22 02:24:40 +00:00
|
|
|
m_sprDifficultyFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("difficulty frame p%d",p+1)) );
|
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-05-22 02:24:40 +00:00
|
|
|
m_DifficultyIcon[p].Load( THEME->GetPathG(m_sName,ssprintf("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) );
|
2004-05-22 02:24:40 +00:00
|
|
|
m_AutoGenIcon[p].Load( THEME->GetPathG(m_sName,"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_sprMeterFrame[p].SetName( ssprintf("MeterFrameP%d",p+1) );
|
2004-05-22 02:24:40 +00:00
|
|
|
m_sprMeterFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("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 )
|
|
|
|
|
{
|
2005-05-31 07:29:58 +00:00
|
|
|
m_PaneDisplay[p].SetName( ssprintf("PaneDisplayP%d",p+1) );
|
|
|
|
|
m_PaneDisplay[p].Load( "PaneDisplay", p );
|
2004-11-09 07:02:25 +00:00
|
|
|
SET_XY( m_PaneDisplay[p] );
|
2003-11-17 06:13:12 +00:00
|
|
|
this->AddChild( &m_PaneDisplay[p] );
|
|
|
|
|
}
|
|
|
|
|
|
2005-02-23 20:40:46 +00:00
|
|
|
m_DifficultyMeter[p].SetName( ssprintf("MeterP%d",p+1) );
|
2005-05-04 19:01:03 +00:00
|
|
|
m_DifficultyMeter[p].Load( METER_TYPE );
|
2005-07-22 22:38:53 +00:00
|
|
|
SET_XY( m_DifficultyMeter[p] );
|
2003-11-17 06:57:53 +00:00
|
|
|
this->AddChild( &m_DifficultyMeter[p] );
|
|
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_sprHighScoreFrame[p].SetName( ssprintf("ScoreFrameP%d",p+1) );
|
2004-05-22 02:24:40 +00:00
|
|
|
m_sprHighScoreFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("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) );
|
2004-07-25 06:29:50 +00:00
|
|
|
m_textHighScore[p].LoadFromFont( THEME->GetPathF(m_sName,"score") );
|
2004-03-20 02:59:08 +00:00
|
|
|
m_textHighScore[p].SetShadowLength( 0 );
|
2005-08-31 03:41:21 +00:00
|
|
|
m_textHighScore[p].RunCommands( PLAYER_COLOR.GetValue(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
|
|
|
}
|
|
|
|
|
|
2005-03-30 17:43:34 +00:00
|
|
|
m_sprLongBalloon.Load( THEME->GetPathG(m_sName,"balloon long") );
|
|
|
|
|
m_sprLongBalloon->SetName( "Balloon" );
|
|
|
|
|
m_sprLongBalloon->SetHidden( 1 );
|
|
|
|
|
this->AddChild( m_sprLongBalloon );
|
|
|
|
|
|
|
|
|
|
m_sprMarathonBalloon.Load( THEME->GetPathG(m_sName,"balloon marathon") );
|
|
|
|
|
m_sprMarathonBalloon->SetName( "Balloon" );
|
|
|
|
|
m_sprMarathonBalloon->SetHidden( 1 );
|
|
|
|
|
this->AddChild( m_sprMarathonBalloon );
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2004-03-13 23:11:57 +00:00
|
|
|
m_sprCourseHasMods.LoadAndSetName( m_sName, "CourseHasMods" );
|
2004-06-08 07:50:28 +00:00
|
|
|
SET_XY( m_sprCourseHasMods );
|
2004-03-13 23:11:57 +00:00
|
|
|
this->AddChild( m_sprCourseHasMods );
|
|
|
|
|
|
2003-04-13 21:17:14 +00:00
|
|
|
m_sprOptionsMessage.SetName( "OptionsMessage" );
|
2004-05-22 02:24:40 +00:00
|
|
|
m_sprOptionsMessage.Load( THEME->GetPathG(m_sName,"options message 1x2") );
|
2002-09-22 18:18:50 +00:00
|
|
|
m_sprOptionsMessage.StopAnimating();
|
2005-03-13 18:53:16 +00:00
|
|
|
m_sprOptionsMessage.SetHidden( true );
|
2005-07-07 00:06:07 +00:00
|
|
|
m_sprOptionsMessage.SetDrawOrder( DRAW_ORDER_TRANSITIONS+1 );
|
2005-03-13 18:53:16 +00:00
|
|
|
SET_XY( m_sprOptionsMessage );
|
2005-07-07 00:06:07 +00:00
|
|
|
this->AddChild( &m_sprOptionsMessage );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2005-02-06 03:32:53 +00:00
|
|
|
m_bgOptionsOut.Load( THEME->GetPathB(m_sName,"options out") );
|
2005-07-07 00:49:44 +00:00
|
|
|
m_bgOptionsOut.SetDrawOrder( DRAW_ORDER_TRANSITIONS+2 );
|
|
|
|
|
this->AddChild( &m_bgOptionsOut );
|
|
|
|
|
|
2005-02-06 03:32:53 +00:00
|
|
|
m_bgNoOptionsOut.Load( THEME->GetPathB(m_sName,"no options out") );
|
2005-07-07 00:50:43 +00:00
|
|
|
m_bgNoOptionsOut.SetDrawOrder( DRAW_ORDER_TRANSITIONS+2 );
|
2005-07-07 00:49:44 +00:00
|
|
|
this->AddChild( &m_bgNoOptionsOut );
|
2004-02-19 03:56:50 +00:00
|
|
|
|
2004-05-22 02:24:40 +00:00
|
|
|
m_soundDifficultyEasier.Load( THEME->GetPathS(m_sName,"difficulty easier") );
|
|
|
|
|
m_soundDifficultyHarder.Load( THEME->GetPathS(m_sName,"difficulty harder") );
|
|
|
|
|
m_soundOptionsChange.Load( THEME->GetPathS(m_sName,"options") );
|
|
|
|
|
m_soundLocked.Load( THEME->GetPathS(m_sName,"locked") );
|
2005-05-04 01:08:35 +00:00
|
|
|
m_soundSelectPressed.Load( THEME->GetPathS(m_sName,"select down"), true );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2005-07-22 22:38:53 +00:00
|
|
|
this->SortByDrawOrder();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::BeginScreen()
|
|
|
|
|
{
|
|
|
|
|
ScreenWithMenuElements::BeginScreen();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-06-14 22:25:22 +00:00
|
|
|
m_bMadeChoice = false;
|
|
|
|
|
m_bGoToOptions = false;
|
2003-02-10 22:10:12 +00:00
|
|
|
m_bAllowOptionsMenu = m_bAllowOptionsMenuRepeat = false;
|
2005-06-23 01:49:47 +00:00
|
|
|
ZERO( m_iSelection );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
AfterMusicChange();
|
2004-02-13 05:39:15 +00:00
|
|
|
|
2005-07-22 22:38:53 +00:00
|
|
|
m_bgOptionsOut.Reset();
|
|
|
|
|
m_bgNoOptionsOut.Reset();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2005-07-22 22:38:53 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
|
|
|
|
{
|
|
|
|
|
ON_COMMAND( m_DifficultyMeter[p] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( SHOW_DIFFICULTY_LIST )
|
|
|
|
|
ON_COMMAND( m_DifficultyList );
|
|
|
|
|
|
|
|
|
|
TweenSongPartsOnScreen( true );
|
|
|
|
|
TweenCoursePartsOnScreen( true );
|
|
|
|
|
|
|
|
|
|
switch( GAMESTATE->m_SortOrder )
|
|
|
|
|
{
|
|
|
|
|
case SORT_ALL_COURSES:
|
|
|
|
|
case SORT_NONSTOP_COURSES:
|
|
|
|
|
case SORT_ONI_COURSES:
|
|
|
|
|
case SORT_ENDLESS_COURSES:
|
|
|
|
|
TweenSongPartsOffScreen( false );
|
|
|
|
|
SkipSongPartTweens();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
TweenCoursePartsOffScreen( false );
|
|
|
|
|
SkipCoursePartTweens();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-29 17:45:21 +00:00
|
|
|
m_sprOptionsMessage.SetState( 0 );
|
2005-07-22 22:38:53 +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_sprCDTitleFront );
|
|
|
|
|
ON_COMMAND( m_sprCDTitleBack );
|
|
|
|
|
ON_COMMAND( m_GrooveRadar );
|
|
|
|
|
ON_COMMAND( m_textNumSongs );
|
|
|
|
|
ON_COMMAND( m_textTotalTime );
|
|
|
|
|
ON_COMMAND( m_MusicWheelUnder );
|
|
|
|
|
m_MusicWheel.TweenOnScreen();
|
|
|
|
|
ON_COMMAND( m_sprLongBalloon );
|
|
|
|
|
ON_COMMAND( m_sprMarathonBalloon );
|
|
|
|
|
ON_COMMAND( m_sprCourseHasMods );
|
|
|
|
|
ON_COMMAND( m_MusicWheel );
|
|
|
|
|
ON_COMMAND( m_Artist );
|
|
|
|
|
ON_COMMAND( m_MachineRank );
|
|
|
|
|
|
|
|
|
|
FOREACH_HumanPlayer( p )
|
|
|
|
|
{
|
|
|
|
|
ON_COMMAND( m_sprHighScoreFrame[p] );
|
|
|
|
|
ON_COMMAND( m_textHighScore[p] );
|
|
|
|
|
if( SHOW_PANES )
|
|
|
|
|
ON_COMMAND( m_PaneDisplay[p] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SOUND->PlayOnceFromAnnouncer( "select music intro" );
|
|
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
ScreenSelectMusic::~ScreenSelectMusic()
|
|
|
|
|
{
|
2002-08-04 08:03:41 +00:00
|
|
|
LOG->Trace( "ScreenSelectMusic::~ScreenSelectMusic()" );
|
2005-03-08 01:39:32 +00:00
|
|
|
BANNERCACHE->Undemand();
|
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();
|
2003-03-24 21:37:13 +00:00
|
|
|
m_GrooveRadar.TweenOnScreen();
|
2003-11-17 04:32:58 +00:00
|
|
|
if( SHOW_DIFFICULTY_LIST )
|
|
|
|
|
{
|
|
|
|
|
if( Initial )
|
|
|
|
|
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-05-02 22:18:07 +00:00
|
|
|
{
|
|
|
|
|
FOREACH_HumanPlayer( p )
|
|
|
|
|
{
|
|
|
|
|
ON_COMMAND( m_sprDifficultyFrame[p] );
|
|
|
|
|
ON_COMMAND( m_sprMeterFrame[p] );
|
|
|
|
|
ON_COMMAND( m_DifficultyIcon[p] );
|
|
|
|
|
ON_COMMAND( m_AutoGenIcon[p] );
|
|
|
|
|
}
|
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();
|
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-05-02 22:18:07 +00:00
|
|
|
{
|
|
|
|
|
FOREACH_HumanPlayer( p )
|
|
|
|
|
{
|
|
|
|
|
OFF_COMMAND( m_sprDifficultyFrame[p] );
|
|
|
|
|
OFF_COMMAND( m_sprMeterFrame[p] );
|
|
|
|
|
OFF_COMMAND( m_DifficultyIcon[p] );
|
|
|
|
|
OFF_COMMAND( m_AutoGenIcon[p] );
|
|
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::TweenCoursePartsOnScreen( bool Initial )
|
|
|
|
|
{
|
2005-03-30 07:39:41 +00:00
|
|
|
if( SHOW_COURSE_CONTENTS )
|
2003-11-17 06:14:52 +00:00
|
|
|
{
|
2005-03-30 07:39:41 +00:00
|
|
|
m_CourseContents.SetZoomY( 1 );
|
|
|
|
|
if( Initial )
|
|
|
|
|
{
|
|
|
|
|
COMMAND( m_CourseContents, "On" );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_CourseContents.SetFromGameState();
|
|
|
|
|
COMMAND( m_CourseContents, "Show" );
|
|
|
|
|
}
|
2003-11-17 06:14:52 +00:00
|
|
|
}
|
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
|
|
|
{
|
2005-03-30 07:39:41 +00:00
|
|
|
if( SHOW_COURSE_CONTENTS )
|
2003-11-17 06:14:52 +00:00
|
|
|
{
|
2005-03-30 07:39:41 +00:00
|
|
|
if( Final )
|
|
|
|
|
OFF_COMMAND( m_CourseContents );
|
|
|
|
|
else
|
|
|
|
|
COMMAND( m_CourseContents, "Hide" );
|
2003-11-17 06:14:52 +00:00
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::SkipSongPartTweens()
|
|
|
|
|
{
|
|
|
|
|
m_GrooveRadar.FinishTweening();
|
2003-11-17 04:29:14 +00:00
|
|
|
if( SHOW_DIFFICULTY_LIST )
|
|
|
|
|
m_DifficultyList.FinishTweening();
|
2003-07-20 05:13:45 +00:00
|
|
|
|
2005-01-16 21:10:15 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
2003-07-20 05:13:45 +00:00
|
|
|
{
|
|
|
|
|
m_sprDifficultyFrame[p].FinishTweening();
|
|
|
|
|
m_sprMeterFrame[p].FinishTweening();
|
|
|
|
|
m_DifficultyIcon[p].FinishTweening();
|
|
|
|
|
m_AutoGenIcon[p].FinishTweening();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::SkipCoursePartTweens()
|
|
|
|
|
{
|
2005-03-30 07:39:41 +00:00
|
|
|
if( SHOW_COURSE_CONTENTS )
|
|
|
|
|
m_CourseContents.FinishTweening();
|
2003-07-20 05:13:45 +00:00
|
|
|
}
|
|
|
|
|
|
2005-07-22 22:38:53 +00:00
|
|
|
void ScreenSelectMusic::TweenOffScreen()
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2005-05-04 21:58:33 +00:00
|
|
|
ScreenWithMenuElements::TweenOffScreen();
|
|
|
|
|
|
2005-04-29 08:18:44 +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-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 );
|
2004-05-22 22:56:58 +00:00
|
|
|
OFF_COMMAND( m_textNumSongs );
|
|
|
|
|
OFF_COMMAND( m_textTotalTime );
|
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 );
|
2005-03-30 17:43:34 +00:00
|
|
|
OFF_COMMAND( m_sprLongBalloon );
|
|
|
|
|
OFF_COMMAND( m_sprMarathonBalloon );
|
2004-03-13 23:11:57 +00:00
|
|
|
OFF_COMMAND( m_sprCourseHasMods );
|
2003-11-17 02:52:03 +00:00
|
|
|
OFF_COMMAND( m_Artist );
|
2003-11-17 04:12:11 +00:00
|
|
|
OFF_COMMAND( m_MachineRank );
|
|
|
|
|
|
2004-06-08 07:50:28 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
2003-03-24 21:37:13 +00:00
|
|
|
{
|
2003-04-13 21:17:14 +00:00
|
|
|
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. */
|
2004-05-07 02:53:07 +00:00
|
|
|
void ScreenSelectMusic::SwitchDisplayMode( DisplayMode dm )
|
2003-07-20 05:13:45 +00:00
|
|
|
{
|
2004-05-07 02:53:07 +00:00
|
|
|
if( m_DisplayMode == dm )
|
2003-07-20 05:13:45 +00:00
|
|
|
return;
|
|
|
|
|
|
2004-05-07 02:53:07 +00:00
|
|
|
// tween off
|
|
|
|
|
switch( m_DisplayMode )
|
|
|
|
|
{
|
|
|
|
|
case DISPLAY_SONGS:
|
|
|
|
|
TweenSongPartsOffScreen( false );
|
|
|
|
|
break;
|
|
|
|
|
case DISPLAY_COURSES:
|
|
|
|
|
TweenCoursePartsOffScreen( false );
|
|
|
|
|
break;
|
|
|
|
|
case DISPLAY_MODES:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
|
2004-05-07 02:53:07 +00:00
|
|
|
// tween on
|
|
|
|
|
m_DisplayMode = dm;
|
|
|
|
|
switch( m_DisplayMode )
|
|
|
|
|
{
|
|
|
|
|
case DISPLAY_SONGS:
|
|
|
|
|
TweenSongPartsOnScreen( false );
|
|
|
|
|
break;
|
|
|
|
|
case DISPLAY_COURSES:
|
|
|
|
|
TweenCoursePartsOnScreen( false );
|
|
|
|
|
break;
|
|
|
|
|
case DISPLAY_MODES:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
}
|
|
|
|
|
|
2002-08-28 22:42:40 +00:00
|
|
|
void ScreenSelectMusic::TweenScoreOnAndOffAfterChangeSort()
|
|
|
|
|
{
|
2005-01-16 21:10:15 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
2002-08-28 22:42:40 +00:00
|
|
|
{
|
2004-12-03 05:19:46 +00:00
|
|
|
m_textHighScore[p].RunCommands( SCORE_SORT_CHANGE_COMMAND(p) );
|
|
|
|
|
m_sprHighScoreFrame[p].RunCommands( SCORE_FRAME_SORT_CHANGE_COMMAND(p) );
|
2002-08-28 22:42:40 +00:00
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
|
2005-04-29 08:18:44 +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:
|
2004-05-07 02:53:07 +00:00
|
|
|
SwitchDisplayMode( DISPLAY_COURSES );
|
2003-07-20 08:54:31 +00:00
|
|
|
break;
|
2004-01-11 08:15:44 +00:00
|
|
|
case SORT_MODE_MENU:
|
2004-05-07 02:53:07 +00:00
|
|
|
SwitchDisplayMode( DISPLAY_MODES );
|
2004-01-11 08:15:44 +00:00
|
|
|
break;
|
2003-07-20 08:54:31 +00:00
|
|
|
default:
|
2004-05-07 02:53:07 +00:00
|
|
|
SwitchDisplayMode( DISPLAY_SONGS );
|
2003-07-20 08:54:31 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2002-08-28 22:42:40 +00:00
|
|
|
}
|
|
|
|
|
|
2004-09-08 02:53:54 +00:00
|
|
|
void ScreenSelectMusic::CheckBackgroundRequests()
|
2002-08-13 23:26:46 +00:00
|
|
|
{
|
2004-09-08 02:53:54 +00:00
|
|
|
if( g_bCDTitleWaiting )
|
2002-10-06 16:56:58 +00:00
|
|
|
{
|
2004-09-08 02:53:54 +00:00
|
|
|
/* The CDTitle is normally very small, so we don't bother waiting to display it. */
|
|
|
|
|
CString sPath;
|
|
|
|
|
if( m_BackgroundLoader.IsCacheFileFinished(g_sCDTitlePath, sPath) )
|
2003-03-25 22:23:58 +00:00
|
|
|
{
|
2004-09-08 02:53:54 +00:00
|
|
|
g_bCDTitleWaiting = false;
|
|
|
|
|
|
|
|
|
|
CString sCDTitlePath = sPath;
|
|
|
|
|
|
|
|
|
|
if( sCDTitlePath.empty() || !IsAFile(sCDTitlePath) )
|
2005-03-08 06:48:31 +00:00
|
|
|
sCDTitlePath = g_bWantFallbackCdTitle? m_sFallbackCDTitlePath:CString("");
|
2004-09-08 02:53:54 +00:00
|
|
|
|
|
|
|
|
if( !sCDTitlePath.empty() )
|
2003-03-25 22:23:58 +00:00
|
|
|
{
|
2004-09-08 02:53:54 +00:00
|
|
|
TEXTUREMAN->DisableOddDimensionWarning();
|
|
|
|
|
m_sprCDTitleFront.Load( sCDTitlePath );
|
|
|
|
|
m_sprCDTitleBack.Load( sCDTitlePath );
|
|
|
|
|
TEXTUREMAN->EnableOddDimensionWarning();
|
2003-03-25 22:23:58 +00:00
|
|
|
}
|
2004-09-08 02:53:54 +00:00
|
|
|
|
|
|
|
|
m_BackgroundLoader.FinishedWithCachedFile( g_sCDTitlePath );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2004-09-10 03:37:33 +00:00
|
|
|
/* Loading the rest can cause small skips, so don't do it until the wheel settles.
|
|
|
|
|
* Do load if we're transitioning out, though, so we don't miss starting the music
|
2005-03-31 03:18:58 +00:00
|
|
|
* for the options screen if a song is selected quickly. Also, don't do this
|
|
|
|
|
* if the wheel is locked, since we're just bouncing around after selecting TYPE_RANDOM,
|
|
|
|
|
* and it'll take a while before the wheel will settle. */
|
|
|
|
|
if( !m_MusicWheel.IsSettled() && !m_MusicWheel.WheelIsLocked() && !m_Out.IsTransitioning() )
|
2004-09-08 02:53:54 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if( g_bBannerWaiting )
|
|
|
|
|
{
|
2005-04-23 06:20:26 +00:00
|
|
|
if( m_Banner.GetTweenTimeLeft() > 0 )
|
2005-03-08 01:39:32 +00:00
|
|
|
return;
|
2004-09-08 02:53:54 +00:00
|
|
|
|
|
|
|
|
CString sPath;
|
2005-04-23 06:19:36 +00:00
|
|
|
bool bFreeCache = false;
|
2005-03-08 01:39:32 +00:00
|
|
|
if( TEXTUREMAN->IsTextureRegistered( Sprite::SongBannerTexture(g_sBannerPath) ) )
|
2004-09-08 02:53:54 +00:00
|
|
|
{
|
2005-03-08 01:39:32 +00:00
|
|
|
/* If the file is already loaded into a texture, it's finished,
|
|
|
|
|
* and we only do this to honor the HighQualTime value. */
|
|
|
|
|
sPath = g_sBannerPath;
|
2004-09-08 02:53:54 +00:00
|
|
|
}
|
|
|
|
|
else
|
2005-03-08 01:39:32 +00:00
|
|
|
{
|
|
|
|
|
if( !m_BackgroundLoader.IsCacheFileFinished( g_sBannerPath, sPath ) )
|
|
|
|
|
return;
|
2005-04-23 06:19:36 +00:00
|
|
|
bFreeCache = true;
|
2005-03-08 01:39:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_bBannerWaiting = false;
|
2005-04-23 10:19:47 +00:00
|
|
|
m_Banner.Load( sPath, true );
|
2005-04-23 06:19:36 +00:00
|
|
|
|
|
|
|
|
if( bFreeCache )
|
|
|
|
|
m_BackgroundLoader.FinishedWithCachedFile( g_sBannerPath );
|
2004-09-08 02:53:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Nothing else is going. Start the music, if we havn't yet. */
|
|
|
|
|
if( g_bSampleMusicWaiting )
|
|
|
|
|
{
|
|
|
|
|
/* Don't start the music sample when moving fast. */
|
|
|
|
|
if( g_StartedLoadingAt.Ago() >= SAMPLE_MUSIC_DELAY )
|
|
|
|
|
{
|
|
|
|
|
g_bSampleMusicWaiting = false;
|
|
|
|
|
|
|
|
|
|
SOUND->PlayMusic(
|
|
|
|
|
m_sSampleMusicToPlay, m_pSampleMusicTimingData,
|
|
|
|
|
true, m_fSampleStartSeconds, m_fSampleLengthSeconds,
|
|
|
|
|
1.5f, /* fade out for 1.5 seconds */
|
|
|
|
|
ALIGN_MUSIC_BEATS );
|
2003-03-25 22:23:58 +00:00
|
|
|
}
|
2004-09-08 02:53:54 +00:00
|
|
|
else
|
|
|
|
|
return;
|
2002-10-06 16:56:58 +00:00
|
|
|
}
|
2002-08-13 23:26:46 +00:00
|
|
|
}
|
|
|
|
|
|
2004-09-08 02:53:54 +00:00
|
|
|
void ScreenSelectMusic::Update( float fDeltaTime )
|
|
|
|
|
{
|
|
|
|
|
Screen::Update( fDeltaTime );
|
|
|
|
|
|
|
|
|
|
CheckBackgroundRequests();
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-05 02:26:50 +00:00
|
|
|
void ScreenSelectMusic::Input( const InputEventPlus &input )
|
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?
|
2004-06-11 21:35:57 +00:00
|
|
|
// I just like being able to see untransliterated titles occasionally.
|
2005-09-05 02:26:50 +00:00
|
|
|
if( input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_F9 )
|
2003-02-11 23:52:18 +00:00
|
|
|
{
|
2005-09-05 02:26:50 +00:00
|
|
|
if( input.type != IET_FIRST_PRESS )
|
|
|
|
|
return;
|
2005-05-06 20:41:05 +00:00
|
|
|
PREFSMAN->m_bShowNativeLanguage.Set( !PREFSMAN->m_bShowNativeLanguage );
|
2005-03-25 20:01:51 +00:00
|
|
|
m_MusicWheel.RebuildAllMusicWheelItems();
|
2005-03-30 07:39:41 +00:00
|
|
|
if( SHOW_COURSE_CONTENTS )
|
|
|
|
|
m_CourseContents.SetFromGameState();
|
2003-02-11 23:52:18 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-05 02:26:50 +00:00
|
|
|
if( !input.GameI.IsValid() )
|
|
|
|
|
return; // don't care
|
2004-01-18 04:45:59 +00:00
|
|
|
|
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 */
|
2005-09-05 02:26:50 +00:00
|
|
|
PlayerNumber pn = GAMESTATE->GetCurrentStyle()->ControllerToPlayerNumber( input.GameI.controller );
|
2004-01-21 06:14:49 +00:00
|
|
|
if( !GAMESTATE->IsHumanPlayer(pn) )
|
|
|
|
|
return;
|
|
|
|
|
|
2005-04-26 04:22:53 +00:00
|
|
|
// Check for "Press START again for options" button press
|
2004-01-18 20:15:02 +00:00
|
|
|
if( m_bMadeChoice &&
|
2005-09-05 02:26:50 +00:00
|
|
|
input.MenuI.IsValid() &&
|
|
|
|
|
input.MenuI.button == MENU_BUTTON_START &&
|
|
|
|
|
input.type != IET_RELEASE &&
|
|
|
|
|
input.type != IET_LEVEL_CHANGED &&
|
2005-04-23 01:06:43 +00:00
|
|
|
OPTIONS_MENU_AVAILABLE.GetValue() )
|
2004-01-18 04:45:59 +00:00
|
|
|
{
|
|
|
|
|
if(m_bGoToOptions) return; /* got it already */
|
|
|
|
|
if(!m_bAllowOptionsMenu) return; /* not allowed */
|
|
|
|
|
|
|
|
|
|
if( !m_bAllowOptionsMenuRepeat &&
|
2005-09-05 02:26:50 +00:00
|
|
|
(input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ))
|
2004-01-18 04:45:59 +00:00
|
|
|
return; /* not allowed yet */
|
|
|
|
|
|
|
|
|
|
m_bGoToOptions = true;
|
|
|
|
|
m_sprOptionsMessage.SetState( 1 );
|
2004-03-23 23:56:38 +00:00
|
|
|
SCREENMAN->PlayStartSound();
|
2005-06-11 10:30:13 +00:00
|
|
|
|
|
|
|
|
if( TWEEN_OFF_OPTIONS_MESSAGE_IMMEDIATELY )
|
|
|
|
|
{
|
|
|
|
|
// Send SM_TweenOffOptionsMessage faster. Don't tween off the
|
|
|
|
|
// options message until the wheel has finished tweening off though.
|
|
|
|
|
this->ClearMessageQueue( SM_TweenOffOptionsMessage );
|
|
|
|
|
float fOffCommandLengthSeconds = Actor::GetCommandsLengthSeconds( m_sprOptionsMessage.GetCommand("Off") );
|
|
|
|
|
float fSecondsToDelay = max( this->GetTweenTimeLeft() - fOffCommandLengthSeconds, 0 );
|
|
|
|
|
this->PostScreenMessage( SM_TweenOffOptionsMessage, fSecondsToDelay );
|
|
|
|
|
}
|
2004-01-18 04:45:59 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2004-05-01 23:19:33 +00:00
|
|
|
if( IsTransitioning() )
|
2004-01-18 04:45:59 +00:00
|
|
|
return; // ignore
|
|
|
|
|
|
2005-09-18 11:43:32 +00:00
|
|
|
if( m_bMadeChoice )
|
|
|
|
|
return; // ignore
|
2004-01-11 09:42:37 +00:00
|
|
|
|
2005-04-26 06:41:57 +00:00
|
|
|
LoadHelpText();
|
|
|
|
|
|
2005-09-18 11:41:44 +00:00
|
|
|
if( input.MenuI.button == MENU_BUTTON_SELECT )
|
|
|
|
|
{
|
|
|
|
|
if( input.type == IET_FIRST_PRESS )
|
|
|
|
|
m_MusicWheel.Move( 0 );
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( SELECT_MENU_AVAILABLE && INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_SELECT) ) )
|
2005-04-26 06:41:57 +00:00
|
|
|
{
|
2005-09-05 02:26:50 +00:00
|
|
|
if( input.type == IET_FIRST_PRESS )
|
2005-04-26 06:41:57 +00:00
|
|
|
{
|
2005-09-05 02:26:50 +00:00
|
|
|
switch( input.MenuI.button )
|
2005-04-26 06:41:57 +00:00
|
|
|
{
|
|
|
|
|
case MENU_BUTTON_LEFT:
|
|
|
|
|
ChangeDifficulty( pn, -1 );
|
2005-08-13 21:27:52 +00:00
|
|
|
return;
|
2005-04-26 06:41:57 +00:00
|
|
|
case MENU_BUTTON_RIGHT:
|
|
|
|
|
ChangeDifficulty( pn, +1 );
|
2005-08-13 21:27:52 +00:00
|
|
|
return;
|
2005-04-26 06:41:57 +00:00
|
|
|
case MENU_BUTTON_START:
|
2005-04-27 04:35:55 +00:00
|
|
|
if( MODE_MENU_AVAILABLE )
|
|
|
|
|
m_MusicWheel.ChangeSort( SORT_MODE_MENU );
|
|
|
|
|
else
|
|
|
|
|
m_soundLocked.Play();
|
2005-08-13 21:27:52 +00:00
|
|
|
return;
|
2005-04-26 06:41:57 +00:00
|
|
|
}
|
|
|
|
|
}
|
2005-09-18 11:41:44 +00:00
|
|
|
return;
|
2005-04-26 06:41:57 +00:00
|
|
|
}
|
|
|
|
|
|
2005-09-05 02:26:50 +00:00
|
|
|
switch( input.MenuI.button )
|
2003-01-02 03:00:53 +00:00
|
|
|
{
|
2005-06-12 23:43:39 +00:00
|
|
|
case MENU_BUTTON_RIGHT:
|
|
|
|
|
case MENU_BUTTON_LEFT:
|
2005-04-11 00:02:55 +00:00
|
|
|
{
|
2005-06-12 23:43:39 +00:00
|
|
|
/* If we're rouletting, hands off. */
|
|
|
|
|
if( m_MusicWheel.IsRouletting() )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
bool bLeftIsDown = false;
|
|
|
|
|
bool bRightIsDown = false;
|
|
|
|
|
FOREACH_EnabledPlayer( p )
|
2005-04-26 06:41:57 +00:00
|
|
|
{
|
2005-09-18 11:41:44 +00:00
|
|
|
bLeftIsDown |= INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_LEFT) );
|
|
|
|
|
bRightIsDown |= INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_RIGHT) );
|
2005-04-26 06:41:57 +00:00
|
|
|
}
|
2005-06-12 23:43:39 +00:00
|
|
|
|
|
|
|
|
bool bBothDown = bLeftIsDown && bRightIsDown;
|
|
|
|
|
bool bNeitherDown = !bLeftIsDown && !bRightIsDown;
|
|
|
|
|
|
2004-01-11 09:42:37 +00:00
|
|
|
|
2005-09-18 11:31:49 +00:00
|
|
|
if( bNeitherDown )
|
|
|
|
|
{
|
2005-09-18 11:41:44 +00:00
|
|
|
/* Both buttons released. */
|
2005-09-18 11:31:49 +00:00
|
|
|
m_MusicWheel.Move( 0 );
|
|
|
|
|
}
|
|
|
|
|
else if( bBothDown )
|
2004-01-11 09:42:37 +00:00
|
|
|
{
|
2005-06-12 23:43:39 +00:00
|
|
|
m_MusicWheel.Move( 0 );
|
2005-09-05 02:26:50 +00:00
|
|
|
if( input.type == IET_FIRST_PRESS )
|
2005-06-12 23:43:39 +00:00
|
|
|
{
|
2005-09-05 02:26:50 +00:00
|
|
|
switch( input.MenuI.button )
|
2005-06-12 23:43:39 +00:00
|
|
|
{
|
|
|
|
|
case MENU_BUTTON_LEFT:
|
2005-09-19 09:01:21 +00:00
|
|
|
m_MusicWheel.ChangeMusicUnlessLocked( -1 );
|
2005-06-12 23:43:39 +00:00
|
|
|
break;
|
|
|
|
|
case MENU_BUTTON_RIGHT:
|
2005-09-19 09:01:21 +00:00
|
|
|
m_MusicWheel.ChangeMusicUnlessLocked( +1 );
|
2005-06-12 23:43:39 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if( bLeftIsDown )
|
|
|
|
|
{
|
2005-09-05 02:26:50 +00:00
|
|
|
if( input.type != IET_RELEASE )
|
2005-06-12 23:43:39 +00:00
|
|
|
m_MusicWheel.Move( -1 );
|
|
|
|
|
}
|
|
|
|
|
else if( bRightIsDown )
|
|
|
|
|
{
|
2005-09-05 02:26:50 +00:00
|
|
|
if( input.type != IET_RELEASE )
|
2005-06-12 23:43:39 +00:00
|
|
|
m_MusicWheel.Move( +1 );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Reset the repeat timer when the button is released.
|
|
|
|
|
// This fixes jumping when you release Left and Right after entering the sort
|
|
|
|
|
// code at the same if L & R aren't released at the exact same time.
|
2005-09-05 02:26:50 +00:00
|
|
|
if( input.type == IET_RELEASE )
|
2005-06-12 23:43:39 +00:00
|
|
|
{
|
|
|
|
|
FOREACH_HumanPlayer( p )
|
|
|
|
|
{
|
|
|
|
|
INPUTMAPPER->ResetKeyRepeat( MenuInput(p, MENU_BUTTON_LEFT) );
|
|
|
|
|
INPUTMAPPER->ResetKeyRepeat( MenuInput(p, MENU_BUTTON_RIGHT) );
|
|
|
|
|
}
|
2004-01-11 09:42:37 +00:00
|
|
|
}
|
|
|
|
|
}
|
2005-06-12 23:43:39 +00:00
|
|
|
break;
|
2003-01-02 03:00:53 +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.
|
2005-09-05 02:26:50 +00:00
|
|
|
switch( input.MenuI.button )
|
2004-01-11 20:40:49 +00:00
|
|
|
{
|
2005-09-23 00:44:52 +00:00
|
|
|
case MENU_BUTTON_UP: this->MenuUp( input ); break;
|
|
|
|
|
case MENU_BUTTON_DOWN: this->MenuDown( input ); break;
|
|
|
|
|
case MENU_BUTTON_LEFT: this->MenuLeft( input ); break;
|
|
|
|
|
case MENU_BUTTON_RIGHT: this->MenuRight( input ); 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. */
|
2005-09-05 02:26:50 +00:00
|
|
|
if( input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_ESC )
|
|
|
|
|
this->MenuBack( input.MenuI.player );
|
2004-02-15 01:52:28 +00:00
|
|
|
else
|
2005-09-23 00:44:52 +00:00
|
|
|
Screen::MenuBack( input );
|
2004-02-15 01:52:28 +00:00
|
|
|
break;
|
2004-01-11 20:40:49 +00:00
|
|
|
// Do the default handler for Start after detecting codes.
|
2005-09-23 00:44:52 +00:00
|
|
|
// case MENU_BUTTON_START: this->MenuStart( input ); break;
|
|
|
|
|
case MENU_BUTTON_COIN: this->MenuCoin( input ); break;
|
2004-01-11 20:40:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-09-05 02:26:50 +00:00
|
|
|
if( input.type == IET_FIRST_PRESS )
|
2002-08-20 21:00:56 +00:00
|
|
|
{
|
2005-09-05 02:26:50 +00:00
|
|
|
if( CodeDetector::EnteredEasierDifficulty(input.GameI.controller) )
|
2003-12-02 09:04:00 +00:00
|
|
|
{
|
|
|
|
|
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
|
|
|
|
m_soundLocked.Play();
|
|
|
|
|
else
|
2004-05-07 04:37:47 +00:00
|
|
|
ChangeDifficulty( pn, -1 );
|
2003-12-02 09:04:00 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2005-09-05 02:26:50 +00:00
|
|
|
if( CodeDetector::EnteredHarderDifficulty(input.GameI.controller) )
|
2003-12-02 09:04:00 +00:00
|
|
|
{
|
|
|
|
|
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
|
|
|
|
m_soundLocked.Play();
|
|
|
|
|
else
|
2004-05-07 04:37:47 +00:00
|
|
|
ChangeDifficulty( pn, +1 );
|
2003-12-02 09:04:00 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2005-09-05 02:26:50 +00:00
|
|
|
if( CodeDetector::EnteredModeMenu(input.GameI.controller) )
|
2003-12-02 09:04:00 +00:00
|
|
|
{
|
2005-04-27 04:35:55 +00:00
|
|
|
if( MODE_MENU_AVAILABLE )
|
2004-01-11 08:15:44 +00:00
|
|
|
m_MusicWheel.ChangeSort( SORT_MODE_MENU );
|
2005-04-27 04:35:55 +00:00
|
|
|
else
|
|
|
|
|
m_soundLocked.Play();
|
2003-12-02 09:04:00 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2005-09-05 02:26:50 +00:00
|
|
|
if( CodeDetector::EnteredNextSort(input.GameI.controller) )
|
2003-12-02 09:04:00 +00:00
|
|
|
{
|
|
|
|
|
if( ( GAMESTATE->IsExtraStage() && !PREFSMAN->m_bPickExtraStage ) || GAMESTATE->IsExtraStage2() )
|
|
|
|
|
m_soundLocked.Play();
|
|
|
|
|
else
|
|
|
|
|
m_MusicWheel.NextSort();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2005-09-05 02:26:50 +00:00
|
|
|
if( !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() && CodeDetector::DetectAndAdjustMusicOptions(input.GameI.controller) )
|
2003-12-02 09:04:00 +00:00
|
|
|
{
|
|
|
|
|
m_soundOptionsChange.Play();
|
2005-07-09 08:28:49 +00:00
|
|
|
MESSAGEMAN->Broadcast( ssprintf("PlayerOptionsChangedP%i", pn+1) );
|
2005-07-09 09:07:59 +00:00
|
|
|
MESSAGEMAN->Broadcast( "SongOptionsChanged" );
|
2003-12-02 09:04:00 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2002-09-02 21:59:58 +00:00
|
|
|
}
|
2004-01-11 20:40:49 +00:00
|
|
|
|
2005-09-05 02:26:50 +00:00
|
|
|
switch( input.MenuI.button )
|
2004-01-11 20:40:49 +00:00
|
|
|
{
|
2005-09-23 00:44:52 +00:00
|
|
|
case MENU_BUTTON_START: Screen::MenuStart( input ); break;
|
2004-01-11 20:40:49 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2005-04-26 06:41:57 +00:00
|
|
|
void ScreenSelectMusic::LoadHelpText()
|
|
|
|
|
{
|
|
|
|
|
ScreenWithMenuElements::LoadHelpText();
|
|
|
|
|
|
|
|
|
|
bool bSelectIsDown = false;
|
|
|
|
|
FOREACH_EnabledPlayer( p )
|
|
|
|
|
bSelectIsDown |= INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_SELECT) );
|
|
|
|
|
if( !SELECT_MENU_AVAILABLE )
|
|
|
|
|
bSelectIsDown = false;
|
|
|
|
|
|
2005-05-09 00:24:51 +00:00
|
|
|
/* If m_soundSelectPressed isn't loaded yet, wait until it is before we do this. */
|
|
|
|
|
if( m_bSelectIsDown != bSelectIsDown && m_soundSelectPressed.IsLoaded() )
|
2005-04-26 06:41:57 +00:00
|
|
|
{
|
2005-05-04 01:08:35 +00:00
|
|
|
if( bSelectIsDown )
|
|
|
|
|
m_soundSelectPressed.Play();
|
|
|
|
|
|
2005-04-26 06:41:57 +00:00
|
|
|
m_bSelectIsDown = bSelectIsDown;
|
|
|
|
|
if( bSelectIsDown )
|
|
|
|
|
MESSAGEMAN->Broadcast( "SelectMenuOn" );
|
|
|
|
|
else
|
|
|
|
|
MESSAGEMAN->Broadcast( "SelectMenuOff" );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-05-07 04:37:47 +00:00
|
|
|
void ScreenSelectMusic::ChangeDifficulty( PlayerNumber pn, int dir )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2004-05-07 04:37:47 +00:00
|
|
|
LOG->Trace( "ScreenSelectMusic::ChangeDifficulty( %d, %d )", pn, dir );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2004-06-03 08:22:02 +00:00
|
|
|
ASSERT( GAMESTATE->IsHumanPlayer(pn) );
|
2003-07-21 22:57:19 +00:00
|
|
|
|
2004-05-07 02:53:07 +00:00
|
|
|
switch( m_MusicWheel.GetSelectedType() )
|
2003-07-21 22:57:19 +00:00
|
|
|
{
|
2004-05-07 02:53:07 +00:00
|
|
|
case TYPE_SONG:
|
2004-06-02 05:12:45 +00:00
|
|
|
case TYPE_PORTAL:
|
2004-06-03 08:22:02 +00:00
|
|
|
{
|
|
|
|
|
m_iSelection[pn] += dir;
|
|
|
|
|
if( CLAMP(m_iSelection[pn],0,m_vpSteps.size()-1) )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// the user explicity switched difficulties. Update the preferred difficulty
|
|
|
|
|
GAMESTATE->ChangePreferredDifficulty( pn, m_vpSteps[ m_iSelection[pn] ]->GetDifficulty() );
|
2004-05-07 02:53:07 +00:00
|
|
|
|
2004-06-03 08:22:02 +00:00
|
|
|
if( dir < 0 )
|
|
|
|
|
m_soundDifficultyEasier.Play();
|
|
|
|
|
else
|
|
|
|
|
m_soundDifficultyHarder.Play();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2005-03-29 21:30:24 +00:00
|
|
|
vector<PlayerNumber> vpns;
|
2004-06-03 08:22:02 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
2004-05-07 04:37:47 +00:00
|
|
|
{
|
2004-06-03 08:22:02 +00:00
|
|
|
if( pn == p || GAMESTATE->DifficultiesLocked() )
|
|
|
|
|
{
|
|
|
|
|
m_iSelection[p] = m_iSelection[pn];
|
2005-03-29 21:30:24 +00:00
|
|
|
vpns.push_back( p );
|
2004-06-03 08:22:02 +00:00
|
|
|
}
|
2004-05-07 04:37:47 +00:00
|
|
|
}
|
2005-03-29 21:30:24 +00:00
|
|
|
AfterStepsChange( vpns );
|
2004-05-07 02:53:07 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case TYPE_COURSE:
|
2004-01-14 06:11:28 +00:00
|
|
|
{
|
2004-06-03 08:22:02 +00:00
|
|
|
m_iSelection[pn] += dir;
|
|
|
|
|
if( CLAMP(m_iSelection[pn],0,m_vpTrails.size()-1) )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// the user explicity switched difficulties. Update the preferred difficulty
|
|
|
|
|
GAMESTATE->ChangePreferredCourseDifficulty( pn, m_vpTrails[ m_iSelection[pn] ]->m_CourseDifficulty );
|
|
|
|
|
|
2004-05-07 04:37:47 +00:00
|
|
|
if( dir < 0 )
|
|
|
|
|
m_soundDifficultyEasier.Play();
|
|
|
|
|
else
|
|
|
|
|
m_soundDifficultyHarder.Play();
|
2004-06-03 08:22:02 +00:00
|
|
|
|
2005-03-29 21:30:24 +00:00
|
|
|
vector<PlayerNumber> vpns;
|
2004-06-03 08:22:02 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
|
|
|
|
{
|
|
|
|
|
if( pn == p || GAMESTATE->DifficultiesLocked() )
|
|
|
|
|
{
|
|
|
|
|
m_iSelection[p] = m_iSelection[pn];
|
2005-03-29 21:30:24 +00:00
|
|
|
vpns.push_back( p );
|
2004-06-03 08:22:02 +00:00
|
|
|
}
|
|
|
|
|
}
|
2005-03-29 21:30:24 +00:00
|
|
|
AfterTrailChange( vpns );
|
2004-01-14 06:11:28 +00:00
|
|
|
}
|
2004-05-07 02:53:07 +00:00
|
|
|
break;
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2004-05-07 02:53:07 +00:00
|
|
|
case TYPE_RANDOM:
|
|
|
|
|
case TYPE_ROULETTE:
|
2005-04-26 07:03:00 +00:00
|
|
|
case TYPE_SECTION:
|
2004-06-01 19:19:35 +00:00
|
|
|
/* XXX: We could be on a music or course sort, or even one with both; we don't
|
|
|
|
|
* really know which difficulty to change. Maybe the two difficulties should be
|
|
|
|
|
* linked ... */
|
2004-06-03 08:22:02 +00:00
|
|
|
if( GAMESTATE->ChangePreferredDifficulty( pn, dir ) )
|
2004-05-07 02:53:07 +00:00
|
|
|
{
|
2004-05-07 04:37:47 +00:00
|
|
|
if( dir < 0 )
|
|
|
|
|
m_soundDifficultyEasier.Play();
|
|
|
|
|
else
|
|
|
|
|
m_soundDifficultyHarder.Play();
|
2004-05-14 06:49:46 +00:00
|
|
|
|
2005-03-29 21:30:24 +00:00
|
|
|
vector<PlayerNumber> vpns;
|
2004-05-14 06:49:46 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
|
|
|
|
{
|
|
|
|
|
if( pn == p || GAMESTATE->DifficultiesLocked() )
|
|
|
|
|
{
|
|
|
|
|
m_iSelection[p] = m_iSelection[pn];
|
2005-03-29 21:30:24 +00:00
|
|
|
vpns.push_back( p );
|
2004-05-14 06:49:46 +00:00
|
|
|
}
|
|
|
|
|
}
|
2005-03-29 21:30:24 +00:00
|
|
|
AfterStepsChange( vpns );
|
2004-05-07 02:53:07 +00:00
|
|
|
}
|
|
|
|
|
break;
|
2005-04-29 20:18:34 +00:00
|
|
|
case TYPE_SORT:
|
|
|
|
|
break;
|
2005-04-26 07:03:00 +00:00
|
|
|
default:
|
2005-04-29 20:18:34 +00:00
|
|
|
WARN( ssprintf("%i", m_MusicWheel.GetSelectedType()) );
|
|
|
|
|
break;
|
2004-05-07 02:53:07 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
2005-03-23 08:48:38 +00:00
|
|
|
if( SM == SM_AllowOptionsMenuRepeat )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2003-02-10 22:10:12 +00:00
|
|
|
m_bAllowOptionsMenuRepeat = true;
|
2005-03-23 08:48:38 +00:00
|
|
|
}
|
2005-06-11 10:30:13 +00:00
|
|
|
else if( SM == SM_TweenOffOptionsMessage )
|
|
|
|
|
{
|
|
|
|
|
OFF_COMMAND( m_sprOptionsMessage );
|
|
|
|
|
this->HandleScreenMessage( SM_BeginFadingOut );
|
|
|
|
|
}
|
2005-03-23 08:48:38 +00:00
|
|
|
else if( SM == SM_MenuTimer )
|
|
|
|
|
{
|
2002-08-20 21:00:56 +00:00
|
|
|
if( m_MusicWheel.IsRouletting() )
|
|
|
|
|
{
|
|
|
|
|
MenuStart(PLAYER_INVALID);
|
2004-05-01 23:19:33 +00:00
|
|
|
m_MenuTimer->SetSeconds( 15 );
|
|
|
|
|
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();
|
2004-05-01 23:19:33 +00:00
|
|
|
m_MenuTimer->SetSeconds( 15 );
|
|
|
|
|
m_MenuTimer->Start();
|
2004-01-11 07:18:51 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MenuStart(PLAYER_INVALID);
|
|
|
|
|
}
|
2002-08-20 21:00:56 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-06-12 23:43:39 +00:00
|
|
|
// Finish sort changing so that the wheel can respond immediately to our
|
|
|
|
|
// request to choose random.
|
|
|
|
|
m_MusicWheel.FinishChangingSorts();
|
|
|
|
|
switch( m_MusicWheel.GetSelectedType() )
|
|
|
|
|
{
|
|
|
|
|
case TYPE_SONG:
|
|
|
|
|
case TYPE_COURSE:
|
|
|
|
|
case TYPE_RANDOM:
|
|
|
|
|
case TYPE_PORTAL:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2004-01-11 07:18:51 +00:00
|
|
|
m_MusicWheel.StartRandom();
|
2005-06-12 23:43:39 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2002-08-20 21:00:56 +00:00
|
|
|
MenuStart(PLAYER_INVALID);
|
|
|
|
|
}
|
2004-05-08 06:19:14 +00:00
|
|
|
return;
|
2005-03-23 08:48:38 +00:00
|
|
|
}
|
|
|
|
|
else if( SM == SM_GoToPrevScreen )
|
|
|
|
|
{
|
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();
|
2005-03-23 08:48:38 +00:00
|
|
|
}
|
|
|
|
|
else if( SM == SM_BeginFadingOut )
|
|
|
|
|
{
|
2004-02-19 03:56:50 +00:00
|
|
|
/* 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 );
|
2005-03-23 08:48:38 +00:00
|
|
|
}
|
|
|
|
|
else if( SM == SM_GoToNextScreen )
|
|
|
|
|
{
|
2005-07-12 05:52:52 +00:00
|
|
|
if( !m_bGoToOptions )
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->StopMusic();
|
2005-03-23 08:48:38 +00:00
|
|
|
}
|
|
|
|
|
else if( SM == SM_SongChanged )
|
|
|
|
|
{
|
2002-06-30 23:19:33 +00:00
|
|
|
AfterMusicChange();
|
2005-03-23 08:48:38 +00:00
|
|
|
}
|
|
|
|
|
else if( SM == SM_SortOrderChanging ) /* happens immediately */
|
|
|
|
|
{
|
2003-07-20 08:54:31 +00:00
|
|
|
TweenScoreOnAndOffAfterChangeSort();
|
2005-03-23 08:48:38 +00:00
|
|
|
}
|
|
|
|
|
else if( SM == SM_SortOrderChanged ) /* happens after the wheel is off and the new song is selected */
|
|
|
|
|
{
|
2004-02-18 23:58:33 +00:00
|
|
|
SortOrderChanged();
|
2005-03-23 08:48:38 +00:00
|
|
|
}
|
|
|
|
|
else if( SM == SM_GainFocus )
|
|
|
|
|
{
|
2004-05-22 23:57:01 +00:00
|
|
|
CodeDetector::RefreshCacheItems( CODES );
|
2005-03-23 08:48:38 +00:00
|
|
|
}
|
|
|
|
|
else if( SM == SM_LoseFocus )
|
|
|
|
|
{
|
2004-05-22 23:57:01 +00:00
|
|
|
CodeDetector::RefreshCacheItems(); /* reset for other screens */
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
2004-05-08 05:55:28 +00:00
|
|
|
|
|
|
|
|
Screen::HandleScreenMessage( SM );
|
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
|
|
|
{
|
2004-06-02 07:22:55 +00:00
|
|
|
case TYPE_SONG:
|
|
|
|
|
case TYPE_PORTAL:
|
2002-09-07 09:37:27 +00:00
|
|
|
{
|
2004-06-02 07:22:55 +00:00
|
|
|
const bool bIsNew = PROFILEMAN->IsSongNew( m_MusicWheel.GetSelectedSong() );
|
|
|
|
|
bool bIsHard = false;
|
2004-06-03 08:22:02 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
2004-06-02 07:22:55 +00:00
|
|
|
{
|
|
|
|
|
if( GAMESTATE->m_pCurSteps[p] && GAMESTATE->m_pCurSteps[p]->GetMeter() >= 10 )
|
|
|
|
|
bIsHard = true;
|
|
|
|
|
}
|
2002-09-07 09:37:27 +00:00
|
|
|
|
2004-06-02 07:22:55 +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;
|
2005-04-05 08:30:57 +00:00
|
|
|
if( GAMESTATE->IsEventMode() )
|
2005-02-16 03:25:45 +00:00
|
|
|
i = max( 0, int(STATSMAN->m_vPlayedStageStats.size())-5 );
|
|
|
|
|
for( ; i < (int)STATSMAN->m_vPlayedStageStats.size(); ++i )
|
2005-04-20 06:13:06 +00:00
|
|
|
if( STATSMAN->m_vPlayedStageStats[i].vpPlayedSongs.back() == m_MusicWheel.GetSelectedSong() )
|
2004-06-02 07:22:55 +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->PlayOnceFromAnnouncer( "select music comment repeat" );
|
|
|
|
|
else if( bIsNew )
|
|
|
|
|
SOUND->PlayOnceFromAnnouncer( "select music comment new" );
|
|
|
|
|
else if( bIsHard )
|
|
|
|
|
SOUND->PlayOnceFromAnnouncer( "select music comment hard" );
|
|
|
|
|
else
|
|
|
|
|
SOUND->PlayOnceFromAnnouncer( "select music comment general" );
|
2002-09-07 09:37:27 +00:00
|
|
|
|
2004-06-02 07:22:55 +00:00
|
|
|
m_bMadeChoice = true;
|
2003-07-20 05:13:45 +00:00
|
|
|
|
2004-06-02 07:22:55 +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() )
|
2005-07-25 03:59:24 +00:00
|
|
|
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
2004-06-02 07:22:55 +00:00
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
break;
|
|
|
|
|
|
2004-06-02 07:22:55 +00:00
|
|
|
case TYPE_COURSE:
|
2003-07-20 05:13:45 +00:00
|
|
|
{
|
2004-06-02 07:22:55 +00:00
|
|
|
SOUND->PlayOnceFromAnnouncer( "select course comment general" );
|
2002-09-07 09:37:27 +00:00
|
|
|
|
2004-06-02 07:22:55 +00:00
|
|
|
Course *pCourse = m_MusicWheel.GetSelectedCourse();
|
|
|
|
|
ASSERT( pCourse );
|
2005-07-25 03:59:24 +00:00
|
|
|
GAMESTATE->m_PlayMode.Set( pCourse->GetPlayMode() );
|
2002-09-07 09:37:27 +00:00
|
|
|
|
2004-06-02 07:22:55 +00:00
|
|
|
// apply #LIVES
|
|
|
|
|
if( pCourse->m_iLives != -1 )
|
|
|
|
|
{
|
|
|
|
|
GAMESTATE->m_SongOptions.m_LifeType = SongOptions::LIFE_BATTERY;
|
|
|
|
|
GAMESTATE->m_SongOptions.m_iBatteryLives = pCourse->m_iLives;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_bMadeChoice = true;
|
|
|
|
|
}
|
2003-07-20 05:13:45 +00:00
|
|
|
break;
|
|
|
|
|
case TYPE_SECTION:
|
|
|
|
|
case TYPE_ROULETTE:
|
2004-06-02 07:22:55 +00:00
|
|
|
case TYPE_RANDOM:
|
2003-07-20 05:13:45 +00:00
|
|
|
case TYPE_SORT:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( m_bMadeChoice )
|
|
|
|
|
{
|
2004-05-01 23:28:53 +00:00
|
|
|
SCREENMAN->PlayStartSound();
|
2002-09-07 09:37:27 +00:00
|
|
|
|
2005-04-23 01:06:43 +00:00
|
|
|
if( OPTIONS_MENU_AVAILABLE )
|
2002-09-07 09:37:27 +00:00
|
|
|
{
|
|
|
|
|
// show "hold START for options"
|
2005-03-13 18:53:16 +00:00
|
|
|
m_sprOptionsMessage.SetHidden( false );
|
|
|
|
|
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-09-10 03:37:33 +00:00
|
|
|
/* If we're currently waiting on song assets, abort all except the music and
|
|
|
|
|
* start the music, so if we make a choice quickly before background requests
|
|
|
|
|
* come through, the music will still start. */
|
|
|
|
|
g_bCDTitleWaiting = g_bBannerWaiting = false;
|
|
|
|
|
m_BackgroundLoader.Abort();
|
|
|
|
|
CheckBackgroundRequests();
|
|
|
|
|
|
2005-06-11 10:30:13 +00:00
|
|
|
if( OPTIONS_MENU_AVAILABLE )
|
|
|
|
|
{
|
|
|
|
|
StartTransitioning( SM_None );
|
|
|
|
|
this->PostScreenMessage( SM_TweenOffOptionsMessage, SHOW_OPTIONS_MESSAGE_SECONDS );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
StartTransitioning( SM_BeginFadingOut );
|
|
|
|
|
}
|
2002-09-07 09:37:27 +00:00
|
|
|
}
|
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
|
|
|
{
|
2005-03-20 06:43:47 +00:00
|
|
|
m_BackgroundLoader.Abort();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2005-03-20 06:14:41 +00:00
|
|
|
Cancel( SM_GoToPrevScreen );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2005-03-29 21:30:24 +00:00
|
|
|
void ScreenSelectMusic::AfterStepsChange( const vector<PlayerNumber> &vpns )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2005-03-29 21:30:24 +00:00
|
|
|
FOREACH_CONST( PlayerNumber, vpns, p )
|
|
|
|
|
{
|
|
|
|
|
PlayerNumber pn = *p;
|
|
|
|
|
ASSERT( GAMESTATE->IsHumanPlayer(pn) );
|
|
|
|
|
|
|
|
|
|
CLAMP( m_iSelection[pn], 0, m_vpSteps.size()-1 );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2005-03-29 21:30:24 +00:00
|
|
|
Song* pSong = GAMESTATE->m_pCurSong;
|
|
|
|
|
Steps* pSteps = m_vpSteps.empty()? NULL: m_vpSteps[m_iSelection[pn]];
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2005-03-29 21:30:24 +00:00
|
|
|
GAMESTATE->m_pCurSteps[pn].Set( pSteps );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2005-03-29 21:30:24 +00:00
|
|
|
int iScore = 0;
|
|
|
|
|
if( pSteps )
|
|
|
|
|
{
|
2005-05-09 08:44:01 +00:00
|
|
|
Profile* pProfile = PROFILEMAN->IsPersistentProfile(pn) ? PROFILEMAN->GetProfile(pn) : PROFILEMAN->GetMachineProfile();
|
2005-08-12 02:37:04 +00:00
|
|
|
iScore = pProfile->GetStepsHighScoreList(pSong,pSteps).GetTopScore().GetScore();
|
2005-03-29 21:30:24 +00:00
|
|
|
}
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2005-03-29 21:30:24 +00:00
|
|
|
m_textHighScore[pn].SetText( ssprintf("%*i", NUM_SCORE_DIGITS, iScore) );
|
|
|
|
|
|
|
|
|
|
m_DifficultyIcon[pn].SetFromSteps( pn, pSteps );
|
|
|
|
|
if( pSteps && pSteps->IsAutogen() )
|
|
|
|
|
{
|
2005-07-24 03:11:03 +00:00
|
|
|
m_AutoGenIcon[pn].StopEffect();
|
2005-04-05 17:47:22 +00:00
|
|
|
m_AutoGenIcon[pn].SetDiffuse( RageColor(1,1,1,1) );
|
2005-03-29 21:30:24 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-07-24 03:11:03 +00:00
|
|
|
m_AutoGenIcon[pn].StopEffect();
|
2005-03-29 21:30:24 +00:00
|
|
|
m_AutoGenIcon[pn].SetDiffuse( RageColor(1,1,1,0) );
|
|
|
|
|
}
|
|
|
|
|
m_DifficultyMeter[pn].SetFromGameState( pn );
|
|
|
|
|
m_GrooveRadar.SetFromSteps( pn, pSteps );
|
|
|
|
|
m_MusicWheel.NotesOrTrailChanged( pn );
|
|
|
|
|
if( SHOW_PANES )
|
2005-04-29 08:18:44 +00:00
|
|
|
m_PaneDisplay[pn].SetFromGameState( GAMESTATE->m_SortOrder );
|
2003-01-11 08:55:21 +00:00
|
|
|
}
|
2005-03-29 21:30:24 +00:00
|
|
|
|
2003-11-17 04:29:14 +00:00
|
|
|
if( SHOW_DIFFICULTY_LIST )
|
|
|
|
|
m_DifficultyList.SetFromGameState();
|
2004-06-03 08:22:02 +00:00
|
|
|
}
|
|
|
|
|
|
2005-03-29 21:30:24 +00:00
|
|
|
void ScreenSelectMusic::AfterTrailChange( const vector<PlayerNumber> &vpns )
|
2004-06-03 08:22:02 +00:00
|
|
|
{
|
2005-03-29 21:30:24 +00:00
|
|
|
FOREACH_CONST( PlayerNumber, vpns, p )
|
|
|
|
|
{
|
|
|
|
|
PlayerNumber pn = *p;
|
|
|
|
|
ASSERT( GAMESTATE->IsHumanPlayer(pn) );
|
|
|
|
|
|
|
|
|
|
CLAMP( m_iSelection[pn], 0, m_vpTrails.size()-1 );
|
2004-06-03 08:22:02 +00:00
|
|
|
|
2005-03-29 21:30:24 +00:00
|
|
|
Course* pCourse = GAMESTATE->m_pCurCourse;
|
|
|
|
|
Trail* pTrail = m_vpTrails.empty()? NULL: m_vpTrails[m_iSelection[pn]];
|
2004-06-03 08:22:02 +00:00
|
|
|
|
2005-05-18 07:14:19 +00:00
|
|
|
GAMESTATE->m_pCurTrail[pn].Set( pTrail );
|
2004-06-03 08:22:02 +00:00
|
|
|
|
2005-03-29 21:30:24 +00:00
|
|
|
int iScore = 0;
|
|
|
|
|
if( pTrail )
|
|
|
|
|
{
|
2005-05-09 08:44:01 +00:00
|
|
|
Profile* pProfile = PROFILEMAN->IsPersistentProfile(pn) ? PROFILEMAN->GetProfile(pn) : PROFILEMAN->GetMachineProfile();
|
2005-08-12 02:37:04 +00:00
|
|
|
iScore = pProfile->GetCourseHighScoreList(pCourse,pTrail).GetTopScore().GetScore();
|
2005-03-29 21:30:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_textHighScore[pn].SetText( ssprintf("%*i", NUM_SCORE_DIGITS, iScore) );
|
|
|
|
|
|
|
|
|
|
m_DifficultyIcon[pn].SetFromTrail( pn, pTrail );
|
|
|
|
|
//if( pTrail && pTrail->IsAutogen() )
|
|
|
|
|
//{
|
|
|
|
|
// m_AutoGenIcon[pn].SetEffectDiffuseShift();
|
|
|
|
|
//}
|
|
|
|
|
//else
|
|
|
|
|
//{
|
|
|
|
|
// m_AutoGenIcon[pn].SetEffectNone();
|
|
|
|
|
// m_AutoGenIcon[pn].SetDiffuse( RageColor(1,1,1,0) );
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
/* Update the trail list, but don't actually start the tween; only do that when
|
|
|
|
|
* the actual course changes (AfterMusicChange). */
|
2005-03-30 07:39:41 +00:00
|
|
|
if( SHOW_COURSE_CONTENTS )
|
|
|
|
|
{
|
|
|
|
|
m_CourseContents.SetFromGameState();
|
|
|
|
|
// m_CourseContents.TweenInAfterChangedCourse();
|
|
|
|
|
}
|
2005-03-29 21:30:24 +00:00
|
|
|
|
|
|
|
|
m_DifficultyMeter[pn].SetFromGameState( pn );
|
|
|
|
|
m_GrooveRadar.SetEmpty( pn );
|
|
|
|
|
m_MusicWheel.NotesOrTrailChanged( pn );
|
|
|
|
|
if( SHOW_PANES )
|
2005-04-29 08:18:44 +00:00
|
|
|
m_PaneDisplay[pn].SetFromGameState( GAMESTATE->m_SortOrder );
|
2004-06-03 08:22:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( SHOW_DIFFICULTY_LIST )
|
|
|
|
|
m_DifficultyList.SetFromGameState();
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
2004-06-03 21:41:54 +00:00
|
|
|
void ScreenSelectMusic::SwitchToPreferredDifficulty()
|
2003-06-25 06:30:13 +00:00
|
|
|
{
|
2004-06-03 21:41:54 +00:00
|
|
|
if( !GAMESTATE->m_pCurCourse )
|
2003-06-25 06:30:13 +00:00
|
|
|
{
|
2004-06-03 21:41:54 +00:00
|
|
|
FOREACH_HumanPlayer( pn )
|
2003-06-25 06:30:13 +00:00
|
|
|
{
|
2004-06-03 21:41:54 +00:00
|
|
|
/* Find the closest match to the user's preferred difficulty. */
|
|
|
|
|
int CurDifference = -1;
|
|
|
|
|
for( unsigned i=0; i<m_vpSteps.size(); i++ )
|
2003-06-25 06:30:13 +00:00
|
|
|
{
|
2004-06-03 21:41:54 +00:00
|
|
|
int Diff = abs(m_vpSteps[i]->GetDifficulty() - GAMESTATE->m_PreferredDifficulty[pn]);
|
|
|
|
|
|
|
|
|
|
if( CurDifference == -1 || Diff < CurDifference )
|
|
|
|
|
{
|
|
|
|
|
m_iSelection[pn] = i;
|
|
|
|
|
CurDifference = Diff;
|
|
|
|
|
}
|
2003-06-25 06:30:13 +00:00
|
|
|
}
|
2004-06-03 21:41:54 +00:00
|
|
|
|
|
|
|
|
CLAMP( m_iSelection[pn],0,m_vpSteps.size()-1 );
|
2003-06-25 06:30:13 +00:00
|
|
|
}
|
2004-06-03 21:41:54 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FOREACH_HumanPlayer( pn )
|
|
|
|
|
{
|
|
|
|
|
/* Find the closest match to the user's preferred difficulty. */
|
|
|
|
|
int CurDifference = -1;
|
|
|
|
|
for( unsigned i=0; i<m_vpTrails.size(); i++ )
|
|
|
|
|
{
|
|
|
|
|
int Diff = abs(m_vpTrails[i]->m_CourseDifficulty - GAMESTATE->m_PreferredCourseDifficulty[pn]);
|
2003-06-25 06:30:13 +00:00
|
|
|
|
2004-06-03 21:41:54 +00:00
|
|
|
if( CurDifference == -1 || Diff < CurDifference )
|
|
|
|
|
{
|
|
|
|
|
m_iSelection[pn] = i;
|
|
|
|
|
CurDifference = Diff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CLAMP( m_iSelection[pn],0,m_vpTrails.size()-1 );
|
|
|
|
|
}
|
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. */
|
2004-06-28 07:26:00 +00:00
|
|
|
if( !(*it)->IsPlayableIn( GAMESTATE->GetCurrentStyle()->m_StepsType ) )
|
2003-12-21 03:05:06 +00:00
|
|
|
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() )
|
2004-05-01 23:19:33 +00:00
|
|
|
m_MenuTimer->Stall();
|
2002-08-20 21:00:56 +00:00
|
|
|
|
2004-05-07 04:37:47 +00:00
|
|
|
// lock difficulties. When switching from arcade to rave, we need to
|
|
|
|
|
// enforce that all players are at the same difficulty.
|
|
|
|
|
if( GAMESTATE->DifficultiesLocked() )
|
|
|
|
|
{
|
|
|
|
|
FOREACH_HumanPlayer( p )
|
|
|
|
|
{
|
|
|
|
|
m_iSelection[p] = m_iSelection[0];
|
|
|
|
|
GAMESTATE->m_PreferredDifficulty[p] = GAMESTATE->m_PreferredDifficulty[0];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
Song* pSong = m_MusicWheel.GetSelectedSong();
|
2005-02-24 12:27:30 +00:00
|
|
|
GAMESTATE->m_pCurSong.Set( pSong );
|
2004-05-21 20:16:13 +00:00
|
|
|
if( pSong )
|
2004-05-26 05:50:22 +00:00
|
|
|
GAMESTATE->m_pPreferredSong = pSong;
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-07-20 05:13:45 +00:00
|
|
|
Course* pCourse = m_MusicWheel.GetSelectedCourse();
|
2005-05-18 07:14:19 +00:00
|
|
|
GAMESTATE->m_pCurCourse.Set( pCourse );
|
2003-07-20 05:13:45 +00:00
|
|
|
if( pCourse )
|
2004-05-26 05:50:22 +00:00
|
|
|
GAMESTATE->m_pPreferredCourse = pCourse;
|
|
|
|
|
|
2004-06-03 08:22:02 +00:00
|
|
|
FOREACH_PlayerNumber( p )
|
|
|
|
|
{
|
2005-02-25 18:17:26 +00:00
|
|
|
GAMESTATE->m_pCurSteps[p].Set( NULL );
|
2005-05-18 07:14:19 +00:00
|
|
|
GAMESTATE->m_pCurTrail[p].Set( NULL );
|
2004-06-03 08:22:02 +00:00
|
|
|
m_vpSteps.clear();
|
|
|
|
|
m_vpTrails.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( "" );
|
2004-08-15 23:16:30 +00:00
|
|
|
|
|
|
|
|
m_sSampleMusicToPlay = "";
|
|
|
|
|
m_pSampleMusicTimingData = NULL;
|
2004-09-08 02:53:54 +00:00
|
|
|
g_sCDTitlePath = "";
|
|
|
|
|
g_sBannerPath = "";
|
|
|
|
|
g_bWantFallbackCdTitle = false;
|
|
|
|
|
bool bWantBanner = true;
|
|
|
|
|
|
2005-04-15 07:18:40 +00:00
|
|
|
static SortOrder s_lastSortOrder = SORT_INVALID;
|
2005-04-29 08:18:44 +00:00
|
|
|
if( GAMESTATE->m_SortOrder != s_lastSortOrder )
|
2005-04-15 07:18:40 +00:00
|
|
|
{
|
|
|
|
|
// Reload to let Lua metrics have a chance to change the help text.
|
2005-04-26 06:41:57 +00:00
|
|
|
LoadHelpText();
|
2005-04-29 08:18:44 +00:00
|
|
|
s_lastSortOrder = GAMESTATE->m_SortOrder;
|
2005-04-15 07:18:40 +00:00
|
|
|
}
|
|
|
|
|
|
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();
|
2004-05-24 06:10:11 +00:00
|
|
|
FOREACH_PlayerNumber( p )
|
2002-05-20 08:59:37 +00:00
|
|
|
m_iSelection[p] = -1;
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-03-30 19:30:54 +00:00
|
|
|
m_BPMDisplay.NoBPM();
|
2004-09-08 02:53:54 +00:00
|
|
|
g_sCDTitlePath = ""; // none
|
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;
|
2004-05-22 22:56:58 +00:00
|
|
|
|
|
|
|
|
m_textNumSongs.SetText( "" );
|
|
|
|
|
m_textTotalTime.SetText( "" );
|
|
|
|
|
|
2003-06-23 08:37:53 +00:00
|
|
|
switch( m_MusicWheel.GetSelectedType() )
|
|
|
|
|
{
|
|
|
|
|
case TYPE_SECTION:
|
2005-07-07 10:07:58 +00:00
|
|
|
g_sBannerPath = SONGMAN->GetSongGroupBannerPath( sGroup );
|
2005-03-08 06:48:31 +00:00
|
|
|
m_sSampleMusicToPlay = m_sSectionMusicPath;
|
2003-06-23 08:37:53 +00:00
|
|
|
break;
|
|
|
|
|
case TYPE_SORT:
|
2004-09-08 02:53:54 +00:00
|
|
|
bWantBanner = false; /* we load it ourself */
|
2005-04-29 08:18:44 +00:00
|
|
|
switch( GAMESTATE->m_SortOrder )
|
2004-04-13 09:46:04 +00:00
|
|
|
{
|
|
|
|
|
case SORT_MODE_MENU:
|
|
|
|
|
m_Banner.LoadMode();
|
|
|
|
|
break;
|
|
|
|
|
}
|
2005-03-08 06:48:31 +00:00
|
|
|
m_sSampleMusicToPlay = m_sSortMusicPath;
|
2003-06-23 08:37:53 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
|
2005-03-30 17:43:34 +00:00
|
|
|
m_sprLongBalloon->StopTweening();
|
|
|
|
|
COMMAND( m_sprLongBalloon, "Hide" );
|
|
|
|
|
m_sprMarathonBalloon->StopTweening();
|
|
|
|
|
COMMAND( m_sprMarathonBalloon, "Hide" );
|
2004-03-13 23:11:57 +00:00
|
|
|
|
2004-06-08 07:50:28 +00:00
|
|
|
COMMAND( m_sprCourseHasMods, "Hide" );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case TYPE_SONG:
|
2004-06-02 05:12:45 +00:00
|
|
|
case TYPE_PORTAL:
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2004-08-15 23:16:30 +00:00
|
|
|
m_sSampleMusicToPlay = pSong->GetMusicPath();
|
|
|
|
|
m_pSampleMusicTimingData = &pSong->m_Timing;
|
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
|
|
|
|
2004-05-22 22:56:58 +00:00
|
|
|
m_textNumSongs.SetText( ssprintf("%d", SongManager::GetNumStagesForSong(pSong) ) );
|
|
|
|
|
m_textTotalTime.SetText( SecondsToMMSSMsMs(pSong->m_fMusicLengthSeconds) );
|
|
|
|
|
|
2004-06-28 07:26:00 +00:00
|
|
|
pSong->GetSteps( m_vpSteps, GAMESTATE->GetCurrentStyle()->m_StepsType );
|
2005-04-24 20:32:03 +00:00
|
|
|
StepsUtil::RemoveLockedSteps( pSong, m_vpSteps );
|
2004-06-03 08:22:02 +00:00
|
|
|
StepsUtil::SortNotesArrayByDifficulty( m_vpSteps );
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2003-11-13 00:39:36 +00:00
|
|
|
if ( PREFSMAN->m_bShowBanners )
|
2004-09-08 02:53:54 +00:00
|
|
|
g_sBannerPath = pSong->GetBannerPath();
|
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
|
|
|
|
|
{
|
2005-03-17 17:53:10 +00:00
|
|
|
m_BPMDisplay.SetBpmFromSong( pSong );
|
2003-03-30 19:30:54 +00:00
|
|
|
}
|
2002-08-13 23:26:46 +00:00
|
|
|
|
2004-09-08 02:53:54 +00:00
|
|
|
g_sCDTitlePath = pSong->GetCDTitlePath();
|
|
|
|
|
g_bWantFallbackCdTitle = true;
|
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 )
|
2005-05-19 23:29:39 +00:00
|
|
|
m_MachineRank.SetText( FormatNumberAndSuffix( index+1 ) );
|
2003-11-17 04:12:11 +00:00
|
|
|
|
2004-06-28 07:26:00 +00:00
|
|
|
m_DifficultyDisplay.SetDifficulties( pSong, GAMESTATE->GetCurrentStyle()->m_StepsType );
|
2003-06-25 06:30:13 +00:00
|
|
|
|
2004-06-03 21:41:54 +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 )
|
|
|
|
|
{
|
2005-03-30 17:43:34 +00:00
|
|
|
m_sprMarathonBalloon->StopTweening();
|
|
|
|
|
SET_XY( m_sprMarathonBalloon );
|
|
|
|
|
COMMAND( m_sprMarathonBalloon, "Show" );
|
|
|
|
|
|
|
|
|
|
m_sprLongBalloon->StopTweening();
|
|
|
|
|
COMMAND( m_sprLongBalloon, "Hide" );
|
2003-02-23 01:53:36 +00:00
|
|
|
}
|
|
|
|
|
else if( pSong->m_fMusicLengthSeconds > PREFSMAN->m_fLongVerSongSeconds )
|
|
|
|
|
{
|
2005-03-30 17:43:34 +00:00
|
|
|
m_sprLongBalloon->StopTweening();
|
|
|
|
|
SET_XY( m_sprLongBalloon );
|
|
|
|
|
COMMAND( m_sprLongBalloon, "Show" );
|
|
|
|
|
|
|
|
|
|
m_sprMarathonBalloon->StopTweening();
|
|
|
|
|
COMMAND( m_sprMarathonBalloon, "Hide" );
|
2003-04-21 22:26:07 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-03-30 17:43:34 +00:00
|
|
|
m_sprLongBalloon->StopTweening();
|
|
|
|
|
COMMAND( m_sprLongBalloon, "Hide" );
|
|
|
|
|
|
|
|
|
|
m_sprMarathonBalloon->StopTweening();
|
|
|
|
|
COMMAND( m_sprMarathonBalloon, "Hide" );
|
2003-02-23 01:53:36 +00:00
|
|
|
}
|
2003-08-03 09:00:12 +00:00
|
|
|
|
2004-06-08 07:50:28 +00:00
|
|
|
COMMAND( m_sprCourseHasMods, "Hide" );
|
2004-03-13 23:11:57 +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:
|
2004-09-08 02:53:54 +00:00
|
|
|
bWantBanner = false; /* we load it ourself */
|
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();
|
2004-09-08 02:53:54 +00:00
|
|
|
g_sCDTitlePath = ""; // none
|
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;
|
2004-05-22 22:56:58 +00:00
|
|
|
|
|
|
|
|
m_textNumSongs.SetText( "" );
|
|
|
|
|
m_textTotalTime.SetText( "" );
|
|
|
|
|
|
2003-06-16 17:28:58 +00:00
|
|
|
switch( m_MusicWheel.GetSelectedType() )
|
|
|
|
|
{
|
|
|
|
|
case TYPE_ROULETTE:
|
2005-03-08 06:48:31 +00:00
|
|
|
m_sSampleMusicToPlay = m_sRouletteMusicPath;
|
2003-06-16 17:28:58 +00:00
|
|
|
break;
|
|
|
|
|
case TYPE_RANDOM:
|
2005-03-08 06:48:31 +00:00
|
|
|
m_sSampleMusicToPlay = m_sRandomMusicPath;
|
2003-06-16 17:28:58 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ASSERT(0);
|
|
|
|
|
}
|
2003-03-25 22:23:58 +00:00
|
|
|
|
2005-03-30 17:43:34 +00:00
|
|
|
m_sprLongBalloon->StopTweening();
|
|
|
|
|
COMMAND( m_sprLongBalloon, "Hide" );
|
|
|
|
|
m_sprMarathonBalloon->StopTweening();
|
|
|
|
|
COMMAND( m_sprMarathonBalloon, "Hide" );
|
2004-03-13 23:11:57 +00:00
|
|
|
|
2004-06-09 04:55:53 +00:00
|
|
|
COMMAND( m_sprCourseHasMods, "Hide" );
|
2004-03-13 23:11:57 +00:00
|
|
|
|
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();
|
2004-06-28 07:26:00 +00:00
|
|
|
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
2004-06-04 02:05:56 +00:00
|
|
|
Trail *pTrail = pCourse->GetTrail( st );
|
2004-06-03 21:41:54 +00:00
|
|
|
ASSERT( pTrail );
|
2003-07-20 05:13:45 +00:00
|
|
|
|
2004-06-28 07:26:00 +00:00
|
|
|
pCourse->GetTrails( m_vpTrails, GAMESTATE->GetCurrentStyle()->m_StepsType );
|
2004-06-03 08:22:02 +00:00
|
|
|
|
2005-03-08 06:48:31 +00:00
|
|
|
m_sSampleMusicToPlay = m_sCourseMusicPath;
|
2004-04-02 04:27:42 +00:00
|
|
|
m_fSampleStartSeconds = 0;
|
|
|
|
|
m_fSampleLengthSeconds = -1;
|
|
|
|
|
|
2004-05-22 22:56:58 +00:00
|
|
|
m_textNumSongs.SetText( ssprintf("%d", pCourse->GetEstimatedNumStages()) );
|
|
|
|
|
float fTotalSeconds;
|
2004-05-23 00:53:20 +00:00
|
|
|
if( pCourse->GetTotalSeconds(st,fTotalSeconds) )
|
2004-05-22 22:56:58 +00:00
|
|
|
m_textTotalTime.SetText( SecondsToMMSSMsMs(fTotalSeconds) );
|
|
|
|
|
else
|
|
|
|
|
m_textTotalTime.SetText( "xx:xx.xx" ); // The numbers format doesn't have a '?'. Is there a better solution?
|
2003-07-20 05:13:45 +00:00
|
|
|
|
2004-09-08 02:53:54 +00:00
|
|
|
g_sBannerPath = pCourse->m_sBannerPath;
|
|
|
|
|
if( g_sBannerPath.empty() )
|
|
|
|
|
m_Banner.LoadFallback();
|
|
|
|
|
|
2005-03-17 17:53:10 +00:00
|
|
|
if( (int)pTrail->m_vEntries.size() > MAX_COURSE_ENTRIES_BEFORE_VARIOUS )
|
|
|
|
|
m_BPMDisplay.SetVarious();
|
|
|
|
|
else
|
|
|
|
|
m_BPMDisplay.SetBpmFromCourse( pCourse );
|
2003-07-20 05:13:45 +00:00
|
|
|
|
|
|
|
|
m_DifficultyDisplay.UnsetDifficulties();
|
|
|
|
|
|
2004-06-03 21:41:54 +00:00
|
|
|
SwitchToPreferredDifficulty();
|
|
|
|
|
|
2004-05-23 00:53:20 +00:00
|
|
|
FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e )
|
2003-11-17 02:52:03 +00:00
|
|
|
{
|
2005-03-10 22:54:55 +00:00
|
|
|
if( e->bSecret )
|
2003-11-17 02:52:03 +00:00
|
|
|
{
|
|
|
|
|
m_Artists.push_back( "???" );
|
|
|
|
|
m_AltArtists.push_back( "???" );
|
2005-03-10 22:54:55 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-05-23 00:53:20 +00:00
|
|
|
m_Artists.push_back( e->pSong->GetDisplayArtist() );
|
|
|
|
|
m_AltArtists.push_back( e->pSong->GetTranslitArtist() );
|
2003-11-17 02:52:03 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-04-07 08:46:40 +00:00
|
|
|
CourseType ct = PlayModeToCourseType( GAMESTATE->m_PlayMode );
|
|
|
|
|
const vector<Course*> best = SONGMAN->GetBestCourses( ct, 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 )
|
2005-05-19 23:29:39 +00:00
|
|
|
m_MachineRank.SetText( FormatNumberAndSuffix( index+1 ) );
|
2003-11-17 04:12:11 +00:00
|
|
|
|
2004-03-13 23:11:57 +00:00
|
|
|
|
|
|
|
|
|
2005-03-30 17:43:34 +00:00
|
|
|
m_sprLongBalloon->StopTweening();
|
|
|
|
|
COMMAND( m_sprLongBalloon, "Hide" );
|
|
|
|
|
m_sprMarathonBalloon->StopTweening();
|
|
|
|
|
COMMAND( m_sprMarathonBalloon, "Hide" );
|
2004-03-13 23:11:57 +00:00
|
|
|
|
|
|
|
|
if( pCourse->HasMods() )
|
|
|
|
|
{
|
2004-06-08 07:50:28 +00:00
|
|
|
COMMAND( m_sprCourseHasMods, "Show" );
|
2004-03-13 23:11:57 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-06-08 07:50:28 +00:00
|
|
|
COMMAND( m_sprCourseHasMods, "Hide" );
|
2004-03-13 23:11:57 +00:00
|
|
|
}
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
2004-09-08 02:53:54 +00:00
|
|
|
m_sprCDTitleFront.UnloadTexture();
|
|
|
|
|
m_sprCDTitleBack.UnloadTexture();
|
|
|
|
|
|
2004-10-16 17:53:47 +00:00
|
|
|
/* Cancel any previous, incomplete requests for song assets, since we need new ones. */
|
2004-09-08 02:53:54 +00:00
|
|
|
m_BackgroundLoader.Abort();
|
|
|
|
|
|
|
|
|
|
g_bCDTitleWaiting = false;
|
|
|
|
|
if( !g_sCDTitlePath.empty() || g_bWantFallbackCdTitle )
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace( "cache \"%s\"", g_sCDTitlePath.c_str());
|
|
|
|
|
m_BackgroundLoader.CacheFile( g_sCDTitlePath ); // empty OK
|
|
|
|
|
g_bCDTitleWaiting = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_bBannerWaiting = false;
|
|
|
|
|
if( bWantBanner )
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace("LoadFromCachedBanner(%s)",g_sBannerPath .c_str());
|
|
|
|
|
if( m_Banner.LoadFromCachedBanner( g_sBannerPath ) )
|
|
|
|
|
{
|
2005-03-08 01:39:32 +00:00
|
|
|
/* If the high-res banner is already loaded, just
|
|
|
|
|
* delay before loading it, so the low-res one has
|
|
|
|
|
* time to fade in. */
|
|
|
|
|
if( !TEXTUREMAN->IsTextureRegistered( Sprite::SongBannerTexture(g_sBannerPath) ) )
|
|
|
|
|
m_BackgroundLoader.CacheFile( g_sBannerPath );
|
|
|
|
|
|
2004-09-08 02:53:54 +00:00
|
|
|
g_bBannerWaiting = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-11-25 18:25:43 +00:00
|
|
|
|
2003-07-15 03:21:50 +00:00
|
|
|
// Don't stop music if it's already playing the right file.
|
2004-09-08 02:53:54 +00:00
|
|
|
g_bSampleMusicWaiting = false;
|
|
|
|
|
if( !m_MusicWheel.IsRouletting() && SOUND->GetMusicPath() != m_sSampleMusicToPlay )
|
2003-07-15 03:21:50 +00:00
|
|
|
{
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->StopMusic();
|
2004-09-08 02:53:54 +00:00
|
|
|
if( !m_sSampleMusicToPlay.empty() )
|
|
|
|
|
g_bSampleMusicWaiting = true;
|
2003-07-15 03:21:50 +00:00
|
|
|
}
|
|
|
|
|
|
2004-09-08 02:53:54 +00:00
|
|
|
g_StartedLoadingAt.Touch();
|
|
|
|
|
|
2005-03-11 02:48:38 +00:00
|
|
|
if( (int) m_Artists.size() > MAX_COURSE_ENTRIES_BEFORE_VARIOUS )
|
2005-03-10 23:57:53 +00:00
|
|
|
{
|
|
|
|
|
m_Artists.clear();
|
|
|
|
|
m_AltArtists.clear();
|
|
|
|
|
m_Artists.push_back( "Various Artists" );
|
|
|
|
|
m_AltArtists.push_back( "Various Artists" );
|
|
|
|
|
}
|
|
|
|
|
|
2003-11-17 02:52:03 +00:00
|
|
|
m_Artist.SetTips( m_Artists, m_AltArtists );
|
2003-07-15 03:21:50 +00:00
|
|
|
|
2005-03-29 21:30:24 +00:00
|
|
|
vector<PlayerNumber> vpns;
|
2004-06-03 08:22:02 +00:00
|
|
|
FOREACH_HumanPlayer( p )
|
2005-03-29 21:30:24 +00:00
|
|
|
vpns.push_back( p );
|
|
|
|
|
|
|
|
|
|
if( GAMESTATE->m_pCurCourse )
|
|
|
|
|
AfterTrailChange( vpns );
|
|
|
|
|
else
|
|
|
|
|
AfterStepsChange( vpns );
|
2003-01-02 03:00:53 +00:00
|
|
|
|
2004-06-03 21:41:54 +00:00
|
|
|
switch( m_MusicWheel.GetSelectedType() )
|
|
|
|
|
{
|
|
|
|
|
case TYPE_COURSE:
|
2005-03-30 07:39:41 +00:00
|
|
|
if( SHOW_COURSE_CONTENTS )
|
|
|
|
|
m_CourseContents.TweenInAfterChangedCourse();
|
2004-06-03 21:41:54 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-08-20 21:00:56 +00:00
|
|
|
void ScreenSelectMusic::SortOrderChanged()
|
|
|
|
|
{
|
2005-01-29 20:46:08 +00:00
|
|
|
if( SHOW_PANES )
|
|
|
|
|
FOREACH_HumanPlayer(pn)
|
2005-04-29 08:18:44 +00:00
|
|
|
m_PaneDisplay[pn].SetFromGameState( GAMESTATE->m_SortOrder );
|
2002-08-20 21:00:56 +00:00
|
|
|
|
2005-04-29 08:18:44 +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_MODE_MENU:
|
|
|
|
|
// do nothing
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
if( SHOW_DIFFICULTY_LIST )
|
|
|
|
|
m_DifficultyList.Show();
|
|
|
|
|
break;
|
|
|
|
|
}
|
2002-08-20 21:00:56 +00:00
|
|
|
}
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2005-07-12 05:52:52 +00:00
|
|
|
// lua start
|
|
|
|
|
#include "LuaBinding.h"
|
|
|
|
|
|
|
|
|
|
class LunaScreenSelectMusic: public Luna<ScreenSelectMusic>
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
LunaScreenSelectMusic() { LUA->Register( Register ); }
|
|
|
|
|
|
|
|
|
|
static int GetGoToOptions( T* p, lua_State *L ) { lua_pushboolean( L, p->GetGoToOptions() ); return 1; }
|
|
|
|
|
static void Register( Lua *L )
|
|
|
|
|
{
|
2005-09-10 02:47:04 +00:00
|
|
|
ADD_METHOD( GetGoToOptions );
|
|
|
|
|
|
2005-07-12 05:52:52 +00:00
|
|
|
Luna<T>::Register( L );
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
LUA_REGISTER_DERIVED_CLASS( ScreenSelectMusic, ScreenWithMenuElements )
|
|
|
|
|
// lua end
|
|
|
|
|
|
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.
|
|
|
|
|
*/
|