From 96c29c65666eb10db0d9de4960a1fa8c01c74454 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 16 Jun 2003 17:24:53 +0000 Subject: [PATCH] remove ScreenPlayerOptions2 --- stepmania/src/Screen.cpp | 2 - stepmania/src/ScreenPlayerOptions2.cpp | 297 ------------------------- stepmania/src/ScreenPlayerOptions2.h | 42 ---- 3 files changed, 341 deletions(-) delete mode 100644 stepmania/src/ScreenPlayerOptions2.cpp delete mode 100644 stepmania/src/ScreenPlayerOptions2.h diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index 033f85788a..dfbb692cf1 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -255,7 +255,6 @@ 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" @@ -322,7 +321,6 @@ 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/ScreenPlayerOptions2.cpp b/stepmania/src/ScreenPlayerOptions2.cpp deleted file mode 100644 index 20314d7a38..0000000000 --- a/stepmania/src/ScreenPlayerOptions2.cpp +++ /dev/null @@ -1,297 +0,0 @@ -#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 deleted file mode 100644 index fb7f8a391a..0000000000 --- a/stepmania/src/ScreenPlayerOptions2.h +++ /dev/null @@ -1,42 +0,0 @@ -#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