diff --git a/stepmania/src/ScreenSelectDifficultyEX.cpp b/stepmania/src/ScreenSelectDifficultyEX.cpp deleted file mode 100644 index d1ce7d7de2..0000000000 --- a/stepmania/src/ScreenSelectDifficultyEX.cpp +++ /dev/null @@ -1,495 +0,0 @@ -#include "global.h" -#include "AnnouncerManager.h" -#include "GameManager.h" -#include "GameState.h" -#include "ModeChoice.h" -#include "PrefsManager.h" -#include "RageLog.h" -#include "GameSoundManager.h" -#include "ScreenManager.h" -#include "ScreenSelectDifficultyEX.h" -#include "ThemeManager.h" - - -#define ANIMATE_MODE_SWITCH THEME->GetMetricB("ScreenSelectDifficultyEX","AnimateModeSwitch") -#define ANIMATE_MODE_SWITCH_LOCK_TIME THEME->GetMetricF("ScreenSelectDifficultyEX","AnimateModeSwitchLockTime") -#define ANIMATE_MODE_SWITCH_INFO_OFF_COMMAND THEME->GetMetric("ScreenSelectDifficultyEX","AnimateModeSwitchInfoOFFCommand") -#define ANIMATE_MODE_SWITCH_INFO_ON_COMMAND THEME->GetMetric("ScreenSelectDifficultyEX","AnimateModeSwitchInfoONCommand") -#define ANIMATE_MODE_SWITCH_PICTURE_OFF_COMMAND THEME->GetMetric("ScreenSelectDifficultyEX","AnimateModeSwitchPictureOFFCommand") -#define ANIMATE_MODE_SWITCH_PICTURE_ON_COMMAND THEME->GetMetric("ScreenSelectDifficultyEX","AnimateModeSwitchPictureONCommand") -#define CURSOR_OFFSET_X_FROM_PICTURE( p ) THEME->GetMetricF("ScreenSelectDifficultyEX",ssprintf("CursorP%dOffsetXFromPicture",p+1)) -#define CURSOR_OFFSET_Y_FROM_PICTURE( p ) THEME->GetMetricF("ScreenSelectDifficultyEX",ssprintf("CursorP%dOffsetYFromPicture",p+1)) -#define DIFFICULTYSPRITE_OFF_COMMAND( p ) THEME->GetMetric("ScreenSelectDifficultyEX",ssprintf("DifficultyIcon%dOFFCommand",p+1)) -#define DIFFICULTYSPRITE_ON_COMMAND( p ) THEME->GetMetric("ScreenSelectDifficultyEX",ssprintf("DifficultyIcon%dONCommand",p+1)) -#define DIFFICULTYSPRITE_X( p ) THEME->GetMetricF("ScreenSelectDifficultyEX",ssprintf("DifficultyIcon%dX",p+1)) -#define DIFFICULTYSPRITE_Y( p ) THEME->GetMetricF("ScreenSelectDifficultyEX",ssprintf("DifficultyIcon%dY",p+1)) -#define DIFFICULTYTEXT_COLOR( p ) THEME->GetMetricC("ScreenSelectDifficultyEX",ssprintf("DifficultyText%dCOLOR",p+1)) -#define DIFFICULTYTEXT_OFF_COMMAND( p ) THEME->GetMetric("ScreenSelectDifficultyEX",ssprintf("DifficultyText%dOFFCommand",p+1)) -#define DIFFICULTYTEXT_ON_COMMAND( p ) THEME->GetMetric("ScreenSelectDifficultyEX",ssprintf("DifficultyText%dONCommand",p+1)) -#define DISABLED_COLOR THEME->GetMetricC("ScreenSelectDifficultyEX","DisabledColor") -#define ICONBAR_OFF_COMMAND THEME->GetMetric("ScreenSelectDifficultyEX","IconBarOFFCommand") -#define ICONBAR_ON_COMMAND THEME->GetMetric("ScreenSelectDifficultyEX","IconBarONCommand") -#define INFO_OFF_COMMAND( p ) THEME->GetMetric("ScreenSelectDifficultyEX",ssprintf("InfoP%dOFFCommand",p+1)) -#define INFO_ON_COMMAND( p ) THEME->GetMetric("ScreenSelectDifficultyEX",ssprintf("InfoP%dONCommand",p+1)) -#define INFO_X( p ) THEME->GetMetricF("ScreenSelectDifficultyEX",ssprintf("InfoXP%d",p+1)) -#define INFO_Y( p ) THEME->GetMetricF("ScreenSelectDifficultyEX",ssprintf("InfoYP%d",p+1)) -#define LOCK_INPUT_SECONDS THEME->GetMetricF("ScreenSelectDifficultyEX","LockInputSeconds") -#define PICTURE_OFF_COMMAND( p ) THEME->GetMetric("ScreenSelectDifficultyEX",ssprintf("PictureP%dOFFCommand",p+1)) -#define PICTURE_ON_COMMAND( p ) THEME->GetMetric("ScreenSelectDifficultyEX",ssprintf("PictureP%dONCommand",p+1)) -#define PICTURE_X( p ) THEME->GetMetricF("ScreenSelectDifficultyEX",ssprintf("PictureXP%d",p+1)) -#define PICTURE_Y( p ) THEME->GetMetricF("ScreenSelectDifficultyEX",ssprintf("PictureYP%d",p+1)) -#define SLEEP_AFTER_CHOICE_SECONDS THEME->GetMetricF("ScreenSelectDifficultyEX","SleepAfterChoiceSeconds") -#define SLEEP_AFTER_TWEEN_OFF_SECONDS THEME->GetMetricF("ScreenSelectDifficultyEX","SleepAfterTweenOffSeconds") - - -ScreenSelectDifficultyEX::ScreenSelectDifficultyEX( CString sClassName ) : ScreenSelect( sClassName ) -{ - m_CurrentPage = PAGE_1; - - FOREACH_PlayerNumber( p ) - { - m_iChoice[p] = 0; - m_bChosen[p] = false; - } - - m_NumModes = 0; - for( unsigned c=0; cGetPathToG("ScreenSelectDifficultyEX icon bar.png") ); - this->AddChild( &m_sprIconBar ); - - for( unsigned k=0; k < m_NumModes || k <= 7 ; k++ ) - { - CString MOO = m_aModeChoices[k].m_sName; - if( IsValidModeName(MOO) ) - { - // We cannot show more than 8 icons at a time, BTW - m_sprDifficulty[k].Load( THEME->GetPathToG("ScreenSelectDifficultyEX icons 1x10") ); - m_sprDifficulty[k].StopAnimating(); - m_sprDifficulty[k].SetX( DIFFICULTYSPRITE_X(k) ); - m_sprDifficulty[k].SetY( DIFFICULTYSPRITE_Y(k) ); - m_sprDifficulty[k].SetZoom( 1 ); - this->AddChild( &m_sprDifficulty[k] ); - - m_textDifficultyText[k].SetHorizAlign( Actor::align_left ); - m_textDifficultyText[k].LoadFromFont( THEME->GetPathToF("Common normal") ); - m_textDifficultyText[k].SetX( DIFFICULTYSPRITE_X(k) + 20 ); - m_textDifficultyText[k].SetY( DIFFICULTYSPRITE_Y(k) ); - m_textDifficultyText[k].SetZoom( .5 ); - m_textDifficultyText[k].SetShadowLength( 1 ); //No shadow, jus outline - m_textDifficultyText[k].SetDiffuse( DIFFICULTYTEXT_COLOR(k) ); - this->AddChild( &m_textDifficultyText[k] ); - } - } - SetDifficultyIconText( false ); // Make sure we show the names! - - FOREACH_PlayerNumber( p ) - { - if( GAMESTATE->IsPlayerEnabled(p) ) // Only show their cursor, if they're enabled - { - m_sprHighlight[p].SetHorizAlign( Actor::align_left ); - m_sprHighlight[p].Load( (PlayerNumber)p, false ); - this->AddChild( &m_sprHighlight[p] ); - this->MoveToHead( &m_sprHighlight[p] ); - } - - CLAMP( m_iChoice[p], 0, (int)m_ModeChoices.size()-1 ); - m_bChosen[p] = false; - - if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) ) { continue; } - float fCursorX = GetCursorX( (PlayerNumber)p ); - float fCursorY = GetCursorY( (PlayerNumber)p ); - -#ifdef _XBOX - //shorten filenames for FATX - CString sInfoFile = ssprintf( "ScrSelDiffX info %s", m_ModeChoices[0].m_sName.c_str() ); - CString sPictureFile = ssprintf( "ScrSelDiffX picture %s", m_ModeChoices[0].m_sName.c_str() ); -#else - CString sInfoFile = ssprintf( "ScreenSelectDifficultyEX info %s", m_ModeChoices[0].m_sName.c_str() ); - CString sPictureFile = ssprintf( "ScreenSelectDifficultyEX picture %s", m_ModeChoices[0].m_sName.c_str() ); -#endif - - m_sprPicture[p].Load( THEME->GetPathToG(sPictureFile) ); - m_sprPicture[p].SetXY( PICTURE_X(p), PICTURE_Y(p) ); - m_framePages.AddChild( &m_sprPicture[p] ); - - m_sprInfo[p].Load( THEME->GetPathToG(sInfoFile) ); - m_sprInfo[p].SetXY( INFO_X(p), INFO_Y(p) ); - m_framePages.AddChild( &m_sprInfo[p] ); - - m_sprCursor[p].Load( THEME->GetPathToG( "ScreenSelectDifficultyEX cursor 2x1") ); - m_sprCursor[p].SetZoom( 0 ); - m_sprCursor[p].StopAnimating(); - m_sprCursor[p].SetState( p ); - m_sprCursor[p].SetXY( fCursorX, fCursorY ); - m_framePages.AddChild( &m_sprCursor[p] ); - - m_sprOK[p].Load( THEME->GetPathToG( "ScreenSelectDifficultyEX ok 2x1") ); - m_sprOK[p].SetState( p ); - m_sprOK[p].StopAnimating(); - m_sprOK[p].SetDiffuse( RageColor(1,1,1,1) ); - m_sprOK[p].SetXY( fCursorX, fCursorY ); - m_framePages.AddChild( &m_sprOK[p] ); - } - - this->AddChild( &m_framePages ); - m_soundChange.Load( THEME->GetPathToS( "ScreenSelectDifficulty change") ); - m_soundDifficult.Load( ANNOUNCER->GetPathTo("select difficulty challenge") ); - m_fLockInputTime = LOCK_INPUT_SECONDS; - TweenOnScreen(); - - SetAllPlayersSelection( 0, false ); - - this->SortByDrawOrder(); -} - -void ScreenSelectDifficultyEX::Update( float fDelta ) -{ - ScreenSelect::Update( fDelta ); - m_fLockInputTime = max( 0, m_fLockInputTime-fDelta ); -} - -void ScreenSelectDifficultyEX::HandleScreenMessage( const ScreenMessage SM ) -{ - ScreenSelect::HandleScreenMessage( SM ); - - switch( SM ) - { - case SM_BeginFadingOut: - TweenOffScreen(); - SCREENMAN->PostMessageToTopScreen( SM_AllDoneChoosing, SLEEP_AFTER_TWEEN_OFF_SECONDS ); // nofify parent that we're finished - StopTimer(); - break; - } -} - -int ScreenSelectDifficultyEX::GetSelectionIndex( PlayerNumber pn ) -{ - int index = 0; - for( int page=0; pageIsPlayerEnabled(pa) ) - { - MenuRight( (PlayerNumber)pa ); - MenuLeft( (PlayerNumber)pa ); - } -} - -void ScreenSelectDifficultyEX::MenuLeft( PlayerNumber pn ) -{ - if( m_fLockInputTime > 0 ) { return; } - if( m_bChosen[pn] ) { return; } - if( m_iChoice[pn] == 0 ) { return; } - else { Change( pn, m_iChoice[pn]-1 ); } -} - - -void ScreenSelectDifficultyEX::MenuRight( PlayerNumber pn ) -{ - if( m_fLockInputTime > 0 ) { return; } - if( m_bChosen[pn] ) { return; } - if( m_iChoice[pn] < (int)m_ModeChoices.size()-1 ) { Change( pn, m_iChoice[pn]+1 ); } -} - -bool ScreenSelectDifficultyEX::IsACourse( int mIndex ) -{ - CString MODECHOICENAME = m_ModeChoices[mIndex].m_sName; - if( MODECHOICENAME.Left(7) != "arcade-" ) { return true; } - else { return false; } -} - -void ScreenSelectDifficultyEX::SetAllPlayersSelection( int iChoice, bool bSwitchingModes ) -{ - FOREACH_PlayerNumber( p ) - { - m_iChoice[p] = iChoice; - if( bSwitchingModes && ANIMATE_MODE_SWITCH ) - { - // Only do this if we are going from a course~normal or vice-vera - m_fLockInputTime = ANIMATE_MODE_SWITCH_LOCK_TIME; - - m_sprPicture[p].Command( ANIMATE_MODE_SWITCH_PICTURE_OFF_COMMAND ); - m_sprInfo[p].Command( ANIMATE_MODE_SWITCH_INFO_OFF_COMMAND ); - - /* It would be logical to seperate these, as I don't want the pic - to change until the OFF command has completed. Unfortunatly, - until I find a way to correctly do that, sometimes the pic - changes before the OFF is even done, when OFF is set to only - take 0.0secs! Perhaps a loop here until GetTweenTimeLeft() = 0? */ - - m_sprPicture[p].Command( ANIMATE_MODE_SWITCH_PICTURE_ON_COMMAND ); - m_sprInfo[p].Command( ANIMATE_MODE_SWITCH_INFO_ON_COMMAND ); - } - - CString sInfoFile = ssprintf( "ScreenSelectDifficultyEX info %s", m_ModeChoices[m_iChoice[p]].m_sName.c_str() ); - CString sPictureFile = ssprintf( "ScreenSelectDifficultyEX picture %s", m_ModeChoices[m_iChoice[p]].m_sName.c_str() ); - m_sprInfo[p].Load( THEME->GetPathToG(sInfoFile) ); - m_sprPicture[p].Load( THEME->GetPathToG(sPictureFile) ); - - int iDiffIndex = GetSelectionIndex((PlayerNumber)p); - m_sprHighlight[p].SetBarWidth( int(20 + m_sprDifficulty[iDiffIndex].GetZoomedWidth() + (m_textDifficultyText[iDiffIndex].GetZoomedWidth() / 2)) ); - m_sprHighlight[p].SetXY( DIFFICULTYSPRITE_X(m_iChoice[p]) + 35, DIFFICULTYSPRITE_Y(m_iChoice[p]) ); - } - - m_soundChange.Play(); -} - -void ScreenSelectDifficultyEX::Change( PlayerNumber pn, int iNewChoice ) -{ - FOREACH_PlayerNumber( p ) - { - if( !GAMESTATE->IsPlayerEnabled(p) ) { continue; } - if( p!=pn && m_CurrentPage==PAGE_1 ) { continue; } - - // If one player has already chosen, do not allow us to switch between - // Course/Mode & Difficulty - for( int pl=0; plGetPathToG(sInfoFile) ); - m_sprPicture[p].Load( THEME->GetPathToG(sPictureFile) ); - - int iDiffIndex = GetSelectionIndex((PlayerNumber)p); - m_sprHighlight[p].SetBarWidth( int( 20 + m_sprDifficulty[iDiffIndex].GetZoomedWidth() + (m_textDifficultyText[iDiffIndex].GetZoomedWidth() /2 )) ); - m_sprHighlight[p].SetXY( DIFFICULTYSPRITE_X(m_iChoice[p]) + 30, DIFFICULTYSPRITE_Y(m_iChoice[p]) ); - } - - m_soundChange.Play(); -} - -bool ScreenSelectDifficultyEX::IsValidModeName( CString ModeName ) -{ - if( ModeName == "arcade-beginner" || ModeName == "beginner" || ModeName == "arcade-easy" || ModeName == "easy" || ModeName == "arcade-medium" || ModeName == "medium" || ModeName == "arcade-hard" || ModeName == "hard" || ModeName == "nonstop" || ModeName == "oni" || ModeName == "endless" || ModeName == "rave" || ModeName == "battle" ) - { - return true; - } - else { return false; }; -} - -int ScreenSelectDifficultyEX::GetIconIndex( CString DiffName ) -{ - if( DiffName == "arcade-beginner" || DiffName == "beginner" ) { return 0; } - else if( DiffName == "arcade-easy" || DiffName == "easy" ) { return 1; } - else if( DiffName == "arcade-medium" || DiffName == "medium" ) { return 2; } - else if( DiffName == "arcade-hard" || DiffName == "hard" ) { return 3; } - else if( DiffName == "nonstop" ) { return 4; } - else if( DiffName == "oni" || DiffName == "challenge" ) { return 5; } - else if( DiffName == "endless" ) { return 6; } - else if( DiffName == "rave" || DiffName == "battle" ) { return 7; } - else { return 10; }; -} - -void ScreenSelectDifficultyEX::SetDifficultyIconText( bool bDisplayCourseItems ) -{ - for( unsigned k=0; k < m_aModeChoices.size(); k++ ) - { - CString MMNAME = m_ModeChoices[k].m_sName; - MMNAME.Replace( "arcade-", "" ); - m_sprDifficulty[k].SetState( GetIconIndex(MMNAME.c_str()) ); - m_textDifficultyText[k].SetDiffuse( RageColor(1,1,1,1) ); - - /* Grammatically correct names. There has to be a better way to - do this.. Anyone? -- Miryo */ - MMNAME.Replace( "beginner", "Beginner"); - MMNAME.Replace( "easy", "Light" ); - MMNAME.Replace( "medium", "Standard" ); - MMNAME.Replace( "hard", "Heavy" ); - MMNAME.Replace( "nonstop", "Nonstop"); - MMNAME.Replace( "oni", "Oni"); - MMNAME.Replace( "endless", "Endless"); - MMNAME.Replace( "rave", "Rave"); - - m_textDifficultyText[k].SetText( MMNAME.c_str() ); - m_textDifficultyText[k].SetDiffuse( DIFFICULTYTEXT_COLOR(k) ); - } -} - -void ScreenSelectDifficultyEX::MenuStart( PlayerNumber pn ) -{ - if( m_fLockInputTime > 0 ) { return; } - if( m_bChosen[pn] == true ) { return; } - m_bChosen[pn] = true; - const ModeChoice& mc = m_ModeChoices[m_iChoice[pn]]; - bool AnotherPlayerSelected = false; - - FOREACH_PlayerNumber( p ) - { - if(p != pn && m_bChosen[p]) { AnotherPlayerSelected = true; } - } - - if( !IsACourse( m_iChoice[pn] ) || !AnotherPlayerSelected) - { - // Disable the courses - for( unsigned e=0; e < m_NumModes || e <= 7; e++ ) - { - if( IsACourse(e) ) - { - m_textDifficultyText[e].SetDiffuse( RageColor(.5,.5,.5,1) ); - m_sprDifficulty[e].SetDiffuse( RageColor(.5,.5,.5,1) ); - } - } - SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo(ssprintf("ScreenSelectDifficulty comment %s",mc.m_sName.c_str())) ); - SCREENMAN->PlayStartSound(); - } - - if( IsACourse( m_iChoice[pn] ) ) - { - // If this is course/mode, choose this for all the other players too - FOREACH_PlayerNumber( p ) - { - if( m_bChosen[p] ) { continue; } - MenuStart( (PlayerNumber)p ); - } - } - - // Show cursor only when a selection is made - m_sprOK[pn].SetZoom( 1 ); - m_sprCursor[pn].SetZoom( 1 ); - m_sprOK[pn].SetX( GetCursorX(pn) ); - m_sprOK[pn].SetY( GetCursorY(pn) ); - - m_sprCursor[pn].Command( "ZoomY,0;BounceEnd,0.3;ZoomY,1" ); - m_sprOK[pn].Command( "ZoomY,0;BounceEnd,0.3;ZoomY,1" ); - - - // check to see if everyone has chosen - FOREACH_PlayerNumber( p ) - { - if( GAMESTATE->IsPlayerEnabled((PlayerNumber)p) && m_bChosen[p] == false ) - { - return; - } - } - this->PostScreenMessage( SM_BeginFadingOut, SLEEP_AFTER_CHOICE_SECONDS ); // tell our owner it's time to move on -} - -void ScreenSelectDifficultyEX::TweenOnScreen() -{ - FOREACH_PlayerNumber( p ) - { - if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) ) { continue; } - -// float fCursorX = GetCursorX( (PlayerNumber)p ); -// float fCursorY = GetCursorY( (PlayerNumber)p ); - - m_sprInfo[p].Command( INFO_ON_COMMAND(p) ); - m_sprPicture[p].Command( PICTURE_ON_COMMAND(p) ); - - m_sprHighlight[p].SetXY( DIFFICULTYSPRITE_X(1) + 30, DIFFICULTYSPRITE_Y(1) ); - m_sprHighlight[p].Command( "diffusealpha,0;linear,0.3;diffusealpha,1" ); - } - - m_sprIconBar.Command( ICONBAR_ON_COMMAND ); - for( unsigned di=0; di < m_aModeChoices.size(); di++ ) - { - m_sprDifficulty[di].Command( DIFFICULTYSPRITE_ON_COMMAND(di) ); - m_textDifficultyText[di].Command( DIFFICULTYTEXT_ON_COMMAND(di) ); - } -} - -void ScreenSelectDifficultyEX::TweenOffScreen() -{ - FOREACH_PlayerNumber( p ) - { - if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) ) { continue; } - - m_sprInfo[p].Command( INFO_OFF_COMMAND(p) ); - m_sprPicture[p].Command( PICTURE_OFF_COMMAND(p) ); - m_sprHighlight[p].SetXY( -600,-600 ); - m_sprOK[p].Command( "linear,0.3;diffusealpha,0" ); - } - - m_sprIconBar.Command( ICONBAR_OFF_COMMAND ); - for( unsigned di=0; di < m_aModeChoices.size(); di++ ) - { - m_sprDifficulty[di].Command( DIFFICULTYSPRITE_OFF_COMMAND(di) ); - m_textDifficultyText[di].Command( DIFFICULTYTEXT_OFF_COMMAND(di) ); - } -} - - -float ScreenSelectDifficultyEX::GetCursorX( PlayerNumber pn ) -{ - return m_sprPicture[pn].GetX(); -} - -float ScreenSelectDifficultyEX::GetCursorY( PlayerNumber pn ) -{ - return m_sprPicture[pn].GetY(); -} - -/* - * (c) 2001-2003 Kevin Slaughter - * 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. - */ diff --git a/stepmania/src/ScreenSelectDifficultyEX.h b/stepmania/src/ScreenSelectDifficultyEX.h deleted file mode 100644 index 33acabbae0..0000000000 --- a/stepmania/src/ScreenSelectDifficultyEX.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef ScreenSelectDifficultyEX_H -#define ScreenSelectDifficultyEX_H - -#include "BitmapText.h" -#include "RageSound.h" -#include "RandomSample.h" -#include "ScreenSelect.h" -#include "Sprite.h" -#include "OptionsCursor.h" - -class ScreenSelectDifficultyEX : public ScreenSelect -{ -public: - ScreenSelectDifficultyEX( CString sName ); - - virtual void HandleScreenMessage( const ScreenMessage SM ); - virtual void MenuLeft( PlayerNumber pn ); - virtual void MenuRight( PlayerNumber pn ); - virtual void MenuUp( PlayerNumber pn ) {}; - virtual void MenuDown( PlayerNumber pn ) {}; - virtual void MenuStart( PlayerNumber pn ); - virtual void TweenOffScreen(); - virtual void TweenOnScreen(); - virtual void Update( float fDelta ); - -protected: - enum Page { PAGE_1, NUM_PAGES }; - - virtual int GetSelectionIndex( PlayerNumber pn ); - virtual void UpdateSelectableChoices(); - - void Change( PlayerNumber pn, int iNewChoice ); - float GetCursorX( PlayerNumber pn ); - float GetCursorY( PlayerNumber pn ); - bool IsACourse( int mIndex ); - bool IsValidModeName( CString ModeName ); - void SetAllPlayersSelection( int iChoice, bool bSwitchingModes ); - - ActorFrame m_framePages; - Sprite m_sprCursor[NUM_PLAYERS]; - Sprite m_sprInfo[NUM_PLAYERS]; - - -/* Icon Bar stuff */ - unsigned m_NumModes; - Sprite m_sprDifficulty[8]; - Sprite m_sprIconBar; - BitmapText m_textDifficultyText[8]; - OptionsCursor m_sprHighlight[NUM_PLAYERS]; - - int GetIconIndex( CString DiffName ); - void SetDifficultyIconText( bool bDisplayCourseItems ); -/* -------------- */ - - - Sprite m_sprOK[NUM_PLAYERS]; - Sprite m_sprPicture[NUM_PLAYERS]; - - RageSound m_soundChange; - RandomSample m_soundDifficult; - - vector m_ModeChoices; - - Page m_CurrentPage; - int m_iChoice[NUM_PLAYERS]; - bool m_bChosen[NUM_PLAYERS]; - - float m_fLockInputTime; -}; - -#endif - -/* - * (c) 2001-2003 Kevin Slaughter - * 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. - */