From c743e97f6e0a3e34b40340c4d71c9039b9a225f7 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 15 Jun 2003 17:05:51 +0000 Subject: [PATCH] break PlayerOptions selection into two screens (is there any other solution?) add lines for Step selection and Character selection --- stepmania/Data/VideoCardDefaults.ini | 11 +- stepmania/Themes/default/metrics.ini | 42 ++-- stepmania/src/BPMDisplay.cpp | 5 + stepmania/src/BPMDisplay.h | 1 + stepmania/src/Screen.cpp | 2 + stepmania/src/ScreenPlayerOptions.cpp | 197 ++++++---------- stepmania/src/ScreenPlayerOptions.h | 4 - stepmania/src/ScreenPlayerOptions2.cpp | 297 +++++++++++++++++++++++++ stepmania/src/ScreenPlayerOptions2.h | 42 ++++ stepmania/src/ScreenSelectMusic.cpp | 4 +- 10 files changed, 450 insertions(+), 155 deletions(-) create mode 100644 stepmania/src/ScreenPlayerOptions2.cpp create mode 100644 stepmania/src/ScreenPlayerOptions2.h diff --git a/stepmania/Data/VideoCardDefaults.ini b/stepmania/Data/VideoCardDefaults.ini index c52a329790..9fdb462164 100644 --- a/stepmania/Data/VideoCardDefaults.ini +++ b/stepmania/Data/VideoCardDefaults.ini @@ -34,8 +34,17 @@ DisplayColor=16 TextureColor=16 AntiAliasing=0 +[0003] +DriverRegex=Savage +Renderers=d3d,opengl // OpenGL driver doesn't support EXT_texture_env_combine +Width=640 +Height=480 +DisplayColor=16 +TextureColor=16 +AntiAliasing=0 + [0004] -DriverRegex=OpenGL +DriverRegex=OpenGL // Please add a comment. What is this supposed to match? -Chris Renderers=opengl Width=640 Height=480 diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index c9b544cc01..689ec35950 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -482,7 +482,7 @@ MusicListOffCommand= SleepAfterTweenOffSeconds=0.8 HelpText=Use &LEFT; &RIGHT; to select, then press START TimerSeconds=40 -NextScreen=ScreenSelectCharacter +NextScreen=ScreenSelectMusic [GroupList] StartX=0 @@ -2056,16 +2056,16 @@ PrevScreenOni=ScreenSelectCourse PrevScreenEndless=ScreenSelectCourse PrevScreenBattle=ScreenSelectMusic PrevScreenRave=ScreenSelectMusic -NextScreenArcade=ScreenSongOptions -NextScreenNonstop=ScreenSongOptions -NextScreenOni=ScreenSongOptions -NextScreenEndless=ScreenSongOptions -NextScreenBattle=ScreenSongOptions -NextScreenRave=ScreenRaveOptions +NextScreenArcade=ScreenPlayerOptions2 +NextScreenNonstop=ScreenPlayerOptions2 +NextScreenOni=ScreenPlayerOptions2 +NextScreenEndless=ScreenPlayerOptions2 +NextScreenBattle=ScreenPlayerOptions2 +NextScreenRave=ScreenPlayerOptions2 HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options START to accept changes TimerSeconds=30 -[ScreenRaveOptions] +[ScreenPlayerOptions2] PrevScreenArcade=ScreenPlayerOptions PrevScreenNonstop=ScreenPlayerOptions PrevScreenOni=ScreenPlayerOptions @@ -2077,16 +2077,32 @@ NextScreenNonstop=ScreenSongOptions NextScreenOni=ScreenSongOptions NextScreenEndless=ScreenSongOptions NextScreenBattle=ScreenSongOptions +NextScreenRave=ScreenRaveOptions +HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options START to accept changes +TimerSeconds=30 + +[ScreenRaveOptions] +PrevScreenArcade=ScreenPlayerOptions2 +PrevScreenNonstop=ScreenPlayerOptions2 +PrevScreenOni=ScreenPlayerOptions2 +PrevScreenEndless=ScreenPlayerOptions2 +PrevScreenBattle=ScreenPlayerOptions2 +PrevScreenRave=ScreenPlayerOptions2 +NextScreenArcade=ScreenSongOptions +NextScreenNonstop=ScreenSongOptions +NextScreenOni=ScreenSongOptions +NextScreenEndless=ScreenSongOptions +NextScreenBattle=ScreenSongOptions NextScreenRave=ScreenSongOptions HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options START to accept changes TimerSeconds=30 [ScreenSongOptions] -PrevScreenArcade=ScreenPlayerOptions -PrevScreenNonstop=ScreenPlayerOptions -PrevScreenOni=ScreenPlayerOptions -PrevScreenEndless=ScreenPlayerOptions -PrevScreenBattle=ScreenPlayerOptions +PrevScreenArcade=ScreenPlayerOptions2 +PrevScreenNonstop=ScreenPlayerOptions2 +PrevScreenOni=ScreenPlayerOptions2 +PrevScreenEndless=ScreenPlayerOptions2 +PrevScreenBattle=ScreenPlayerOptions2 PrevScreenRave=ScreenRaveOptions NextScreenArcade=ScreenStage NextScreenNonstop=ScreenStage diff --git a/stepmania/src/BPMDisplay.cpp b/stepmania/src/BPMDisplay.cpp index a80e6a581a..b70192b80b 100644 --- a/stepmania/src/BPMDisplay.cpp +++ b/stepmania/src/BPMDisplay.cpp @@ -190,3 +190,8 @@ void BPMDisplay::SetBPM( const Song* pSong ) ASSERT(0); } } + +void BPMDisplay::DrawPrimitives() +{ + ActorFrame::DrawPrimitives(); +} diff --git a/stepmania/src/BPMDisplay.h b/stepmania/src/BPMDisplay.h index 0e6be24e61..7136621c15 100644 --- a/stepmania/src/BPMDisplay.h +++ b/stepmania/src/BPMDisplay.h @@ -23,6 +23,7 @@ class BPMDisplay : public ActorFrame public: BPMDisplay(); virtual void Update( float fDeltaTime ); + virtual void DrawPrimitives(); void SetBPMRange( float fLowBPM, float fHighBPM ); void SetBPM( const Song* pSong ); void CycleRandomly(); diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index dfbb692cf1..033f85788a 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -255,6 +255,7 @@ void Screen::ClearMessageQueue( const ScreenMessage SM ) #include "ScreenMapControllers.h" #include "ScreenMusicScroll.h" #include "ScreenPlayerOptions.h" +#include "ScreenPlayerOptions2.h" #include "ScreenSandbox.h" #include "ScreenSelectCourse.h" #include "ScreenSelectDifficulty.h" @@ -321,6 +322,7 @@ Screen* Screen::Create( CString sClassName ) IF_RETURN( ScreenInputOptions ); IF_RETURN( ScreenMusicScroll ); IF_RETURN( ScreenPlayerOptions ); + IF_RETURN( ScreenPlayerOptions2 ); IF_RETURN( ScreenSandbox ); IF_RETURN( ScreenSelectCourse ); IF_RETURN( ScreenSelectDifficulty ); diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index 2f31714971..6d28308bf8 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -20,6 +20,8 @@ #include "NoteSkinManager.h" #include "NoteFieldPositioning.h" #include "ScreenSongOptions.h" +#include "Notes.h" +#include "Course.h" #define PREV_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions","PrevScreen"+Capitalize(PlayModeToString(play_mode))) #define NEXT_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions","NextScreen"+Capitalize(PlayModeToString(play_mode))) @@ -27,29 +29,23 @@ enum { PO_SPEED = 0, PO_ACCEL, - PO_EFFECT, PO_APPEAR, PO_TURN, - PO_TRANSFORM, PO_SCROLL, - PO_NOTE_SKIN, PO_HOLD_NOTES, PO_DARK, - PO_PERSPECTIVE, + PO_STEP, NUM_PLAYER_OPTIONS_LINES }; OptionRow g_PlayerOptionsLines[NUM_PLAYER_OPTIONS_LINES] = { OptionRow( "Speed", "x0.25","x0.5","x0.75","x1","x1.5","x2","x3","x5","x8","C200","C300" ), OptionRow( "Acceler\n-ation", "OFF","BOOST","BRAKE","WAVE","EXPAND","BOOMERANG" ), - OptionRow( "Effect", "OFF","DRUNK","DIZZY","MINI","FLIP","TORNADO" ), OptionRow( "Appear\n-ance", "VISIBLE","HIDDEN","SUDDEN","STEALTH","BLINK", "R.VANISH" ), OptionRow( "Turn", "OFF","MIRROR","LEFT","RIGHT","SHUFFLE","S.SHUFFLE" ), - OptionRow( "Trans\n-form", "OFF","LITTLE","WIDE","BIG","QUICK","SKIPPY" ), OptionRow( "Scroll", "STANDARD","REVERSE" ), - OptionRow( "Note\nSkin", "" ), OptionRow( "Holds", "OFF","ON" ), OptionRow( "Dark", "OFF","ON" ), - OptionRow( "Perspec\n-tive", "" ), + OptionRow( "Step", "" ) }; @@ -64,23 +60,6 @@ ScreenPlayerOptions::ScreenPlayerOptions() : NUM_PLAYER_OPTIONS_LINES, true, false ); - /* If we're going to "press start for more options" or skipping options - * entirely, we need a different fade out. XXX: this is a hack */ - if(PREFSMAN->m_ShowSongOptions == PrefsManager::NO) - m_Menu.m_Out.Load( THEME->GetPathToB("ScreenPlayerOptions direct out") ); /* direct to stage */ - else if(PREFSMAN->m_ShowSongOptions == PrefsManager::ASK) - m_Menu.m_Out.Load( THEME->GetPathToB("ScreenPlayerOptions option out") ); /* optional song options */ - - m_sprOptionsMessage.Load( THEME->GetPathToG("ScreenPlayerOptions options") ); - m_sprOptionsMessage.StopAnimating(); - m_sprOptionsMessage.SetXY( CENTER_X, CENTER_Y ); - m_sprOptionsMessage.SetZoom( 1 ); - m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); - //this->AddChild( &m_sprOptionsMessage ); // we have to draw this manually over the top of transitions - - m_bAcceptedChoices = false; - m_bGoToOptions = ( PREFSMAN->m_ShowSongOptions == PrefsManager::YES ); - SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") ); } @@ -88,36 +67,36 @@ ScreenPlayerOptions::ScreenPlayerOptions() : void ScreenPlayerOptions::ImportOptions() { // - // fill in skin names + // fill in difficulty names // - CStringArray arraySkinNames; - NOTESKIN->GetNoteSkinNames( arraySkinNames ); - - m_OptionRow[PO_NOTE_SKIN].choices.clear(); - - unsigned i; - for( i=0; im_pCurCourse ) // playing a course { - arraySkinNames[i].MakeUpper(); - m_OptionRow[PO_NOTE_SKIN].choices.push_back( arraySkinNames[i] ); + m_OptionRow[PO_STEP].choices.push_back( "REGULAR" ); + if( GAMESTATE->m_pCurCourse->HasDifficult() ) + m_OptionRow[PO_STEP].choices.push_back( "DIFFICULT" ); + } + else + { + vector vNotes; + GAMESTATE->m_pCurSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_NotesType ); + SortNotesArrayByDifficulty( vNotes ); + for( unsigned i=0; iGetDescription(); + s.MakeUpper(); + m_OptionRow[PO_STEP].choices.push_back( s ); + } } - m_OptionRow[PO_PERSPECTIVE].choices.clear(); - m_OptionRow[PO_PERSPECTIVE].choices.push_back( "INCOMING" ); - m_OptionRow[PO_PERSPECTIVE].choices.push_back( "OVERHEAD" ); - m_OptionRow[PO_PERSPECTIVE].choices.push_back( "SPACE" ); - - CStringArray arrayPosNames; - GAMESTATE->m_pPosition->GetNamesForCurrentGame(arrayPosNames); - for( i=0; iIsHumanPlayer(p) ) + continue; // skip + PlayerOptions &po = GAMESTATE->m_PlayerOptions[p]; if( !po.m_bTimeSpacing && po.m_fScrollSpeed == 0.25f ) m_iSelectedOption[p][PO_SPEED] = 0; @@ -134,45 +113,32 @@ void ScreenPlayerOptions::ImportOptions() else m_iSelectedOption[p][PO_SPEED] = 3; m_iSelectedOption[p][PO_ACCEL] = po.GetFirstAccel()+1; - m_iSelectedOption[p][PO_EFFECT] = po.GetFirstEffect()+1; m_iSelectedOption[p][PO_APPEAR] = po.GetFirstAppearance()+1; m_iSelectedOption[p][PO_TURN] = po.m_Turn; - m_iSelectedOption[p][PO_TRANSFORM] = po.m_Transform; m_iSelectedOption[p][PO_SCROLL] = po.m_fReverseScroll==1 ? 1 : 0 ; - // highlight currently selected skin - m_iSelectedOption[p][PO_NOTE_SKIN] = -1; - for( unsigned j=0; jm_pCurCourse ) // playing a course { - vector &choices = m_OptionRow[PO_PERSPECTIVE].choices; - for(unsigned n = 3; n < choices.size(); ++n) - if(!choices[n].CompareNoCase(GAMESTATE->m_PlayerOptions[p].m_sPositioning)) - m_iSelectedOption[p][PO_PERSPECTIVE] = n; + if( GAMESTATE->m_bDifficultCourses ) + m_iSelectedOption[p][PO_STEP] = 1; + else + m_iSelectedOption[p][PO_STEP] = 0; + } + else + { + vector vNotes; + GAMESTATE->m_pCurSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_NotesType ); + SortNotesArrayByDifficulty( vNotes ); + for( unsigned i=0; im_pCurNotes[p] == vNotes[i] ) + m_iSelectedOption[p][PO_STEP] = i; + } } - - po.Init(); } } @@ -180,6 +146,9 @@ void ScreenPlayerOptions::ExportOptions() { for( int p=0; pIsHumanPlayer(p) ) + continue; // skip + PlayerOptions &po = GAMESTATE->m_PlayerOptions[p]; po.Init(); @@ -201,34 +170,32 @@ void ScreenPlayerOptions::ExportOptions() if( m_iSelectedOption[p][PO_ACCEL] != 0 ) po.SetOneAccel( (PlayerOptions::Accel)(m_iSelectedOption[p][PO_ACCEL]-1) ); - if( m_iSelectedOption[p][PO_EFFECT] != 0 ) - po.SetOneEffect( (PlayerOptions::Effect)(m_iSelectedOption[p][PO_EFFECT]-1) ); if( m_iSelectedOption[p][PO_APPEAR] != 0 ) po.SetOneAppearance( (PlayerOptions::Appearance)(m_iSelectedOption[p][PO_APPEAR]-1) ); po.m_Turn = (PlayerOptions::Turn)m_iSelectedOption[p][PO_TURN]; - po.m_Transform = (PlayerOptions::Transform)m_iSelectedOption[p][PO_TRANSFORM]; po.m_fReverseScroll = (m_iSelectedOption[p][PO_SCROLL] == 1) ? 1.f : 0.f; - int iSelectedSkin = m_iSelectedOption[p][PO_NOTE_SKIN]; - CString sNewSkin = m_OptionRow[PO_NOTE_SKIN].choices[iSelectedSkin]; - po.m_sNoteSkin = sNewSkin; - - po.m_bHoldNotes = (m_iSelectedOption[p][PO_HOLD_NOTES] == 1); po.m_fDark = (m_iSelectedOption[p][PO_DARK] == 1) ? 1.f : 0.f; - - switch(m_iSelectedOption[p][PO_PERSPECTIVE]) + + // + // apply difficulty selection + // + if( GAMESTATE->m_pCurCourse ) // playing a course { - case 0: po.m_fPerspectiveTilt = -1; break; - case 2: po.m_fPerspectiveTilt = 1; break; - default:po.m_fPerspectiveTilt = 0; break; + if( m_iSelectedOption[p][PO_STEP] == 1 ) + GAMESTATE->m_bDifficultCourses = true; + else + GAMESTATE->m_bDifficultCourses = false; } - if(m_iSelectedOption[p][PO_PERSPECTIVE] > 2) + else { - const int choice = m_iSelectedOption[p][PO_PERSPECTIVE]; - GAMESTATE->m_PlayerOptions[p].m_sPositioning = m_OptionRow[PO_PERSPECTIVE].choices[choice]; + vector vNotes; + GAMESTATE->m_pCurSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_NotesType ); + SortNotesArrayByDifficulty( vNotes ); + GAMESTATE->m_pCurNotes[p] = vNotes[ m_iSelectedOption[p][PO_STEP] ]; } } } @@ -245,68 +212,28 @@ void ScreenPlayerOptions::GoToNextState() { if( GAMESTATE->m_bEditing ) SCREENMAN->PopTopScreen(); - else if( m_bGoToOptions ) - SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) ); else - SCREENMAN->SetNewScreen( ScreenSongOptions::GetNextScreen() ); + SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) ); } void ScreenPlayerOptions::Update( float fDelta ) { ScreenOptions::Update( fDelta ); - m_sprOptionsMessage.Update( fDelta ); } void ScreenPlayerOptions::DrawPrimitives() { ScreenOptions::DrawPrimitives(); - m_sprOptionsMessage.Draw(); } void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) { - if( !GAMESTATE->m_bEditing && - type == IET_FIRST_PRESS && - !m_Menu.m_In.IsTransitioning() && - MenuI.IsValid() && - MenuI.button == MENU_BUTTON_START && - PREFSMAN->m_ShowSongOptions == PrefsManager::ASK ) - { - if( m_bAcceptedChoices && !m_bGoToOptions ) - { - m_bGoToOptions = true; - m_sprOptionsMessage.SetState( 1 ); - SOUNDMAN->PlayOnce( THEME->GetPathToS("Common start") ); - } - } - ScreenOptions::Input( DeviceI, type, GameI, MenuI, StyleI ); } void ScreenPlayerOptions::HandleScreenMessage( const ScreenMessage SM ) { - if(PREFSMAN->m_ShowSongOptions == PrefsManager::ASK) - switch( SM ) - { - case SM_BeginFadingOut: // when the user accepts the page of options - { - m_bAcceptedChoices = true; - - float fShowSeconds = m_Menu.m_Out.GetLengthSeconds(); - - // show "hold START for options" - m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); - m_sprOptionsMessage.BeginTweening( 0.15f ); // fade in - m_sprOptionsMessage.SetZoomY( 1 ); - m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,1) ); - m_sprOptionsMessage.BeginTweening( fShowSeconds-0.3f ); // sleep - m_sprOptionsMessage.BeginTweening( 0.15f ); // fade out - m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); - m_sprOptionsMessage.SetZoomY( 0 ); - } - break; - } ScreenOptions::HandleScreenMessage( SM ); } \ No newline at end of file diff --git a/stepmania/src/ScreenPlayerOptions.h b/stepmania/src/ScreenPlayerOptions.h index 2e5af7213a..da20e8737b 100644 --- a/stepmania/src/ScreenPlayerOptions.h +++ b/stepmania/src/ScreenPlayerOptions.h @@ -31,10 +31,6 @@ private: void GoToNextState(); void GoToPrevState(); - - bool m_bAcceptedChoices; - bool m_bGoToOptions; - Sprite m_sprOptionsMessage; }; diff --git a/stepmania/src/ScreenPlayerOptions2.cpp b/stepmania/src/ScreenPlayerOptions2.cpp new file mode 100644 index 0000000000..20314d7a38 --- /dev/null +++ b/stepmania/src/ScreenPlayerOptions2.cpp @@ -0,0 +1,297 @@ +#include "global.h" +/* +----------------------------------------------------------------------------- + Class: ScreenPlayerOptions2 + + Desc: Select a song. + + Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford +----------------------------------------------------------------------------- +*/ + +#include "ScreenPlayerOptions2.h" +#include "RageUtil.h" +#include "ScreenManager.h" +#include "RageLog.h" +#include "GameState.h" +#include "ThemeManager.h" +#include "AnnouncerManager.h" +#include "NoteSkinManager.h" +#include "NoteFieldPositioning.h" +#include "ScreenSongOptions.h" +#include "Character.h" + +#define PREV_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions2","PrevScreen"+Capitalize(PlayModeToString(play_mode))) +#define NEXT_SCREEN( play_mode ) THEME->GetMetric ("ScreenPlayerOptions2","NextScreen"+Capitalize(PlayModeToString(play_mode))) + +enum { + PO_EFFECT, + PO_TRANSFORM, + PO_NOTE_SKIN, + PO_PERSPECTIVE, + PO_CHARACTER, + NUM_PLAYER_OPTIONS2_LINES +}; +OptionRow g_PlayerOptions2Lines[NUM_PLAYER_OPTIONS2_LINES] = { + OptionRow( "Effect", "OFF","DRUNK","DIZZY","MINI","FLIP","TORNADO" ), + OptionRow( "Trans\n-form", "OFF","LITTLE","WIDE","BIG","QUICK","SKIPPY" ), + OptionRow( "Note\nSkin", "" ), + OptionRow( "Perspec\n-tive", "" ), + OptionRow( "Character", "" ), +}; + + +ScreenPlayerOptions2::ScreenPlayerOptions2() : + ScreenOptions("ScreenPlayerOptions2",true) +{ + LOG->Trace( "ScreenPlayerOptions2::ScreenPlayerOptions2()" ); + + Init( + INPUTMODE_PLAYERS, + g_PlayerOptions2Lines, + NUM_PLAYER_OPTIONS2_LINES, + true, false ); + + /* If we're going to "press start for more options" or skipping options + * entirely, we need a different fade out. XXX: this is a hack */ + if(PREFSMAN->m_ShowSongOptions == PrefsManager::NO) + m_Menu.m_Out.Load( THEME->GetPathToB("ScreenPlayerOptions2 direct out") ); /* direct to stage */ + else if(PREFSMAN->m_ShowSongOptions == PrefsManager::ASK) + m_Menu.m_Out.Load( THEME->GetPathToB("ScreenPlayerOptions2 option out") ); /* optional song options */ + + m_sprOptionsMessage.Load( THEME->GetPathToG("ScreenPlayerOptions2 options") ); + m_sprOptionsMessage.StopAnimating(); + m_sprOptionsMessage.SetXY( CENTER_X, CENTER_Y ); + m_sprOptionsMessage.SetZoom( 1 ); + m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); + //this->AddChild( &m_sprOptionsMessage ); // we have to draw this manually over the top of transitions + + m_bAcceptedChoices = false; + m_bGoToOptions = ( PREFSMAN->m_ShowSongOptions == PrefsManager::YES ); + + SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") ); +} + + +void ScreenPlayerOptions2::ImportOptions() +{ + // + // fill in skin names + // + CStringArray arraySkinNames; + NOTESKIN->GetNoteSkinNames( arraySkinNames ); + + m_OptionRow[PO_NOTE_SKIN].choices.clear(); + + unsigned i; + for( i=0; im_pPosition->GetNamesForCurrentGame(arrayPosNames); + for( i=0; im_pCharacters.size(); i++ ) + { + CString s = GAMESTATE->m_pCharacters[i]->m_sName; + s.MakeUpper(); + m_OptionRow[PO_CHARACTER].choices.push_back( s ); + } + + + // + // Init options + // + for( int p=0; pIsHumanPlayer(p) ) + continue; // skip + + PlayerOptions &po = GAMESTATE->m_PlayerOptions[p]; + po.Init(); + + m_iSelectedOption[p][PO_EFFECT] = po.GetFirstEffect()+1; + m_iSelectedOption[p][PO_TRANSFORM] = po.m_Transform; + + + // highlight currently selected skin + m_iSelectedOption[p][PO_NOTE_SKIN] = -1; + for( unsigned j=0; j &choices = m_OptionRow[PO_PERSPECTIVE].choices; + for(unsigned n = 3; n < choices.size(); ++n) + if(!choices[n].CompareNoCase(GAMESTATE->m_PlayerOptions[p].m_sPositioning)) + m_iSelectedOption[p][PO_PERSPECTIVE] = n; + } + + for( i=0; im_pCharacters.size(); i++ ) + if( GAMESTATE->m_pCurCharacters[p] == GAMESTATE->m_pCharacters[i] ) + m_iSelectedOption[p][PO_CHARACTER] = i+1; + } +} + +void ScreenPlayerOptions2::ExportOptions() +{ + for( int p=0; pIsHumanPlayer(p) ) + continue; // skip + + PlayerOptions &po = GAMESTATE->m_PlayerOptions[p]; + po.Init(); + + if( m_iSelectedOption[p][PO_EFFECT] != 0 ) + po.SetOneEffect( (PlayerOptions::Effect)(m_iSelectedOption[p][PO_EFFECT]-1) ); + + po.m_Transform = (PlayerOptions::Transform)m_iSelectedOption[p][PO_TRANSFORM]; + + + int iSelectedSkin = m_iSelectedOption[p][PO_NOTE_SKIN]; + CString sNewSkin = m_OptionRow[PO_NOTE_SKIN].choices[iSelectedSkin]; + po.m_sNoteSkin = sNewSkin; + + + switch(m_iSelectedOption[p][PO_PERSPECTIVE]) + { + case 0: po.m_fPerspectiveTilt = -1; break; + case 2: po.m_fPerspectiveTilt = 1; break; + default:po.m_fPerspectiveTilt = 0; break; + } + if(m_iSelectedOption[p][PO_PERSPECTIVE] > 2) + { + const int choice = m_iSelectedOption[p][PO_PERSPECTIVE]; + GAMESTATE->m_PlayerOptions[p].m_sPositioning = m_OptionRow[PO_PERSPECTIVE].choices[choice]; + } + + if(m_iSelectedOption[p][PO_PERSPECTIVE] > 2) + { + const int choice = m_iSelectedOption[p][PO_PERSPECTIVE]; + GAMESTATE->m_PlayerOptions[p].m_sPositioning = m_OptionRow[PO_PERSPECTIVE].choices[choice]; + } + + if( m_iSelectedOption[p][PO_CHARACTER] > 0 ) + { + int choice = m_iSelectedOption[p][PO_CHARACTER] - 1; + GAMESTATE->m_pCurCharacters[p] = GAMESTATE->m_pCharacters[choice]; + } + else + GAMESTATE->m_pCurCharacters[p] = NULL; + } +} + +void ScreenPlayerOptions2::GoToPrevState() +{ + if( GAMESTATE->m_bEditing ) + SCREENMAN->PopTopScreen(); + else + SCREENMAN->SetNewScreen( PREV_SCREEN(GAMESTATE->m_PlayMode) ); +} + +void ScreenPlayerOptions2::GoToNextState() +{ + if( GAMESTATE->m_bEditing ) + SCREENMAN->PopTopScreen(); + else if( m_bGoToOptions ) + SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) ); + else + SCREENMAN->SetNewScreen( ScreenSongOptions::GetNextScreen() ); +} + + +void ScreenPlayerOptions2::Update( float fDelta ) +{ + ScreenOptions::Update( fDelta ); + m_sprOptionsMessage.Update( fDelta ); +} + +void ScreenPlayerOptions2::DrawPrimitives() +{ + ScreenOptions::DrawPrimitives(); + m_sprOptionsMessage.Draw(); +} + + +void ScreenPlayerOptions2::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) +{ + if( !GAMESTATE->m_bEditing && + type == IET_FIRST_PRESS && + !m_Menu.m_In.IsTransitioning() && + MenuI.IsValid() && + MenuI.button == MENU_BUTTON_START && + PREFSMAN->m_ShowSongOptions == PrefsManager::ASK ) + { + if( m_bAcceptedChoices && !m_bGoToOptions ) + { + m_bGoToOptions = true; + m_sprOptionsMessage.SetState( 1 ); + SOUNDMAN->PlayOnce( THEME->GetPathToS("Common start") ); + } + } + + ScreenOptions::Input( DeviceI, type, GameI, MenuI, StyleI ); +} + +void ScreenPlayerOptions2::HandleScreenMessage( const ScreenMessage SM ) +{ + if(PREFSMAN->m_ShowSongOptions == PrefsManager::ASK) + switch( SM ) + { + case SM_BeginFadingOut: // when the user accepts the page of options + { + m_bAcceptedChoices = true; + + float fShowSeconds = m_Menu.m_Out.GetLengthSeconds(); + + // show "hold START for options" + m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); + m_sprOptionsMessage.BeginTweening( 0.15f ); // fade in + m_sprOptionsMessage.SetZoomY( 1 ); + m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,1) ); + m_sprOptionsMessage.BeginTweening( fShowSeconds-0.3f ); // sleep + m_sprOptionsMessage.BeginTweening( 0.15f ); // fade out + m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); + m_sprOptionsMessage.SetZoomY( 0 ); + } + break; + } + ScreenOptions::HandleScreenMessage( SM ); +} \ No newline at end of file diff --git a/stepmania/src/ScreenPlayerOptions2.h b/stepmania/src/ScreenPlayerOptions2.h new file mode 100644 index 0000000000..fb7f8a391a --- /dev/null +++ b/stepmania/src/ScreenPlayerOptions2.h @@ -0,0 +1,42 @@ +#ifndef ScreenPlayerOptions2_H +#define ScreenPlayerOptions2_H +/* +----------------------------------------------------------------------------- + Class: ScreenPlayerOptions2 + + Desc: Select a song. + + Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford +----------------------------------------------------------------------------- +*/ + +#include "ScreenOptions.h" +#include "PrefsManager.h" + + +class ScreenPlayerOptions2 : public ScreenOptions +{ +public: + ScreenPlayerOptions2(); + + virtual void Update( float fDelta ); + virtual void DrawPrimitives(); + virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); + virtual void HandleScreenMessage( const ScreenMessage SM ); + +private: + void ImportOptions(); + void ExportOptions(); + + void GoToNextState(); + void GoToPrevState(); + + bool m_bAcceptedChoices; + bool m_bGoToOptions; + Sprite m_sprOptionsMessage; +}; + + + +#endif diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 1ff6a4ae86..3b61d6af3e 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -225,14 +225,14 @@ ScreenSelectMusic::~ScreenSelectMusic() void ScreenSelectMusic::DrawPrimitives() { - DISPLAY->LoadMenuPerspective(FOV); +// DISPLAY->LoadMenuPerspective(FOV); m_Menu.DrawBottomLayer(); Screen::DrawPrimitives(); m_Menu.DrawTopLayer(); m_sprOptionsMessage.Draw(); - DISPLAY->LoadMenuPerspective(0); +// DISPLAY->LoadMenuPerspective(0); } void ScreenSelectMusic::TweenOnScreen()