diff --git a/stepmania/src/ModeChoice.cpp b/stepmania/src/GameCommand.cpp similarity index 97% rename from stepmania/src/ModeChoice.cpp rename to stepmania/src/GameCommand.cpp index 81ff32ff09..a3461bc590 100644 --- a/stepmania/src/ModeChoice.cpp +++ b/stepmania/src/GameCommand.cpp @@ -1,5 +1,5 @@ #include "global.h" -#include "ModeChoice.h" +#include "GameCommand.h" #include "RageUtil.h" #include "RageLog.h" #include "GameManager.h" @@ -18,7 +18,7 @@ #include "Style.h" #include "Foreach.h" -void ModeChoice::Init() +void GameCommand::Init() { m_sName = ""; m_bInvalid = true; @@ -40,7 +40,7 @@ void ModeChoice::Init() bool CompareSongOptions( const SongOptions &so1, const SongOptions &so2 ); -bool ModeChoice::DescribesCurrentModeForAllPlayers() const +bool GameCommand::DescribesCurrentModeForAllPlayers() const { FOREACH_HumanPlayer( pn ) if( !DescribesCurrentMode(pn) ) @@ -49,7 +49,7 @@ bool ModeChoice::DescribesCurrentModeForAllPlayers() const return true; } -bool ModeChoice::DescribesCurrentMode( PlayerNumber pn ) const +bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const { if( m_pGame != NULL && m_pGame != GAMESTATE->m_pCurGame ) return false; @@ -97,7 +97,7 @@ bool ModeChoice::DescribesCurrentMode( PlayerNumber pn ) const return true; } -void ModeChoice::Load( int iIndex, const ActorCommands& acs ) +void GameCommand::Load( int iIndex, const ActorCommands& acs ) { m_iIndex = iIndex; @@ -294,7 +294,7 @@ static bool AreStyleAndPlayModeCompatible( const Style *style, PlayMode pm ) return true; } -bool ModeChoice::IsPlayable( CString *why ) const +bool GameCommand::IsPlayable( CString *why ) const { if( m_bInvalid ) { @@ -401,7 +401,7 @@ bool ModeChoice::IsPlayable( CString *why ) const return true; } -void ModeChoice::ApplyToAllPlayers() const +void GameCommand::ApplyToAllPlayers() const { FOREACH_HumanPlayer( pn ) Apply( pn); @@ -410,7 +410,7 @@ void ModeChoice::ApplyToAllPlayers() const SCREENMAN->SetNewScreen( m_sScreen ); } -void ModeChoice::Apply( PlayerNumber pn ) const +void GameCommand::Apply( PlayerNumber pn ) const { if( !GAMESTATE->IsHumanPlayer(pn) ) return; @@ -493,7 +493,7 @@ void ModeChoice::Apply( PlayerNumber pn ) const GAMESTATE->m_SongOptions.m_LifeType = SongOptions::LIFE_BATTERY; } -bool ModeChoice::IsZero() const +bool GameCommand::IsZero() const { if( m_pGame != NULL || m_pm != PLAY_MODE_INVALID || diff --git a/stepmania/src/ModeChoice.h b/stepmania/src/GameCommand.h similarity index 94% rename from stepmania/src/ModeChoice.h rename to stepmania/src/GameCommand.h index 0ec8674b99..9ba38227a7 100644 --- a/stepmania/src/ModeChoice.h +++ b/stepmania/src/GameCommand.h @@ -1,7 +1,7 @@ -/* ModeChoice */ +/* GameCommand */ -#ifndef MODECHOICE_H -#define MODECHOICE_H +#ifndef GameCommand_H +#define GameCommand_H #include "GameConstantsAndTypes.h" #include "PlayerNumber.h" @@ -16,9 +16,9 @@ class Style; class Game; struct ActorCommands; -struct ModeChoice // used in SelectMode +struct GameCommand // used in SelectMode { - ModeChoice() { Init(); } + GameCommand() { Init(); } void Init(); void Load( int iIndex, const ActorCommands& acs ); diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 97b30ee4af..0f80e4e2bb 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -11,7 +11,7 @@ #include "SongManager.h" #include "Steps.h" #include "NoteSkinManager.h" -#include "ModeChoice.h" +#include "GameCommand.h" #include "NoteFieldPositioning.h" #include "Character.h" #include "UnlockSystem.h" @@ -85,7 +85,7 @@ void GameState::ApplyCmdline() CString sMode; for( int i = 0; GetCommandlineArgument( "mode", &sMode, i ); ++i ) { - ModeChoice m; + GameCommand m; m.Load( 0, ParseActorCommands(sMode) ); CString why; if( !m.IsPlayable(&why) ) @@ -175,7 +175,7 @@ void GameState::Reset() // one or the other. -Chris // Having default modifiers in prefs is needed for several things. // The theme setting is for eg. BM being reverse by default. (This - // could be done in the title menu ModeChoice, but then it wouldn't + // could be done in the title menu GameCommand, but then it wouldn't // affect demo, and other non-gameplay things ...) -glenn ApplyModifiers( p, DEFAULT_MODIFIERS ); ApplyModifiers( p, PREFSMAN->m_sDefaultModifiers ); @@ -256,7 +256,7 @@ void GameState::PlayersFinalized() GAMESTATE->m_PlayerOptions[pn].ResetSavedPrefs(); GAMESTATE->ApplyModifiers( pn, sModifiers ); } - // Only set the sort order if it wasn't already set by a ModeChoice (or by an earlier profile) + // Only set the sort order if it wasn't already set by a GameCommand (or by an earlier profile) if( m_SortOrder == SORT_INVALID && pProfile->m_SortOrder != SORT_INVALID ) m_SortOrder = pProfile->m_SortOrder; if( pProfile->m_LastDifficulty != DIFFICULTY_INVALID ) @@ -584,7 +584,7 @@ static int GetNumStagesForCurrentSong() * stage is the final stage, and we picked a stage that takes two songs, it * only counts as one stage (so it doesn't bump us all the way to Ex2). * One case where this happens is a long/marathon extra stage. Another is - * if a long/marathon song is selected explicitly in the theme with a ModeChoice, + * if a long/marathon song is selected explicitly in the theme with a GameCommand, * and PREFSMAN->m_iNumArcadeStages is less than the number of stages that * song takes. */ int iNumStagesLeft = PREFSMAN->m_iNumArcadeStages - GAMESTATE->m_iCurrentStageIndex; diff --git a/stepmania/src/Makefile.am b/stepmania/src/Makefile.am index 44e30ec6f4..c89d795a39 100644 --- a/stepmania/src/Makefile.am +++ b/stepmania/src/Makefile.am @@ -56,9 +56,10 @@ Attack.cpp Attack.h AutoKeysounds.cpp AutoKeysounds.h BannerCache.cpp BannerCach Character.cpp Character.h CharacterHead.cpp CharacterHead.h \ CodeDetector.cpp CodeDetector.h Difficulty.cpp Difficulty.h EnumHelper.cpp EnumHelper.h Course.cpp Course.h \ CourseUtil.cpp CourseUtil.h DateTime.cpp DateTime.h Font.cpp Font.h FontCharAliases.cpp FontCharAliases.h \ -FontCharmaps.cpp FontCharmaps.h Game.cpp Game.h GameConstantsAndTypes.cpp GameConstantsAndTypes.h \ +FontCharmaps.cpp FontCharmaps.h Game.cpp Game.h GameCommand.cpp GameCommand.h \ +GameConstantsAndTypes.cpp GameConstantsAndTypes.h \ GameInput.cpp GameInput.h Grade.cpp Grade.h HighScore.cpp HighScore.h Inventory.cpp Inventory.h LuaFunctions.h \ -LuaHelpers.cpp LuaHelpers.h LyricsLoader.cpp LyricsLoader.h MenuInput.h ModeChoice.cpp ModeChoice.h \ +LuaHelpers.cpp LuaHelpers.h LyricsLoader.cpp LyricsLoader.h MenuInput.h \ NoteData.cpp NoteData.h NoteDataUtil.cpp NoteDataUtil.h NoteDataWithScoring.cpp NoteDataWithScoring.h \ NoteFieldPositioning.cpp NoteFieldPositioning.h NoteTypes.cpp NoteTypes.h NotesLoader.cpp NotesLoader.h \ NotesLoaderBMS.cpp NotesLoaderBMS.h NotesLoaderDWI.cpp NotesLoaderDWI.h NotesLoaderKSF.cpp NotesLoaderKSF.h \ diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 38e49da7c3..12327b1210 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -17,7 +17,7 @@ #include "Banner.h" #include "Steps.h" #include "UnlockSystem.h" -#include "ModeChoice.h" +#include "GameCommand.h" #include "ActorUtil.h" #include "SongUtil.h" #include "CourseUtil.h" diff --git a/stepmania/src/MusicWheelItem.h b/stepmania/src/MusicWheelItem.h index d8e55951f2..3bb1bae975 100644 --- a/stepmania/src/MusicWheelItem.h +++ b/stepmania/src/MusicWheelItem.h @@ -9,7 +9,7 @@ #include "WheelNotifyIcon.h" #include "TextBanner.h" #include "GameConstantsAndTypes.h" -#include "ModeChoice.h" +#include "GameCommand.h" class Course; class Song; @@ -77,7 +77,7 @@ struct WheelItemData // for TYPE_SORT CString m_sLabel; - ModeChoice m_Action; + GameCommand m_Action; SortOrder m_SortOrder; }; diff --git a/stepmania/src/ScreenBranch.cpp b/stepmania/src/ScreenBranch.cpp index 4f9a5f3d2b..b7e3215861 100644 --- a/stepmania/src/ScreenBranch.cpp +++ b/stepmania/src/ScreenBranch.cpp @@ -4,7 +4,7 @@ #include "ScreenManager.h" #include "ThemeManager.h" #include "LuaHelpers.h" -#include "ModeChoice.h" +#include "GameCommand.h" #include "RageUtil.h" #define CHOICES THEME->GetMetric (m_sName,"Choices") @@ -43,7 +43,7 @@ void ScreenBranch::HandleScreenMessage( const ScreenMessage SM ) CString sNextScreen = NEXT_SCREEN(m_sChoice); LOG->Trace( "Branching to '%s'", sNextScreen.c_str() ); - ModeChoice mc; + GameCommand mc; mc.Load( 0, ParseActorCommands(sNextScreen) ); if( mc.m_sScreen == "" ) RageException::Throw("Metric %s::%s must set \"screen\"", diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index 9824fb9b04..c13968adbd 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -50,7 +50,7 @@ void ScreenOptionsMaster::SetList( OptionRowData &row, OptionRowHandler &hand, C { arraySkinNames[skin].MakeUpper(); - ModeChoice mc; + GameCommand mc; mc.m_sModifiers = arraySkinNames[skin]; hand.ListEntries.push_back( mc ); row.choices.push_back( arraySkinNames[skin] ); @@ -78,7 +78,7 @@ void ScreenOptionsMaster::SetList( OptionRowData &row, OptionRowHandler &hand, C for( int col = 0; col < NumCols; ++col ) { - ModeChoice mc; + GameCommand mc; mc.Load( 0, ParseActorCommands(ENTRY_MODE(ListName, col)) ); if( mc.m_sName == "" ) RageException::Throw( "List \"%s\", col %i has no name", ListName.c_str(), col ); @@ -104,7 +104,7 @@ void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand ) if( GAMESTATE->m_bEditing ) { row.choices.push_back( "" ); - hand.ListEntries.push_back( ModeChoice() ); + hand.ListEntries.push_back( GameCommand() ); } else if( GAMESTATE->IsCourseMode() ) // playing a course { @@ -118,7 +118,7 @@ void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand ) CString s = CourseDifficultyToThemedString( pTrail->m_CourseDifficulty ); row.choices.push_back( s ); - ModeChoice mc; + GameCommand mc; mc.m_pTrail = pTrail; hand.ListEntries.push_back( mc ); } @@ -140,7 +140,7 @@ void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand ) s += ssprintf( " (%d)", pSteps->GetMeter() ); row.choices.push_back( s ); - ModeChoice mc; + GameCommand mc; mc.m_pSteps = pSteps; mc.m_dc = pSteps->GetDifficulty(); hand.ListEntries.push_back( mc ); @@ -174,7 +174,7 @@ void ScreenOptionsMaster::SetCharacter( OptionRowData &row, OptionRowHandler &ha { row.choices.push_back( ENTRY_NAME("Off") ); - ModeChoice mc; + GameCommand mc; mc.m_pCharacter = GAMESTATE->GetDefaultCharacter(); hand.ListEntries.push_back( mc ); } @@ -188,7 +188,7 @@ void ScreenOptionsMaster::SetCharacter( OptionRowData &row, OptionRowHandler &ha s.MakeUpper(); row.choices.push_back( s ); - ModeChoice mc; + GameCommand mc; mc.m_pCharacter = pCharacter; hand.ListEntries.push_back( mc ); } @@ -290,7 +290,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ): if( m_OptionsNavigation == NAV_TOGGLE_THREE_KEY ) { row.choices.insert( row.choices.begin(), ENTRY_NAME("NextRow") ); - hand.ListEntries.insert( hand.ListEntries.begin(), ModeChoice() ); + hand.ListEntries.insert( hand.ListEntries.begin(), GameCommand() ); } OptionRowHandlers.push_back( hand ); @@ -326,7 +326,7 @@ void ScreenOptionsMaster::ImportOption( const OptionRowData &row, const OptionRo for( unsigned e = 0; e < hand.ListEntries.size(); ++e ) { - const ModeChoice &mc = hand.ListEntries[e]; + const GameCommand &mc = hand.ListEntries[e]; vbSelectedOut[e] = false; @@ -522,7 +522,7 @@ void ScreenOptionsMaster::ExportOptions() if( hand.type == ROW_LIST ) { const int choice = m_Rows[row]->m_iChoiceWithFocus[0]; - const ModeChoice &mc = hand.ListEntries[choice]; + const GameCommand &mc = hand.ListEntries[choice]; if( mc.m_sScreen != "" ) m_NextScreen = mc.m_sScreen; } diff --git a/stepmania/src/ScreenOptionsMaster.h b/stepmania/src/ScreenOptionsMaster.h index 1b9a06c2fd..35bf3298e3 100644 --- a/stepmania/src/ScreenOptionsMaster.h +++ b/stepmania/src/ScreenOptionsMaster.h @@ -2,7 +2,7 @@ #define SCREEN_OPTIONS_MASTER_H #include "ScreenOptions.h" -#include "ModeChoice.h" +#include "GameCommand.h" struct ConfOption; @@ -30,8 +30,8 @@ private: OptionRowType type; /* ROW_LIST: */ - vector ListEntries; - ModeChoice Default; + vector ListEntries; + GameCommand Default; /* ROW_CONFIG: */ const ConfOption *opt; diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index 133ee6737e..d797dff735 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -12,7 +12,7 @@ #include "GameState.h" #include "GameConstantsAndTypes.h" #include "ThemeManager.h" -#include "ModeChoice.h" +#include "GameCommand.h" #include "RageDisplay.h" #include "UnlockSystem.h" #include "arch/ArchHooks/ArchHooks.h" @@ -49,10 +49,10 @@ ScreenSelect::ScreenSelect( CString sClassName ) : ScreenWithMenuElements(sClass CString sChoiceName = asChoiceNames[c]; CString sChoice = CHOICE(sChoiceName); - ModeChoice mc; + GameCommand mc; mc.m_sName = sChoiceName; mc.Load( c, ParseActorCommands(sChoice) ); - m_aModeChoices.push_back( mc ); + m_aGameCommands.push_back( mc ); CString sBGAnimationDir = THEME->GetPath(BGAnimations, m_sName, mc.m_sName, true); // true="optional" if( sBGAnimationDir == "" ) @@ -73,12 +73,12 @@ ScreenSelect::ScreenSelect( CString sClassName ) : ScreenWithMenuElements(sClass m_aCodes.push_back( code ); m_aCodeActions.push_back( CODE_ACTION(c) ); - ModeChoice mc; + GameCommand mc; mc.Load( c, ParseActorCommands(CODE_ACTION(c)) ); m_aCodeChoices.push_back( mc ); } - if( !m_aModeChoices.size() ) + if( !m_aGameCommands.size() ) RageException::Throw( "Screen \"%s\" does not set any choices", m_sName.c_str() ); // derived classes can override if they want @@ -176,8 +176,8 @@ void ScreenSelect::FinalizeChoices() FOREACH_HumanPlayer( p ) { const int sel = GetSelectionIndex( p ); - if( m_aModeChoices[sel].m_pStyle ) - GAMESTATE->m_pCurStyle = m_aModeChoices[sel].m_pStyle; + if( m_aGameCommands[sel].m_pStyle ) + GAMESTATE->m_pCurStyle = m_aGameCommands[sel].m_pStyle; } SCREENMAN->RefreshCreditsMessages(); } @@ -203,7 +203,7 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM ) * long time (200+ms), and at SM_AllDoneChoosing, we're still tweening stuff * off-screen. */ FOREACH_HumanPlayer( p ) - m_aModeChoices[this->GetSelectionIndex(p)].Apply( p ); + m_aGameCommands[this->GetSelectionIndex(p)].Apply( p ); // // Finalize players if we set a style on this screen. @@ -211,7 +211,7 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM ) FOREACH_HumanPlayer( p ) { const int sel = GetSelectionIndex( p ); - if( m_aModeChoices[sel].m_pStyle ) + if( m_aGameCommands[sel].m_pStyle ) { GAMESTATE->PlayersFinalized(); break; @@ -219,8 +219,8 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM ) } const int iSelectionIndex = GetSelectionIndex(GAMESTATE->m_MasterPlayerNumber); - if( m_aModeChoices[iSelectionIndex].m_sScreen != "" ) - SCREENMAN->SetNewScreen( m_aModeChoices[iSelectionIndex ].m_sScreen ); + if( m_aGameCommands[iSelectionIndex].m_sScreen != "" ) + SCREENMAN->SetNewScreen( m_aGameCommands[iSelectionIndex ].m_sScreen ); else SCREENMAN->SetNewScreen( NEXT_SCREEN(iSelectionIndex) ); } diff --git a/stepmania/src/ScreenSelect.h b/stepmania/src/ScreenSelect.h index 212f913df2..cdd2a53ce7 100644 --- a/stepmania/src/ScreenSelect.h +++ b/stepmania/src/ScreenSelect.h @@ -5,7 +5,7 @@ #include "ScreenWithMenuElements.h" #include "BGAnimation.h" -#include "ModeChoice.h" +#include "GameCommand.h" #include "CodeDetector.h" // Derived classes must send this when done @@ -33,10 +33,10 @@ protected: void FinalizeChoices(); vector m_vpBGAnimations; - vector m_aModeChoices; // derived classes should look here for what choices are available + vector m_aGameCommands; // derived classes should look here for what choices are available vector m_aCodes; - vector m_aCodeChoices; + vector m_aCodeChoices; vector m_aCodeActions; }; diff --git a/stepmania/src/ScreenSelectDifficulty.cpp b/stepmania/src/ScreenSelectDifficulty.cpp index ab20e742e7..d4269e815f 100644 --- a/stepmania/src/ScreenSelectDifficulty.cpp +++ b/stepmania/src/ScreenSelectDifficulty.cpp @@ -7,7 +7,7 @@ #include "ThemeManager.h" #include "GameState.h" #include "AnnouncerManager.h" -#include "ModeChoice.h" +#include "GameCommand.h" #include "ActorUtil.h" #include "ScreenDimensions.h" @@ -38,18 +38,18 @@ ScreenSelectDifficulty::ScreenSelectDifficulty( CString sClassName ) : ScreenSel } unsigned c; // GCC is bitching again. - for( c=0; cIsHumanPlayer(p) ) @@ -142,7 +142,7 @@ int ScreenSelectDifficulty::GetSelectionIndex( PlayerNumber pn ) { int index = 0; for( int page=0; page=0; i-- ) { - const ModeChoice &mc = m_ModeChoices[m_CurrentPage][i]; - if( AnotherPlayerSelected && BothPlayersModeChoice(mc) ) + const GameCommand &mc = m_GameCommands[m_CurrentPage][i]; + if( AnotherPlayerSelected && BothPlayersGameCommand(mc) ) continue; if( mc.IsPlayable() ) { @@ -243,10 +243,10 @@ void ScreenSelectDifficulty::MenuRight( PlayerNumber pn ) AnotherPlayerSelected = true; int iSwitchToIndex = -1; - for( int i=m_iChoiceOnPage[pn]+1; i<(int) m_ModeChoices[m_CurrentPage].size(); i++ ) + for( int i=m_iChoiceOnPage[pn]+1; i<(int) m_GameCommands[m_CurrentPage].size(); i++ ) { - const ModeChoice &mc = m_ModeChoices[m_CurrentPage][i]; - if( AnotherPlayerSelected && BothPlayersModeChoice(mc) ) + const GameCommand &mc = m_GameCommands[m_CurrentPage][i]; + if( AnotherPlayerSelected && BothPlayersGameCommand(mc) ) continue; if( mc.IsPlayable() ) { @@ -257,7 +257,7 @@ void ScreenSelectDifficulty::MenuRight( PlayerNumber pn ) if( iSwitchToIndex == -1 ) { - if( m_ModeChoices[m_CurrentPage+1].size()==0 ) // there is no page 2 + if( m_GameCommands[m_CurrentPage+1].size()==0 ) // there is no page 2 return; if( m_CurrentPage < NUM_PAGES-1 ) @@ -290,18 +290,18 @@ void ScreenSelectDifficulty::ChangePage( Page newPage ) int iSwitchToIndex = -1; if( !bPageIncreasing ) { - for( int i=m_ModeChoices[newPage].size()-1; i>=0; i-- ) + for( int i=m_GameCommands[newPage].size()-1; i>=0; i-- ) { - if( m_ModeChoices[newPage][i].IsPlayable() ) + if( m_GameCommands[newPage][i].IsPlayable() ) { iSwitchToIndex = i; break; } } } else { - for( unsigned i=0; i= 0 && iNewChoice < (int) m_ModeChoices[m_CurrentPage].size(), ssprintf("%i, %i", iNewChoice, (int) m_ModeChoices[m_CurrentPage].size()) ); + ASSERT_M( iNewChoice >= 0 && iNewChoice < (int) m_GameCommands[m_CurrentPage].size(), ssprintf("%i, %i", iNewChoice, (int) m_GameCommands[m_CurrentPage].size()) ); bool bAnyChanged = false; FOREACH_HumanPlayer( p ) @@ -369,7 +369,7 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn ) for( int page=0; page= 0; --i ) { - const ModeChoice &mc = m_ModeChoices[m_CurrentPage][i]; - if( mc.IsPlayable() && !BothPlayersModeChoice(mc) ) + const GameCommand &mc = m_GameCommands[m_CurrentPage][i]; + if( mc.IsPlayable() && !BothPlayersGameCommand(mc) ) iSwitchToIndex = i; } } @@ -443,16 +443,16 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn ) if( bAnyPlayersLeft ) { - for( unsigned c=0; c m_ModeChoices[NUM_PAGES]; + vector m_GameCommands[NUM_PAGES]; Page m_CurrentPage; int m_iChoiceOnPage[NUM_PLAYERS]; diff --git a/stepmania/src/ScreenSelectMaster.cpp b/stepmania/src/ScreenSelectMaster.cpp index 05d130bcc1..f11ab982e5 100644 --- a/stepmania/src/ScreenSelectMaster.cpp +++ b/stepmania/src/ScreenSelectMaster.cpp @@ -7,7 +7,7 @@ #include "GameSoundManager.h" #include "GameState.h" #include "AnnouncerManager.h" -#include "ModeChoice.h" +#include "GameCommand.h" #include "ActorUtil.h" #include "RageLog.h" #include @@ -42,9 +42,9 @@ REGISTER_SCREEN_CLASS( ScreenSelectMaster ); ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sClassName ) { int iDefaultChoice = -1; - for( unsigned c=0; cAddChild( &m_Scroller[0] ); - for( unsigned c=0; cGetPathToG(sFName) ); @@ -123,9 +123,9 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl m_Scroller[p].SetName( ssprintf("ScrollerP%d",p+1) ); this->AddChild( &m_Scroller[p] ); - for( unsigned c=0; cGetPathToG(sFName) ); @@ -136,9 +136,9 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl } } - for( unsigned c=0; c= m_aModeChoices.size() || - to >= m_aModeChoices.size() ) + if( from >= m_aGameCommands.size() || + to >= m_aGameCommands.size() ) { LOG->Warn( "%s::OptionOrder%s out of range", m_sName.c_str(), dirname.c_str() ); continue; @@ -328,18 +328,18 @@ int ScreenSelectMaster::GetSelectionIndex( PlayerNumber pn ) void ScreenSelectMaster::UpdateSelectableChoices() { - for( unsigned c=0; cIsHumanPlayer(p) ) continue; - if( !m_aModeChoices[m_iChoice[p]].IsPlayable() ) + if( !m_aGameCommands[m_iChoice[p]].IsPlayable() ) Move( (PlayerNumber) p, DIR_AUTO ); - ASSERT( m_aModeChoices[m_iChoice[p]].IsPlayable() ); + ASSERT( m_aGameCommands[m_iChoice[p]].IsPlayable() ); } } @@ -356,7 +356,7 @@ bool ScreenSelectMaster::Move( PlayerNumber pn, Dirs dir ) return false; // went full circle and none found seen.insert( iSwitchToIndex ); } - while( !m_aModeChoices[iSwitchToIndex].IsPlayable() ); + while( !m_aGameCommands[iSwitchToIndex].IsPlayable() ); return ChangeSelection( pn, iSwitchToIndex ); } @@ -417,7 +417,7 @@ bool ScreenSelectMaster::ChangePage( int iNewChoice ) const CString sIconAndExplanationCommand = ssprintf( "SwitchToPage%d", newPage+1 ); - for( unsigned c=0; cPlayOnceFromDir( ANNOUNCER->GetPathTo(ssprintf("%s comment %s",m_sName.c_str(), mc.m_sName.c_str())) ); SCREENMAN->PlayStartSound(); @@ -635,7 +635,7 @@ void ScreenSelectMaster::MenuStart( PlayerNumber pn ) */ void ScreenSelectMaster::TweenOnScreen() { - for( unsigned c=0; cGetPathToS("ScreenSelectMode modeconfirm")); m_soundStart.Load( THEME->GetPathToS("ScreenSelectMode menustart")); - for( unsigned i=0; iSetLightsMode( LIGHTSMODE_MENU ); - for( unsigned i=0; im_aModeChoices.size(); i++ ) + for( unsigned i=0; im_aGameCommands.size(); i++ ) this->MoveToTail( &m_sprPicture[i] ); - for( unsigned i=0; im_aModeChoices.size(); i++ ) + for( unsigned i=0; im_aGameCommands.size(); i++ ) this->MoveToTail( &m_sprInfo[i] ); @@ -121,7 +121,7 @@ ScreenSelectStyle::ScreenSelectStyle( CString sClassName ) : ScreenSelect( sClas // // TweenOnScreen // - for( unsigned i=0; i=0; i-- ) { - if( m_aModeChoices[i].IsPlayable() ) + if( m_aGameCommands[i].IsPlayable() ) { iSwitchToIndex = i; break; @@ -158,9 +158,9 @@ void ScreenSelectStyle::MenuLeft( PlayerNumber pn ) void ScreenSelectStyle::MenuRight( PlayerNumber pn ) { int iSwitchToIndex = -1; // -1 means none found - for( unsigned i=m_iSelection+1; iPlayStartSound(); SCREENMAN->SendMessageToTopScreen( SM_AllDoneChoosing ); - const ModeChoice& mc = m_aModeChoices[GetSelectionIndex(pn)]; + const GameCommand& mc = m_aGameCommands[GetSelectionIndex(pn)]; SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo(ssprintf("%s comment %s",m_sName.c_str(),mc.m_sName.c_str())) ); // // TweenOffScreen // - for( unsigned i=0; iGetPathToF("ScreenTitleMenu choices") ); m_textChoice[i].SetHorizAlign( (enum Actor::HorizAlign)MENU_TEXT_ALIGN ); @@ -180,7 +180,7 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam m_Choice = 0; - for( unsigned i=0; iSetNewScreen( "ScreenTitleMenu" ); @@ -261,7 +261,7 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty break; case MENU_BUTTON_START: /* return if the choice is invalid */ - const ModeChoice &mc = m_aModeChoices[m_Choice]; + const GameCommand &mc = m_aGameCommands[m_Choice]; CString why; if( !mc.IsPlayable( &why ) ) { @@ -366,7 +366,7 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM ) GAMESTATE->m_PlayerOptions[p].FromString( PREFSMAN->m_sDefaultModifiers ); GAMESTATE->m_SongOptions.FromString( PREFSMAN->m_sDefaultModifiers ); } - m_aModeChoices[m_Choice].ApplyToAllPlayers(); + m_aGameCommands[m_Choice].ApplyToAllPlayers(); break; case SM_GoToAttractLoop: SCREENMAN->SetNewScreen( INITIAL_SCREEN ); diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 14c4a57753..95c57d6f1e 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 60000 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 @@ -62,7 +62,7 @@ IntDir=.\../Debug6 TargetDir=\stepmania\stepmania\Program TargetName=StepMania-debug SOURCE="$(InputPath)" -PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi # End Special Build Tool @@ -99,7 +99,7 @@ IntDir=.\../Release6 TargetDir=\stepmania\stepmania\Program TargetName=StepMania SOURCE="$(InputPath)" -PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi # End Special Build Tool @@ -740,6 +740,14 @@ SOURCE=.\Game.h # End Source File # Begin Source File +SOURCE=.\GameCommand.cpp +# End Source File +# Begin Source File + +SOURCE=.\GameCommand.h +# End Source File +# Begin Source File + SOURCE=.\GameConstantsAndTypes.cpp # End Source File # Begin Source File @@ -804,14 +812,6 @@ SOURCE=.\LyricsLoader.h # End Source File # Begin Source File -SOURCE=.\ModeChoice.cpp -# End Source File -# Begin Source File - -SOURCE=.\ModeChoice.h -# End Source File -# Begin Source File - SOURCE=.\NoteData.cpp # End Source File # Begin Source File diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index f3aa6a645c..4686fd6f19 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -683,6 +683,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ + + + + @@ -731,12 +737,6 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ - - - - @@ -2403,18 +2403,18 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ - - - - + + + +