Started work on the Banner Scrolling List style Music Select (as used by pump/ez2/para/3ddx/bm/3rd mix and older). It's far from finished, but is a start, also updated some para graphics. This compiles in VC6. the Project will compile it all, as for any other makefiles kicking around (like unix makefiles) I dont know whats what so these have not been updated. Thanks.

This commit is contained in:
Andrew Livy
2002-12-05 03:49:46 +00:00
parent 29ed126829
commit ceb2fc0c25
12 changed files with 227 additions and 781 deletions
+16 -5
View File
@@ -3,13 +3,24 @@ X denotes task complete or no longer required to do.
- denotes task to do, but also being worked upon by other dev. - denotes task to do, but also being worked upon by other dev.
H denotes task on hold. H denotes task on hold.
TODO As of: 04:46:PM 27/11/02
* Systems Programming Assignment
* Integrating Assignment 2
* Add Scoreboard Initials Entry Frontend
TODO As of: 01:30:PM 13/11/02
* Work on 3DDX Support
* Software Engineering Assignment
X Operating Systems Assignment
* Object Oriented Design Assignment
TODO As of: 07:30:PM 28/10/02 TODO As of: 07:30:PM 28/10/02
* Networking Assignment X Networking Assignment
* Integrating Assignment 1 (nearly finished!) X Integrating Assignment 1
* Update Menu Graphics for Para * Update Menu Graphics for Para
* Update Menu Graphics for Ez2 H Update Menu Graphics for Ez2
* Finish The PUMP Graphics H Finish The PUMP Graphics
* Work on Beatmania Support * Work on Beatmania Support
TODO As of: 07:47:PM 12/09/02 TODO As of: 07:47:PM 12/09/02
@@ -30,7 +41,7 @@ X Fix Ez2dancer SelectPlayer Theme Metrics
X Try to fix ez2dancer select style. X Try to fix ez2dancer select style.
H Create Ez2dancer style Gameover by making some Gameover Metrics. H Create Ez2dancer style Gameover by making some Gameover Metrics.
H Create Ez2dancer style End Scroll, possibly new class, possibly just metric changes. H Create Ez2dancer style End Scroll, possibly new class, possibly just metric changes.
H Create Ez2dancer style song select. * Create Ez2dancer style song select.
H Add Scoreboard System (longterm project) H Add Scoreboard System (longterm project)
H Create some kind of metrics so that Ez2dancer may have extra stage the way it should H Create some kind of metrics so that Ez2dancer may have extra stage the way it should
X Fix Ez2dancer type stage screens X Fix Ez2dancer type stage screens
+1 -1
View File
@@ -97,7 +97,7 @@ void BGAnimationLayer::LoadFromAniLayerFile( CString sPath, CString sSongBGPath
const CString EFFECT_STRING[NUM_EFFECTS] = { const CString EFFECT_STRING[NUM_EFFECTS] = {
"center", "center",
"stretchstill", "stretchstill",
"scretchscrollleft", "stretchscrollleft",
"stretchscrollright", "stretchscrollright",
"stretchscrollup", "stretchscrollup",
"stretchscrolldown", "stretchscrolldown",
+89
View File
@@ -0,0 +1,89 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: MusicBannerWheel
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Andrew Livy
-----------------------------------------------------------------------------
*/
#include "MusicBannerWheel.h"
#include "RageUtil.h"
#include "GameState.h"
#include "PrefsManager.h"
#include "SongManager.h"
#include "ThemeManager.h"
#include "RageMusic.h"
#define MAXBANNERS 5
#define BANNERSPACING 200
MusicBannerWheel::MusicBannerWheel()
{
currentPos=0;
m_ScrollingList.SetXY( 0, 0 );
m_ScrollingList.SetSpacing( BANNERSPACING );
this->AddChild( &m_ScrollingList );
SetNewPos(currentPos);
PlayMusicSample();
}
void MusicBannerWheel::SetNewPos(int NewPos)
{
CArray<Song*, Song*> arraySongs = SONGMAN->m_pSongs;
Song* pSong;
// TODO: OPTIMIZE THIS. (SO IT LOADS THE ENTIRE SONG LIST)
CStringArray asGraphicPaths;
for( unsigned j=0; j<arraySongs.size() && j < MAXBANNERS; j++ )
{
pSong = arraySongs[j];
if( pSong == NULL ) asGraphicPaths.push_back(THEME->GetPathTo("Graphics","fallback banner"));
else if (pSong->HasBanner()) asGraphicPaths.push_back(pSong->GetBannerPath());
else if (PREFSMAN->m_bUseBGIfNoBanner && pSong->HasBackground() ) asGraphicPaths.push_back(pSong->GetBannerPath());
else asGraphicPaths.push_back(THEME->GetPathTo("Graphics","fallback banner"));
}
m_ScrollingList.Load( asGraphicPaths );
}
Song* MusicBannerWheel::GetSelectedSong()
{
CArray<Song*, Song*> arraySongs = SONGMAN->m_pSongs;
Song* pSong;
pSong=arraySongs[m_ScrollingList.GetSelection()];
return(pSong);
}
void MusicBannerWheel::PlayMusicSample()
{
Song* pSong = GetSelectedSong();
if( pSong && pSong->HasMusic() )
{
MUSIC->Stop();
MUSIC->Load( pSong->GetMusicPath() );
MUSIC->Play( true, pSong->m_fMusicSampleStartSeconds, pSong->m_fMusicSampleLengthSeconds );
}
}
void MusicBannerWheel::BannersLeft()
{
m_ScrollingList.Left();
PlayMusicSample();
}
void MusicBannerWheel::BannersRight()
{
m_ScrollingList.Right();
PlayMusicSample();
}
MusicBannerWheel::~MusicBannerWheel()
{
}
+35
View File
@@ -0,0 +1,35 @@
#ifndef MUSICBANNERWHEEL_H
#define MUSICBANNERWHEEL_H
/*
-----------------------------------------------------------------------------
Class: MusicBannerWheel
Desc: A wheel with song banners used in the Select Music screen.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Andrew Livy
-----------------------------------------------------------------------------
*/
#include "ActorFrame.h"
#include "Banner.h"
#include "Sprite.h"
#include "ScrollingList.h"
class MusicBannerWheel : public ActorFrame
{
public:
MusicBannerWheel();
~MusicBannerWheel();
void BannersLeft();
void BannersRight();
Song* GetSelectedSong();
private:
void SetNewPos(int NewPos);
void PlayMusicSample();
ScrollingList m_ScrollingList;
int currentPos;
};
#endif
+58 -697
View File
@@ -1,302 +1,79 @@
#include "stdafx.h" #include "stdafx.h"
/* /*
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Class: ScreenEz2SelectMusic File: ScreenSandbox.h
Desc: See header. Desc: Area for testing.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford Chris Danford
Andrew Livy Glenn Maynard (OpenGL Code)
Lance Gilbert (OpenGL/Usability Modifications)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
/* OKAY!!! #include "stdafx.h"
Sod it!
I'll do this when you guys feel that it's OKAY to do it!!!
- ANDY
*/
/*
#include "ScreenEz2SelectMusic.h" #include "ScreenEz2SelectMusic.h"
#include "RageDisplay.h"
#include <math.h>
#include "SDL.h"
#include "SDL_opengl.h"
#include "ScreenSandbox.h"
#include "ScreenManager.h" #include "ScreenManager.h"
#include "PrefsManager.h"
#include "SongManager.h"
#include "GameManager.h"
#include "RageMusic.h" #include "RageMusic.h"
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "RageLog.h" #include "ThemeManager.h"
#include "InputMapper.h"
#include "InputQueue.h"
#include "AnnouncerManager.h"
#include "InputMapper.h"
#include "GameState.h"
#include "CodeDetector.h"
#define BANNER_X THEME->GetMetricF("ScreenEz2SelectMusic","BannerX")
#define BANNER_Y THEME->GetMetricF("ScreenEz2SelectMusic","BannerY")
#define BANNER_WIDTH THEME->GetMetricF("ScreenEz2SelectMusic","BannerWidth")
#define BANNER_HEIGHT THEME->GetMetricF("ScreenEz2SelectMusic","BannerHeight")
#define STAGE_X THEME->GetMetricF("ScreenEz2SelectMusic","StageX")
#define STAGE_Y THEME->GetMetricF("ScreenEz2SelectMusic","StageY")
#define STAGE_ZOOM THEME->GetMetricF("ScreenEz2SelectMusic","StageZoom")
#define SCORE_FRAME_X( p ) THEME->GetMetricF("ScreenEz2SelectMusic",ssprintf("ScoreFrameP%dX",p+1))
#define SCORE_FRAME_Y( p ) THEME->GetMetricF("ScreenEz2SelectMusic",ssprintf("ScoreFrameP%dY",p+1))
#define SCORE_X( p ) THEME->GetMetricF("ScreenEz2SelectMusic",ssprintf("ScoreP%dX",p+1))
#define SCORE_Y( p ) THEME->GetMetricF("ScreenEz2SelectMusic",ssprintf("ScoreP%dY",p+1))
#define METER_FRAME_X( p ) THEME->GetMetricF("ScreenEz2SelectMusic",ssprintf("MeterFrameP%dX",p+1))
#define METER_FRAME_Y( p ) THEME->GetMetricF("ScreenEz2SelectMusic",ssprintf("MeterFrameP%dY",p+1))
#define METER_X( p ) THEME->GetMetricF("ScreenEz2SelectMusic",ssprintf("MeterP%dX",p+1))
#define METER_Y( p ) THEME->GetMetricF("ScreenEz2SelectMusic",ssprintf("MeterP%dY",p+1))
#define WHEEL_X THEME->GetMetricF("ScreenEz2SelectMusic","WheelX")
#define WHEEL_Y THEME->GetMetricF("ScreenEz2SelectMusic","WheelY")
#define HELP_TEXT THEME->GetMetric("ScreenEz2SelectMusic","HelpText")
#define TIMER_SECONDS THEME->GetMetricI("ScreenEz2SelectMusic","TimerSeconds")
#define SCORE_CONNECTED_TO_MUSIC_WHEEL THEME->GetMetricB("ScreenEz2SelectMusic","ScoreConnectedToMusicWheel")
const float TWEEN_TIME = 0.5f;
const float SIDE_BANNER_ANGLE = 600.0f;
const float SIDE_BANNER_ZOOM = 340.0f;
const float SIDE_BANNER_SPACING = 150.0f;
const ScreenMessage SM_GoToPrevScreen = ScreenMessage(SM_User+1);
const ScreenMessage SM_GoToNextScreen = ScreenMessage(SM_User+2);
ScreenEz2SelectMusic::ScreenEz2SelectMusic() ScreenEz2SelectMusic::ScreenEz2SelectMusic()
{ {
LOG->Trace( "ScreenEz2SelectMusic::ScreenEz2SelectMusic()" ); MUSIC->Stop();
m_MusicBannerWheel.SetX(CENTER_X);
m_MusicBannerWheel.SetY(CENTER_Y);
CodeDetector::RefreshCacheItems(); this->AddChild( &m_MusicBannerWheel );
int p;
m_Menu.Load(
THEME->GetPathTo("Graphics","select music background"),
THEME->GetPathTo("Graphics","select music top edge"),
HELP_TEXT, true, true, TIMER_SECONDS
);
this->AddChild( &m_Menu );
// these guys get loaded SetSong and TweenToSong
m_Banner.SetXY( BANNER_X, BANNER_Y );
m_Banner.SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT );
this->AddChild( &m_Banner );
// these guys get loaded SetSong and TweenToSong
m_BannerNext.SetXY( BANNER_X+220, BANNER_Y );
m_BannerNext.SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT );
// this->AddChild( &m_BannerNext );
// these guys get loaded SetSong and TweenToSong
m_BannerPrevious.SetXY( BANNER_X-220, BANNER_Y );
m_BannerPrevious.SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT );
// this->AddChild( &m_BannerPrevious );
m_MusicWheel.SetXY( WHEEL_X, WHEEL_Y );
this->AddChild( &m_MusicWheel );
for( p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) )
continue; // skip
m_sprHighScoreFrame[p].Load( THEME->GetPathTo("Graphics","select music score frame") );
m_sprHighScoreFrame[p].StopAnimating();
m_sprHighScoreFrame[p].SetState( p );
m_sprHighScoreFrame[p].SetXY( SCORE_X(p), SCORE_Y(p) );
this->AddChild( &m_sprHighScoreFrame[p] );
m_HighScore[p].SetXY( SCORE_X(p), SCORE_Y(p) );
m_HighScore[p].SetZoom( 0.6f );
m_HighScore[p].SetDiffuse( PlayerToColor(p) );
this->AddChild( &m_HighScore[p] );
} }
void ScreenEz2SelectMusic::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
m_textHoldForOptions.LoadFromFont( THEME->GetPathTo("Fonts","select music hold") );
m_textHoldForOptions.SetXY( CENTER_X, CENTER_Y );
m_textHoldForOptions.SetText( "press START again for options" );
m_textHoldForOptions.SetZoom( 1 );
m_textHoldForOptions.SetZoomY( 0 );
m_textHoldForOptions.SetDiffuse( RageColor(1,1,1,0) );
m_textHoldForOptions.SetZ( 2 );
this->AddChild( &m_textHoldForOptions );
m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") );
m_soundChangeNotes.Load( THEME->GetPathTo("Sounds","select music change notes") );
m_soundOptionsChange.Load( THEME->GetPathTo("Sounds","select music change options") );
m_soundLocked.Load( THEME->GetPathTo("Sounds","select music wheel locked") );
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("select music intro") );
m_bMadeChoice = false;
m_bGoToOptions = false;
UpdateOptionsDisplays();
AfterMusicChange();
TweenOnScreen();
m_Menu.TweenOnScreenFromMenu( SM_None );
}
ScreenEz2SelectMusic::~ScreenEz2SelectMusic()
{ {
LOG->Trace( "ScreenEz2SelectMusic::~ScreenEz2SelectMusic()" ); if( type != IET_FIRST_PRESS )
return; // ignore
switch( DeviceI.device)
{
case DEVICE_KEYBOARD:
switch( DeviceI.button )
{
case SDLK_LEFT:
m_MusicBannerWheel.BannersLeft();
break;
case SDLK_RIGHT:
m_MusicBannerWheel.BannersRight();
break;
case SDLK_UP:
break;
case SDLK_DOWN:
break;
case SDLK_t:
{
SDL_Event *event;
event = (SDL_Event *) malloc(sizeof(event));
event->type = SDL_QUIT;
SDL_PushEvent(event);
}
case SDLK_ESCAPE:
{
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
}
}
} }
void ScreenEz2SelectMusic::DrawPrimitives()
{
m_Menu.DrawBottomLayer();
Screen::DrawPrimitives();
m_Menu.DrawTopLayer();
RageMatrix matOldView, matOldProj;
// save old view and projection
DISPLAY->GetViewTransform( &matOldView );
DISPLAY->GetProjectionTransform( &matOldProj );
// construct view and project matrix
RageMatrix matNewView;
RageMatrixLookAtLH(
&matNewView,
&RageVector3( CENTER_X+SIDE_BANNER_ANGLE, CENTER_Y, SIDE_BANNER_ZOOM ),
&RageVector3( CENTER_X-SIDE_BANNER_SPACING, CENTER_Y, 0.0f ),
&RageVector3( 0.0f, -1.0f, 0.0f )
);
DISPLAY->SetViewTransform( &matNewView );
RageMatrix matNewProj;
RageMatrixPerspectiveFovLH( &matNewProj, D3DX_PI/4.0f, SCREEN_WIDTH/(float)SCREEN_HEIGHT, 0.0f, 1000.0f );
DISPLAY->SetProjectionTransform( &matNewProj );
// }
m_BannerNext.Draw();
RageMatrixLookAtLH(
&matNewView,
&RageVector3( CENTER_X-SIDE_BANNER_ANGLE, CENTER_Y, SIDE_BANNER_ZOOM ),
&RageVector3( CENTER_X+SIDE_BANNER_SPACING, CENTER_Y, 0.0f ),
&RageVector3( 0.0f, -1.0f, 0.0f )
);
DISPLAY->SetViewTransform( &matNewView );
RageMatrixPerspectiveFovLH( &matNewProj, D3DX_PI/4.0f, SCREEN_WIDTH/(float)SCREEN_HEIGHT, 0.0f, 1000.0f );
DISPLAY->SetProjectionTransform( &matNewProj );
m_BannerPrevious.Draw();
// restore old view and projection
DISPLAY->SetViewTransform( &matOldView );
DISPLAY->SetProjectionTransform( &matOldProj );
}
void ScreenEz2SelectMusic::TweenOnScreen()
{
int p;
for( p=0; p<NUM_PLAYERS; p++ )
{
m_sprHighScoreFrame[p].FadeOn( 0, SCORE_CONNECTED_TO_MUSIC_WHEEL?"accelerate right":"accelerate left", TWEEN_TIME );
m_HighScore[p].FadeOn( 0, SCORE_CONNECTED_TO_MUSIC_WHEEL?"accelerate right":"accelerate left", TWEEN_TIME );
}
m_MusicWheel.TweenOnScreen();
}
void ScreenEz2SelectMusic::TweenOffScreen()
{
int i;
m_sprBannerFrame.FadeOff( 0, "bounce left", TWEEN_TIME );
m_Banner.FadeOff( 0, "bounce left", TWEEN_TIME );
m_BPMDisplay.FadeOff( 0, "bounce left", TWEEN_TIME );
m_textStage.FadeOff( 0, "bounce left", TWEEN_TIME );
m_sprCDTitle.FadeOff( 0, "bounce left", TWEEN_TIME );
for( int p=0; p<NUM_PLAYERS; p++ )
{
m_sprDifficultyFrame[p].FadeOff( 0, "fade", TWEEN_TIME );
m_sprMeterFrame[p].FadeOff( 0, "fade", TWEEN_TIME );
}
m_GrooveRadar.TweenOffScreen();
m_textSongOptions.FadeOff( 0, "fade", TWEEN_TIME );
for( p=0; p<NUM_PLAYERS; p++ )
{
m_OptionIconRow[p].FadeOff( 0, "foldy", TWEEN_TIME );
// m_textPlayerOptions[p].FadeOff( 0, "fade", TWEEN_TIME );
m_DifficultyIcon[p].FadeOff( 0, "foldy", TWEEN_TIME );
m_FootMeter[p].FadeOff( 0, "foldy", TWEEN_TIME );
}
m_MusicSortDisplay.FadeOff( 0, "fade", TWEEN_TIME );
CArray<Actor*,Actor*> apActorsInScore;
for( p=0; p<NUM_PLAYERS; p++ )
{
apActorsInScore.push_back( &m_sprHighScoreFrame[p] );
apActorsInScore.push_back( &m_HighScore[p] );
}
for( i=0; i<apActorsInScore.size(); i++ )
{
apActorsInScore[i]->BeginTweening( TWEEN_TIME, TWEEN_BIAS_END );
apActorsInScore[i]->SetTweenX( SCORE_CONNECTED_TO_MUSIC_WHEEL ? apActorsInScore[i]->GetX()+400 : apActorsInScore[i]->GetX()-400 );
}
m_MusicWheel.TweenOffScreen();
}
void ScreenEz2SelectMusic::TweenScoreOnAndOffAfterChangeSort()
{
if( !SCORE_CONNECTED_TO_MUSIC_WHEEL )
return; // do nothing
CArray<Actor*,Actor*> apActorsInScore;
for( int p=0; p<NUM_PLAYERS; p++ )
{
apActorsInScore.push_back( &m_sprHighScoreFrame[p] );
apActorsInScore.push_back( &m_HighScore[p] );
}
for( unsigned i=0; i<apActorsInScore.size(); i++ )
{
apActorsInScore[i]->StopTweening();
float fOriginalX = apActorsInScore[i]->GetX();
apActorsInScore[i]->BeginTweening( TWEEN_TIME, TWEEN_BIAS_END ); // tween off screen
apActorsInScore[i]->SetTweenX( fOriginalX+400 );
apActorsInScore[i]->BeginTweening( 0.5f ); // sleep
apActorsInScore[i]->BeginTweening( 1, TWEEN_BIAS_BEGIN ); // tween back on screen
apActorsInScore[i]->SetTweenX( fOriginalX );
}
} }
void ScreenEz2SelectMusic::Update( float fDeltaTime ) void ScreenEz2SelectMusic::Update( float fDeltaTime )
@@ -304,442 +81,26 @@ void ScreenEz2SelectMusic::Update( float fDeltaTime )
Screen::Update( fDeltaTime ); Screen::Update( fDeltaTime );
} }
void ScreenEz2SelectMusic::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) void ScreenEz2SelectMusic::DrawPrimitives()
{ {
LOG->Trace( "ScreenEz2SelectMusic::Input()" ); // m_Menu.DrawBottomLayer();
Screen::DrawPrimitives();
if( type == IET_RELEASE ) return; // don't care // m_Menu.DrawTopLayer();
if( m_Menu.IsClosing() ) return; // ignore
if( !GameI.IsValid() ) return; // don't care
if( m_bMadeChoice && !m_bGoToOptions && MenuI.IsValid() && MenuI.button == MENU_BUTTON_START && !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() )
{
m_bGoToOptions = true;
m_textHoldForOptions.SetText( "Entering Options..." );
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","menu start") );
return;
}
if( m_bMadeChoice )
return;
PlayerNumber pn = GAMESTATE->GetCurrentStyleDef()->ControllerToPlayerNumber( GameI.controller );
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;
}
if( CodeDetector::EnteredNextSort(GameI.controller) )
{
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
m_soundLocked.Play();
else
if( m_MusicWheel.NextSort() )
{
MUSIC->Stop();
m_MusicSortDisplay.BeginTweening( 0.3f );
m_MusicSortDisplay.SetTweenDiffuse( RageColor(1,1,1,0) );
TweenScoreOnAndOffAfterChangeSort();
}
return;
}
if( CodeDetector::DetectAndAdjustOptions(GameI.controller) )
{
m_soundOptionsChange.Play();
UpdateOptionsDisplays();
return;
}
Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default input handler
}
void ScreenEz2SelectMusic::EasierDifficulty( PlayerNumber pn )
{
LOG->Trace( "ScreenEz2SelectMusic::EasierDifficulty( %d )", pn );
if( !GAMESTATE->IsPlayerEnabled(pn) )
return;
if( m_arrayNotes.empty() )
return;
if( m_iSelection[pn] == 0 )
return;
m_iSelection[pn]--;
// the user explicity switched difficulties. Update the preferred difficulty
GAMESTATE->m_PreferredDifficultyClass[pn] = m_arrayNotes[ m_iSelection[pn] ]->m_DifficultyClass;
m_soundChangeNotes.Play();
AfterNotesChange( pn );
}
void ScreenEz2SelectMusic::HarderDifficulty( PlayerNumber pn )
{
LOG->Trace( "ScreenEz2SelectMusic::HarderDifficulty( %d )", pn );
if( !GAMESTATE->IsPlayerEnabled(pn) )
return;
if( m_arrayNotes.empty() )
return;
if( m_iSelection[pn] == m_arrayNotes.size()-1 )
return;
m_iSelection[pn]++;
// the user explicity switched difficulties. Update the preferred difficulty
GAMESTATE->m_PreferredDifficultyClass[pn] = m_arrayNotes[ m_iSelection[pn] ]->m_DifficultyClass;
m_soundChangeNotes.Play();
AfterNotesChange( pn );
} }
void ScreenEz2SelectMusic::HandleScreenMessage( const ScreenMessage SM ) void ScreenEz2SelectMusic::HandleScreenMessage( const ScreenMessage SM )
{ {
Screen::HandleScreenMessage( SM ); Screen::HandleScreenMessage( SM );
switch( SM ) switch( SM )
{ {
case SM_MenuTimer: case SM_DoneClosingWipingLeft:
if( m_MusicWheel.IsRouletting() )
{
MenuStart(PLAYER_INVALID);
m_Menu.SetTimer( 15 );
}
else if( m_MusicWheel.GetSelectedType() != TYPE_SONG )
{
m_MusicWheel.StartRoulette();
m_Menu.SetTimer( 15 );
}
else
{
MenuStart(PLAYER_INVALID);
}
break; break;
case SM_GoToPrevScreen: case SM_DoneClosingWipingRight:
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
break; break;
case SM_GoToNextScreen: case SM_DoneOpeningWipingLeft:
if( m_bGoToOptions )
{
SCREENMAN->SetNewScreen( "ScreenPlayerOptions" );
}
else
{
MUSIC->Stop();
SCREENMAN->SetNewScreen( "ScreenStage" );
}
break; break;
case SM_PlaySongSample: case SM_DoneOpeningWipingRight:
PlayMusicSample();
break;
case SM_SongChanged:
AfterMusicChange();
break;
case SM_SortOrderChanged:
SortOrderChanged();
break; break;
} }
} }
void ScreenEz2SelectMusic::MenuLeft( PlayerNumber pn, const InputEventType type )
{
if( type >= IET_SLOW_REPEAT && INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_RIGHT) ) )
return; // ignore
if( ! m_MusicWheel.WheelIsLocked() )
MUSIC->Stop();
m_MusicWheel.PrevMusic();
}
void ScreenEz2SelectMusic::MenuRight( PlayerNumber pn, const InputEventType type )
{
if( type >= IET_SLOW_REPEAT && INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_LEFT) ) )
return; // ignore
if( ! m_MusicWheel.WheelIsLocked() )
MUSIC->Stop();
m_MusicWheel.NextMusic();
}
void ScreenEz2SelectMusic::MenuStart( PlayerNumber pn )
{
if( pn != PLAYER_INVALID &&
INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_LEFT) ) &&
INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_RIGHT) ) )
{
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
m_soundLocked.Play();
else
{
if( m_MusicWheel.NextSort() )
{
MUSIC->Stop();
m_MusicSortDisplay.BeginTweening( 0.3f );
m_MusicSortDisplay.SetTweenDiffuse( RageColor(1,1,1,0) );
TweenScoreOnAndOffAfterChangeSort();
}
}
return;
}
// this needs to check whether valid Notes are selected!
bool bResult = m_MusicWheel.Select();
if( !bResult )
{
/* why do this? breaks tabs and roulette -glenn */
// if( pn != PLAYER_INVALID )
// this->SendScreenMessage( SM_MenuTimer, 1 ); // re-throw a timer message
/* }
else // if !bResult
{
// a song was selected
switch( m_MusicWheel.GetSelectedType() )
{
case TYPE_SONG:
{
if( !m_MusicWheel.GetSelectedSong()->HasMusic() )
{
/* TODO: gray these out.
*
* XXX: also, make sure they're not selected by roulette */
/* SCREENMAN->Prompt( SM_None, "ERROR:\n \nThis song does not have a music file\n and cannot be played." );
return;
}
bool bIsNew = m_MusicWheel.GetSelectedSong()->IsNew();
bool bIsHard = false;
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
continue; // skip
if( GAMESTATE->m_pCurNotes[p] && GAMESTATE->m_pCurNotes[p]->m_iMeter >= 9 )
bIsHard = true;
}
if( bIsNew )
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("select music comment new") );
else if( bIsHard )
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("select music comment hard") );
else
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("select music comment general") );
TweenOffScreen();
m_bMadeChoice = true;
m_soundSelect.Play();
if( !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() )
{
// show "hold START for options"
m_textHoldForOptions.SetDiffuse( RageColor(1,1,1,0) );
m_textHoldForOptions.BeginTweening( 0.25f ); // fade in
m_textHoldForOptions.SetTweenZoomY( 1 );
m_textHoldForOptions.SetTweenDiffuse( RageColor(1,1,1,1) );
m_textHoldForOptions.BeginTweening( 2.0f ); // sleep
m_textHoldForOptions.BeginTweening( 0.25f ); // fade out
m_textHoldForOptions.SetTweenDiffuse( RageColor(1,1,1,0) );
m_textHoldForOptions.SetTweenZoomY( 0 );
}
m_Menu.TweenOffScreenToBlack( SM_None, false );
m_Menu.StopTimer();
this->SendScreenMessage( SM_GoToNextScreen, 2.5f );
}
break;
case TYPE_SECTION:
break;
case TYPE_ROULETTE:
break;
}
}
}
void ScreenEz2SelectMusic::MenuBack( PlayerNumber pn )
{
MUSIC->Stop();
m_Menu.TweenOffScreenToBlack( SM_GoToPrevScreen, true );
}
void ScreenEz2SelectMusic::AfterNotesChange( PlayerNumber pn )
{
if( !GAMESTATE->IsPlayerEnabled(pn) )
return;
m_iSelection[pn] = clamp( m_iSelection[pn], 0, m_arrayNotes.size()-1 ); // bounds clamping
Notes* pNotes = m_arrayNotes.empty()? NULL:m_arrayNotes[m_iSelection[pn]];
GAMESTATE->m_pCurNotes[pn] = pNotes;
// m_BPMDisplay.SetZoomY( 0 );
// m_BPMDisplay.BeginTweening( 0.2f );
// m_BPMDisplay.SetTweenZoomY( 1.2f );
DifficultyClass dc = GAMESTATE->m_PreferredDifficultyClass[pn];
Song* pSong = GAMESTATE->m_pCurSong;
Notes* m_pNotes = GAMESTATE->m_pCurNotes[pn];
if( m_pNotes )
m_HighScore[pn].SetScore( (float)m_pNotes->m_iTopScore );
m_DifficultyIcon[pn].SetFromNotes( pNotes );
m_FootMeter[pn].SetFromNotes( pNotes );
m_GrooveRadar.SetFromNotes( pn, pNotes );
m_MusicWheel.NotesChanged( pn );
}
void ScreenEz2SelectMusic::AfterMusicChange()
{
m_Menu.StallTimer();
Song* pSong = m_MusicWheel.GetSelectedSong();
GAMESTATE->m_pCurSong = pSong;
m_arrayNotes.clear();
switch( m_MusicWheel.GetSelectedType() )
{
case TYPE_SECTION:
{
CString sGroup = m_MusicWheel.GetSelectedSection();
for( int p=0; p<NUM_PLAYERS; p++ )
{
m_iSelection[p] = -1;
}
m_Banner.SetFromGroup( sGroup ); // if this isn't a group, it'll default to the fallback banner
m_BannerNext.SetFromGroup( sGroup ); // if this isn't a group, it'll default to the fallback banner
m_BannerPrevious.SetFromGroup( sGroup ); // if this isn't a group, it'll default to the fallback banner
m_BPMDisplay.SetBPMRange( 0, 0 );
m_sprCDTitle.UnloadTexture();
}
break;
case TYPE_SONG:
{
pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef(), PLAYER_1, m_arrayNotes );
SortNotesArrayByDifficulty( m_arrayNotes );
m_Banner.SetFromSong( pSong );
m_BannerNext.SetFromSong( pSong );
m_BannerPrevious.SetFromSong( pSong );
float fMinBPM, fMaxBPM;
pSong->GetMinMaxBPM( fMinBPM, fMaxBPM );
m_BPMDisplay.SetBPMRange( fMinBPM, fMaxBPM );
if( pSong->HasCDTitle() )
m_sprCDTitle.Load( pSong->GetCDTitlePath() );
else
m_sprCDTitle.Load( THEME->GetPathTo("Graphics","fallback cd title") );
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsPlayerEnabled( PlayerNumber(p) ) )
continue;
for( int i=0; i<m_arrayNotes.size(); i++ )
if( m_arrayNotes[i]->m_DifficultyClass == GAMESTATE->m_PreferredDifficultyClass[p] )
m_iSelection[p] = i;
m_iSelection[p] = clamp( m_iSelection[p], 0, m_arrayNotes.size() ) ;
}
}
break;
case TYPE_ROULETTE:
m_Banner.SetRoulette();
m_BannerNext.SetRoulette();
m_BannerPrevious.SetRoulette();
m_BPMDisplay.SetBPMRange( 0, 0 );
m_sprCDTitle.UnloadTexture();
break;
}
for( int p=0; p<NUM_PLAYERS; p++ )
{
AfterNotesChange( (PlayerNumber)p );
}
}
void ScreenEz2SelectMusic::PlayMusicSample()
{
//LOG->Trace( "ScreenSelectSong::PlaySONGample()" );
Song* pSong = m_MusicWheel.GetSelectedSong();
if( pSong )
{
MUSIC->Stop();
MUSIC->Load( pSong->GetMusicPath() );
MUSIC->Play( true, pSong->m_fMusicSampleStartSeconds, pSong->m_fMusicSampleLengthSeconds );
}
else
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","select music music") );
}
void ScreenEz2SelectMusic::UpdateOptionsDisplays()
{
// m_OptionIcons.Load( GAMESTATE->m_PlayerOptions, &GAMESTATE->m_SongOptions );
// m_PlayerOptionIcons.Refresh();
// for( int p=0; p<NUM_PLAYERS; p++ )
// {
// m_OptionIconRow[p].Refresh( (PlayerNumber)p );
//
// if( GAMESTATE->IsPlayerEnabled(p) )
// {
// CString s = GAMESTATE->m_PlayerOptions[p].GetString();
// s.Replace( ", ", "\n" );
// m_textPlayerOptions[p].SetText( s );
// }
// }
// CString s = GAMESTATE->m_SongOptions.GetString();
// s.Replace( ", ", "\n" );
// m_textSongOptions.SetText( s );
}
void ScreenEz2SelectMusic::SortOrderChanged()
{
m_MusicSortDisplay.SetState( GAMESTATE->m_SongSortOrder );
// tween music sort on screen
// m_MusicSortDisplay.SetEffectGlowing();
m_MusicSortDisplay.BeginTweening( 0.3f );
m_MusicSortDisplay.SetTweenDiffuse( RageColor(1,1,1,1) );
}
*/
+12 -71
View File
@@ -1,98 +1,39 @@
#ifndef SCREENEZ2SELECTMUSIC_H
#define SCREENEZ2SELECTMUSIC_H
/* /*
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Class: ScreenEz2SelectMusic Class: ScreenSandbox
Desc: The screen in PLAY_MODE_ARCADE where you choose a Song and Notes. Desc: Area for testing.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford Chris Danford
Andrew Livy
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
/*
#include "Screen.h" #include "Screen.h"
#include "Sprite.h" #include "Sprite.h"
#include "BitmapText.h" #include "BitmapText.h"
#include "RandomStream.h" #include "TransitionStarWipe.h"
#include "GameConstantsAndTypes.h"
#include "MusicWheel.h"
#include "Banner.h"
#include "FadingBanner.h"
#include "BPMDisplay.h"
#include "MenuElements.h" #include "MenuElements.h"
#include "GrooveRadar.h" #include "TipDisplay.h"
#include "DifficultyIcon.h" #include "RageSoundStream.h"
#include "FootMeter.h" #include "MusicBannerWheel.h"
#include "OptionIconRow.h"
class ScreenEz2SelectMusic : public Screen class ScreenEz2SelectMusic : public Screen
{ {
public: public:
ScreenEz2SelectMusic(); ScreenEz2SelectMusic();
virtual ~ScreenEz2SelectMusic();
virtual void DrawPrimitives(); virtual void DrawPrimitives();
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM ); virtual void HandleScreenMessage( const ScreenMessage SM );
virtual void MenuLeft( PlayerNumber pn, const InputEventType type );
virtual void MenuRight( PlayerNumber pn, const InputEventType type );
virtual void MenuStart( PlayerNumber pn );
virtual void MenuBack( PlayerNumber pn );
protected: protected:
void TweenOnScreen(); MusicBannerWheel m_MusicBannerWheel;
void TweenOffScreen();
void TweenScoreOnAndOffAfterChangeSort();
void EasierDifficulty( PlayerNumber pn );
void HarderDifficulty( PlayerNumber pn );
void AfterNotesChange( PlayerNumber pn );
void AfterMusicChange();
void PlayMusicSample();
void SortOrderChanged();
void UpdateOptionsDisplays();
CArray<Notes*, Notes*> m_arrayNotes;
int m_iSelection[NUM_PLAYERS];
MenuElements m_Menu;
Sprite m_sprBannerFrame;
FadingBanner m_Banner;
FadingBanner m_BannerNext;
FadingBanner m_BannerPrevious;
BPMDisplay m_BPMDisplay;
BitmapText m_textStage;
Sprite m_sprCDTitle;
Sprite m_sprDifficultyFrame[NUM_PLAYERS];
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
GrooveRadar m_GrooveRadar;
// BitmapText m_textPlayerOptions[NUM_PLAYERS];
BitmapText m_textSongOptions;
OptionIconRow m_OptionIconRow[NUM_PLAYERS];
Sprite m_sprMeterFrame[NUM_PLAYERS];
FootMeter m_FootMeter[NUM_PLAYERS];
MusicSortDisplay m_MusicSortDisplay;
Sprite m_sprHighScoreFrame[NUM_PLAYERS];
ScoreDisplayNormal m_HighScore[NUM_PLAYERS];
MusicWheel m_MusicWheel;
bool m_bMadeChoice;
bool m_bGoToOptions;
BitmapText m_textHoldForOptions;
RageSoundSample m_soundSelect;
RageSoundSample m_soundChangeNotes;
RageSoundSample m_soundOptionsChange;
RageSoundSample m_soundLocked;
}; };
*/
#endif
+1 -1
View File
@@ -222,7 +222,7 @@ Screen* ScreenManager::MakeNewScreen( CString sClassName )
else if( 0==stricmp(sClassName, "ScreenSongOptions") ) return new ScreenSongOptions; else if( 0==stricmp(sClassName, "ScreenSongOptions") ) return new ScreenSongOptions;
else if( 0==stricmp(sClassName, "ScreenStage") ) return new ScreenStage; else if( 0==stricmp(sClassName, "ScreenStage") ) return new ScreenStage;
else if( 0==stricmp(sClassName, "ScreenTitleMenu") ) return new ScreenTitleMenu; else if( 0==stricmp(sClassName, "ScreenTitleMenu") ) return new ScreenTitleMenu;
// else if( 0==stricmp(sClassName, "ScreenEz2SelectMusic") ) return new ScreenEz2SelectMusic; else if( 0==stricmp(sClassName, "ScreenEz2SelectMusic") ) return new ScreenEz2SelectMusic;
else else
throw RageException( "Invalid Screen class name '%s'", sClassName.GetString() ); throw RageException( "Invalid Screen class name '%s'", sClassName.GetString() );
} }
+3 -2
View File
@@ -46,10 +46,10 @@ const CString CREDIT_LINES[] =
"GRAPHICS:", "GRAPHICS:",
"v1ral (Lucas Tang)", "v1ral (Lucas Tang)",
"SPiGuMuS", "SPiGuMuS",
"Visage",
"DJ McFox (Ryan McKanna)", "DJ McFox (Ryan McKanna)",
"Cloud34 (Lamden Travis)", "Cloud34 (Lamden Travis)",
"Redcrusher (Michael Curry)", "Redcrusher (Michael Curry)",
"spds (James Sanders)",
"", "",
"", "",
"", "",
@@ -71,7 +71,7 @@ const CString CREDIT_LINES[] =
"", "",
"PROGRAMMING:", "PROGRAMMING:",
"Chris Danford", "Chris Danford",
"Lord Frieza (Andrew Livy)", "Andrew 'Frieza' Livy",
"Glenn Maynard", "Glenn Maynard",
"Bruno Figueiredo", "Bruno Figueiredo",
"Dro Kulix (Peter S. May)", "Dro Kulix (Peter S. May)",
@@ -114,6 +114,7 @@ const CString CREDIT_LINES[] =
"Garett Sakamoto", "Garett Sakamoto",
"SailorBob", "SailorBob",
"AngelTK (Kenny Lai)", "AngelTK (Kenny Lai)",
"spds (James Sanders)",
"Illusionz - Issaquah, WA", "Illusionz - Issaquah, WA",
"Quarters - Kirkland, WA", "Quarters - Kirkland, WA",
"Segapark - Bournemouth, UK", "Segapark - Bournemouth, UK",
+10 -2
View File
@@ -57,7 +57,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /verbose /pdb:none # SUBTRACT LINK32 /verbose /pdb:none
# Begin Special Build Tool # Begin Special Build Tool
IntDir=.\../Release6 IntDir=.\../Release6
TargetDir=\temp\stepmania TargetDir=\Stepmania\stepmania
TargetName=StepMania TargetName=StepMania
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
@@ -92,7 +92,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
# Begin Special Build Tool # Begin Special Build Tool
IntDir=.\../Debug6 IntDir=.\../Debug6
TargetDir=\temp\stepmania TargetDir=\Stepmania\stepmania
TargetName=StepMania-debug TargetName=StepMania-debug
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
@@ -832,6 +832,14 @@ SOURCE=.\MenuTimer.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\MusicBannerWheel.cpp
# End Source File
# Begin Source File
SOURCE=.\MusicBannerWheel.h
# End Source File
# Begin Source File
SOURCE=.\MusicList.cpp SOURCE=.\MusicList.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
Binary file not shown.
Binary file not shown.
Binary file not shown.