Files
itgmania212121/stepmania/src/ScreenSelectMusic.h
T

166 lines
5.5 KiB
C++
Raw Normal View History

2004-06-08 05:22:33 +00:00
/* ScreenSelectMusic - Choose a Song and Steps. */
2002-05-20 08:59:37 +00:00
2004-06-08 05:22:33 +00:00
#ifndef SCREEN_SELECT_MUSIC_H
#define SCREEN_SELECT_MUSIC_H
2002-05-20 08:59:37 +00:00
#include "ScreenWithMenuElements.h"
2002-05-20 08:59:37 +00:00
#include "Sprite.h"
#include "BitmapText.h"
#include "GameConstantsAndTypes.h"
#include "MusicWheel.h"
#include "FadingBanner.h"
#include "RageUtil_BackgroundLoader.h"
2005-02-02 04:17:38 +00:00
#include "ThemeMetric.h"
2005-06-30 22:41:22 +00:00
#include "RageTexturePreloader.h"
2005-09-03 06:13:30 +00:00
#include "TimingData.h"
#include "GameInput.h"
2007-03-01 07:57:04 +00:00
#include "OptionsList.h"
2002-05-20 08:59:37 +00:00
2007-08-20 03:32:26 +00:00
enum SelectionState
{
SelectionState_SelectingSong,
SelectionState_SelectingSteps,
SelectionState_Finalized,
NUM_SelectionState,
};
const RString& SelectionStateToString( SelectionState ss );
class ScreenSelectMusic : public ScreenWithMenuElements
2002-05-20 08:59:37 +00:00
{
public:
virtual ~ScreenSelectMusic();
virtual void Init();
2005-07-22 22:38:53 +00:00
virtual void BeginScreen();
2002-05-20 08:59:37 +00:00
virtual void Update( float fDeltaTime );
virtual void Input( const InputEventPlus &input );
2002-05-20 08:59:37 +00:00
virtual void HandleScreenMessage( const ScreenMessage SM );
2007-03-04 08:52:06 +00:00
virtual bool AllowLateJoin() const { return true; }
2002-05-20 08:59:37 +00:00
2006-09-15 01:47:24 +00:00
virtual void MenuStart( const InputEventPlus &input );
virtual void MenuBack( const InputEventPlus &input );
2002-05-20 08:59:37 +00:00
/* ScreenWithMenuElements override: never play music here; we do it ourself. */
virtual void StartPlayingMusic() { }
2005-07-12 05:52:52 +00:00
bool GetGoToOptions() const { return m_bGoToOptions; }
2008-02-15 10:08:32 +00:00
MusicWheel *GetMusicWheel() { return &m_MusicWheel; }
2005-07-12 05:52:52 +00:00
//
// Lua
//
virtual void PushSelf( lua_State *L );
2002-05-20 08:59:37 +00:00
protected:
2006-08-16 22:09:29 +00:00
virtual bool GenericTweenOn() const { return true; }
virtual bool GenericTweenOff() const { return true; }
void UpdateSelectButton( PlayerNumber pn, bool bBeingPressed );
2002-08-28 22:42:40 +00:00
void ChangeDifficulty( PlayerNumber pn, int dir );
2002-05-28 20:01:22 +00:00
2006-08-17 01:22:20 +00:00
void AfterStepsOrTrailChange( const vector<PlayerNumber> &vpns );
void SwitchToPreferredDifficulty();
2002-05-20 08:59:37 +00:00
void AfterMusicChange();
void CheckBackgroundRequests( bool bForce );
bool DetectCodes( const InputEventPlus &input );
2002-08-01 13:42:56 +00:00
2006-02-14 11:10:03 +00:00
vector<Steps*> m_vpSteps;
vector<Trail*> m_vpTrails;
int m_iSelection[NUM_PLAYERS];
2002-05-20 08:59:37 +00:00
2005-02-02 04:17:38 +00:00
ThemeMetric<float> SAMPLE_MUSIC_DELAY;
2007-04-06 18:34:43 +00:00
ThemeMetric<bool> SAMPLE_MUSIC_LOOPS;
2007-04-06 18:59:27 +00:00
ThemeMetric<float> SAMPLE_MUSIC_FALLBACK_FADE_IN_SECONDS;
2005-02-02 04:17:38 +00:00
ThemeMetric<bool> DO_ROULETTE_ON_MENU_TIMER;
ThemeMetric<bool> ALIGN_MUSIC_BEATS;
2006-01-22 01:00:06 +00:00
ThemeMetric<RString> CODES;
ThemeMetric<RString> MUSIC_WHEEL_TYPE;
ThemeMetric<bool> OPTIONS_MENU_AVAILABLE;
2007-04-08 18:03:38 +00:00
ThemeMetric<bool> SELECT_MENU_AVAILABLE;
ThemeMetric<bool> MODE_MENU_AVAILABLE;
2007-03-01 07:57:04 +00:00
ThemeMetric<bool> USE_OPTIONS_LIST;
ThemeMetric<bool> TWO_PART_SELECTION;
2007-03-06 03:16:42 +00:00
bool CanChangeSong() const { return m_SelectionState == SelectionState_SelectingSong; }
bool CanChangeSteps() const { return TWO_PART_SELECTION ? m_SelectionState == SelectionState_SelectingSteps : m_SelectionState == SelectionState_SelectingSong; }
SelectionState GetNextSelectionState() const
{
switch( m_SelectionState )
{
case SelectionState_SelectingSong:
return TWO_PART_SELECTION ? SelectionState_SelectingSteps : SelectionState_Finalized;
case SelectionState_SelectingSteps:
return SelectionState_Finalized;
2007-04-26 16:49:49 +00:00
DEFAULT_FAIL( m_SelectionState );
}
}
2005-02-02 04:17:38 +00:00
GameButton m_GameButtonPreviousSong;
GameButton m_GameButtonNextSong;
2006-01-22 01:00:06 +00:00
RString m_sSectionMusicPath;
RString m_sSortMusicPath;
RString m_sRouletteMusicPath;
RString m_sRandomMusicPath;
RString m_sCourseMusicPath;
2007-04-06 18:34:43 +00:00
RString m_sLoopMusicPath;
2006-01-22 01:00:06 +00:00
RString m_sFallbackCDTitlePath;
2005-02-02 04:17:38 +00:00
2007-02-19 20:11:40 +00:00
FadingBanner m_Banner;
Sprite m_sprCDTitleFront, m_sprCDTitleBack;
Sprite m_sprHighScoreFrame[NUM_PLAYERS];
BitmapText m_textHighScore[NUM_PLAYERS];
MusicWheel m_MusicWheel;
2007-03-01 07:57:04 +00:00
OptionsList m_OptionsList[NUM_PLAYERS];
void OpenOptionsList( PlayerNumber pn );
void CloseOptionsList( PlayerNumber pn );
2002-05-20 08:59:37 +00:00
SelectionState m_SelectionState;
2007-08-20 03:32:26 +00:00
bool m_bStepsChosen[NUM_PLAYERS]; // only used in SelectionState_SelectingSteps
2007-02-19 20:11:40 +00:00
bool m_bGoToOptions;
RString m_sSampleMusicToPlay;
TimingData *m_pSampleMusicTimingData;
float m_fSampleStartSeconds, m_fSampleLengthSeconds;
bool m_bAllowOptionsMenu, m_bAllowOptionsMenuRepeat;
bool m_bSelectIsDown[NUM_PLAYERS];
bool m_bAcceptSelectRelease[NUM_PLAYERS];
2002-05-20 08:59:37 +00:00
2007-02-19 20:11:40 +00:00
RageSound m_soundStart;
RageSound m_soundDifficultyEasier;
RageSound m_soundDifficultyHarder;
RageSound m_soundOptionsChange;
RageSound m_soundLocked;
2007-02-19 20:11:40 +00:00
BackgroundLoader m_BackgroundLoader;
RageTexturePreloader m_TexturePreload;
2002-05-20 08:59:37 +00:00
};
2004-06-08 05:22:33 +00:00
#endif
2002-05-20 08:59:37 +00:00
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.
*/