From a2915c038be0dcbac59811268977d508daa0c3c8 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 21 Feb 2005 17:29:49 +0000 Subject: [PATCH] add TemporaryEventMode flag to GameState --- stepmania/src/GameCommand.cpp | 8 ++-- stepmania/src/GameState.cpp | 59 +++++++++++++++++++++-------- stepmania/src/GameState.h | 11 ++++++ stepmania/src/LifeMeterBar.cpp | 2 +- stepmania/src/LuaBinding.h | 2 +- stepmania/src/MusicWheel.cpp | 4 +- stepmania/src/PrefsManager.cpp | 23 +---------- stepmania/src/PrefsManager.h | 2 - stepmania/src/ProfileManager.cpp | 4 +- stepmania/src/Screen.cpp | 4 +- stepmania/src/ScreenAttract.cpp | 2 +- stepmania/src/ScreenEvaluation.cpp | 6 ++- stepmania/src/ScreenGameplay.cpp | 2 +- stepmania/src/ScreenNameEntry.cpp | 2 +- stepmania/src/ScreenSelect.cpp | 2 +- stepmania/src/ScreenSelectMode.cpp | 4 +- stepmania/src/ScreenSelectMusic.cpp | 2 +- stepmania/src/ScreenSelectStyle.cpp | 2 +- stepmania/src/ScreenSystemLayer.cpp | 2 +- stepmania/src/ScreenTitleMenu.cpp | 4 +- stepmania/src/StepMania.cpp | 2 +- 21 files changed, 85 insertions(+), 64 deletions(-) diff --git a/stepmania/src/GameCommand.cpp b/stepmania/src/GameCommand.cpp index 1007368161..8d3161d5aa 100644 --- a/stepmania/src/GameCommand.cpp +++ b/stepmania/src/GameCommand.cpp @@ -392,7 +392,7 @@ int GetNumCreditsPaid() int iNumCreditsPaid = GAMESTATE->GetNumSidesJoined(); // players other than the first joined for free - if( PREFSMAN->GetPremium() == PREMIUM_JOINT ) + if( GAMESTATE->GetPremium() == PREMIUM_JOINT ) iNumCreditsPaid = min( iNumCreditsPaid, 1 ); return iNumCreditsPaid; @@ -401,7 +401,7 @@ int GetNumCreditsPaid() int GetCreditsRequiredToPlayStyle( const Style *style ) { - if( PREFSMAN->GetPremium() == PREMIUM_JOINT ) + if( GAMESTATE->GetPremium() == PREMIUM_JOINT ) return 1; switch( style->m_StyleType ) @@ -411,7 +411,7 @@ int GetCreditsRequiredToPlayStyle( const Style *style ) case TWO_PLAYERS_TWO_SIDES: return 2; case ONE_PLAYER_TWO_SIDES: - return (PREFSMAN->GetPremium() == PREMIUM_DOUBLES) ? 1 : 2; + return (GAMESTATE->GetPremium() == PREMIUM_DOUBLES) ? 1 : 2; default: ASSERT(0); return 1; @@ -457,7 +457,7 @@ bool GameCommand::IsPlayable( CString *why ) const const int iNumCreditsPaid = GetNumCreditsPaid(); const int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_pStyle); - switch( PREFSMAN->GetCoinMode() ) + switch( GAMESTATE->GetCoinMode() ) { case COIN_HOME: case COIN_FREE: diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 25c063c500..ed8652f05a 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -204,6 +204,8 @@ void GameState::Reset() m_iStopCourseAtSeconds = -1; + m_bTemporaryEventMode = false; + LIGHTSMAN->SetLightsMode( LIGHTSMODE_ATTRACT ); ApplyCmdline(); @@ -700,7 +702,7 @@ void GameState::FinishStage() - if( PREFSMAN->m_bEventMode ) + if( GAMESTATE->GetEventMode() ) { const int iSaveProfileEvery = 3; if( iOldStageIndex/iSaveProfileEvery < m_iCurrentStageIndex/iSaveProfileEvery ) @@ -720,14 +722,14 @@ int GameState::GetNumStagesLeft() const { if( IsExtraStage() || IsExtraStage2() ) return 1; - if( PREFSMAN->m_bEventMode ) + if( GAMESTATE->GetEventMode() ) return 999; return PREFSMAN->m_iNumArcadeStages - m_iCurrentStageIndex; } bool GameState::IsFinalStage() const { - if( PREFSMAN->m_bEventMode ) + if( GAMESTATE->GetEventMode() ) return false; if( this->IsCourseMode() ) @@ -742,14 +744,14 @@ bool GameState::IsFinalStage() const bool GameState::IsExtraStage() const { - if( PREFSMAN->m_bEventMode ) + if( GAMESTATE->GetEventMode() ) return false; return m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages; } bool GameState::IsExtraStage2() const { - if( PREFSMAN->m_bEventMode ) + if( GAMESTATE->GetEventMode() ) return false; return m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages+1; } @@ -760,7 +762,7 @@ CString GameState::GetStageText() const else if( m_PlayMode == PLAY_MODE_ONI ) return "oni"; else if( m_PlayMode == PLAY_MODE_NONSTOP ) return "nonstop"; else if( m_PlayMode == PLAY_MODE_ENDLESS ) return "endless"; - else if( PREFSMAN->m_bEventMode ) return "event"; + else if( GAMESTATE->GetEventMode() ) return "event"; else if( IsFinalStage() ) return "final"; else if( IsExtraStage() ) return "extra1"; else if( IsExtraStage2() ) return "extra2"; @@ -815,7 +817,7 @@ bool GameState::PlayersCanJoin() const bool GameState::EnoughCreditsToJoin() const { - switch( PREFSMAN->GetCoinMode() ) + switch( GAMESTATE->GetCoinMode() ) { case COIN_PAY: return GAMESTATE->m_iCoins >= PREFSMAN->m_iCoinsPerCredit; @@ -962,7 +964,7 @@ bool GameState::IsBattleMode() const bool GameState::HasEarnedExtraStage() const { - if( PREFSMAN->m_bEventMode ) + if( GAMESTATE->GetEventMode() ) return false; if( !PREFSMAN->m_bAllowExtraStage ) @@ -1302,7 +1304,7 @@ void GameState::AdjustFailType() /* If beginner's steps were chosen, and this is the first stage, * turn off failure completely--always give a second try. */ if(dc == DIFFICULTY_BEGINNER && - !PREFSMAN->m_bEventMode && /* stage index is meaningless in event mode */ + GAMESTATE->GetEventMode() && /* stage index is meaningless in event mode */ this->m_iCurrentStageIndex == 0) setmax(this->m_SongOptions.m_FailType, SongOptions::FAIL_OFF); } @@ -1826,14 +1828,25 @@ Difficulty GameState::GetEasiestNotesDifficulty() const return dc; } -bool PlayerIsUsingModifier( PlayerNumber pn, const CString sModifier ) +bool GameState::GetEventMode() { - PlayerOptions po = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions; - SongOptions so = GAMESTATE->m_SongOptions; - po.FromString( sModifier ); - so.FromString( sModifier ); + return m_bTemporaryEventMode || PREFSMAN->m_bEventMode; +} - return po == GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions && so == GAMESTATE->m_SongOptions; +CoinMode GameState::GetCoinMode() +{ + if( GetEventMode() && PREFSMAN->m_CoinMode == COIN_PAY ) + return COIN_FREE; + else + return PREFSMAN->m_CoinMode; +} + +Premium GameState::GetPremium() +{ + if( GetEventMode() ) + return PREMIUM_NONE; + else + return PREFSMAN->m_Premium; } @@ -1860,6 +1873,9 @@ public: p->ApplyGameCommand(SArg(1),pn); return 0; } + static int GetCurrentCourse( T* p, lua_State *L ) { if(p->m_pCurCourse) p->m_pCurCourse->PushSelf(L); else lua_pushnil(L); return 1; } + static int SetCurrentCourse( T* p, lua_State *L ) { Course *pC = Luna::check(L,1); p->m_pCurCourse = pC; return 0; } + static int SetTemporaryEventMode( T* p, lua_State *L ) { p->m_bTemporaryEventMode = BArg(1); return 0; } static void Register(lua_State *L) { @@ -1868,6 +1884,9 @@ public: ADD_METHOD( GetPlayerDisplayName ) ADD_METHOD( GetMasterPlayerNumber ) ADD_METHOD( ApplyGameCommand ) + ADD_METHOD( GetCurrentCourse ) + ADD_METHOD( SetCurrentCourse ) + ADD_METHOD( SetTemporaryEventMode ) Luna::Register( L ); // add global singleton @@ -1912,6 +1931,16 @@ LuaFunction_StrStr( SetEnv, GAMESTATE->m_mapEnv[str1] = str2 ) LuaFunction_NoArgs( CurSong, GAMESTATE->m_pCurSong ) LuaFunction_PlayerNumber( CurSteps, GAMESTATE->m_pCurSteps[pn] ) +bool PlayerIsUsingModifier( PlayerNumber pn, const CString sModifier ) +{ + PlayerOptions po = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions; + SongOptions so = GAMESTATE->m_SongOptions; + po.FromString( sModifier ); + so.FromString( sModifier ); + + return po == GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions && so == GAMESTATE->m_SongOptions; +} + int LuaFunc_UsingModifier( lua_State *L ) { REQ_ARGS( "UsingModifier", 2 ); diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index a52671128b..c934c437f8 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -271,6 +271,17 @@ public: // int m_iStopCourseAtSeconds; // -1 == don't stop early + // + // Preference wrappers + // + // These options have weird interactions depending on m_bEventMode, + // so wrap them + bool m_bTemporaryEventMode; + bool GetEventMode(); + CoinMode GetCoinMode(); + Premium GetPremium(); + + // Lua void PushSelf( lua_State *L ); }; diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index e8d815b34b..704321dcf0 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -540,7 +540,7 @@ void LifeMeterBar::UpdateNonstopLifebar(const int cleared, // it isn't, do so here /* No, wait: if we're playing nonstop, event mode just means that we can play another * nonstop course later, so it shouldn't affect life difficulty. */ -/* if (PREFSMAN->m_bEventMode) +/* if (GAMESTATE->GetEventMode()) { m_fLifeDifficulty = m_fBaseLifeDifficulty; return; diff --git a/stepmania/src/LuaBinding.h b/stepmania/src/LuaBinding.h index f109b94bc3..017af4513e 100644 --- a/stepmania/src/LuaBinding.h +++ b/stepmania/src/LuaBinding.h @@ -66,7 +66,7 @@ public: lua_settable(L, metatable); // fill method table with methods from class T - for (unsigned i=0; isize(); i++ ) + for (unsigned i=0; s_pvMethods && isize(); i++ ) { const MyRegType *l = &(*s_pvMethods)[i]; lua_pushstring(L, l->name); diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index e4122cdb8f..ebfd64f1b8 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -232,7 +232,7 @@ void MusicWheel::Load() // but someone mentioned it does it sometimes. if( GAMESTATE->m_pCurSong != NULL && SongManager::GetNumStagesForSong( GAMESTATE->m_pCurSong ) + GAMESTATE->m_iCurrentStageIndex > PREFSMAN->m_iNumArcadeStages - && !PREFSMAN->m_bEventMode + && !GAMESTATE->GetEventMode() && !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() ) { GAMESTATE->m_pCurSong = NULL; @@ -477,7 +477,7 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelItemDatas case SORT_ONI_COURSES: case SORT_ENDLESS_COURSES: /* Don't display course modes after the first stage. */ - if( !PREFSMAN->m_bEventMode && GAMESTATE->m_iCurrentStageIndex ) + if( !GAMESTATE->GetEventMode() && GAMESTATE->m_iCurrentStageIndex ) continue; } diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 34b56edbf0..a60dc44bb9 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -837,13 +837,11 @@ class LunaPrefsManager : public Luna public: LunaPrefsManager() { LUA->Register( Register ); } - static int GetEventMode( T* p, lua_State *L ) { lua_pushboolean(L, p->m_bEventMode ); return 1; } - static int SetEventMode( T* p, lua_State *L ) { p->m_bEventMode = BArg(1); return 0; } +// static int GetEventMode( T* p, lua_State *L ) { lua_pushboolean(L, p->m_bEventMode ); return 1; } static void Register(lua_State *L) { - ADD_METHOD( GetEventMode ) - ADD_METHOD( SetEventMode ) +// ADD_METHOD( GetEventMode ) Luna::Register( L ); // Add global singleton if constructed already. If it's not constructed yet, @@ -862,23 +860,6 @@ LUA_REGISTER_CLASS( PrefsManager ) // lua end - -CoinMode PrefsManager::GetCoinMode() -{ - if( m_bEventMode && m_CoinMode == COIN_PAY ) - return COIN_FREE; - else - return m_CoinMode; -} - -Premium PrefsManager::GetPremium() -{ - if(m_bEventMode) - return PREMIUM_NONE; - else - return m_Premium; -} - #include "RageLog.h" #include "LuaFunctions.h" diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 35a6dba2d3..59e1b0b36e 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -149,8 +149,6 @@ public: // so wrap them. CoinMode m_CoinMode; Premium m_Premium; - CoinMode GetCoinMode(); - Premium GetPremium(); bool m_bDelayedCreditsReconcile; bool m_bPickExtraStage; diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index a973ae04e3..043b269178 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -384,7 +384,7 @@ void ProfileManager::AddStepsScore( const Song* pSong, const Steps* pSteps, Play // In event mode, set the score's name immediately to the Profile's last // used name. If no profile last used name exists, use "EVNT". - if( PREFSMAN->m_bEventMode ) + if( GAMESTATE->GetEventMode() ) { Profile* pProfile = PROFILEMAN->GetProfile(pn); if( pProfile && !pProfile->m_sLastUsedHighScoreName.empty() ) @@ -453,7 +453,7 @@ void ProfileManager::AddCourseScore( const Course* pCourse, const Trail* pTrail, // In event mode, set the score's name immediately to the Profile's last // used name. If no profile last used name exists, use "EVNT". - if( PREFSMAN->m_bEventMode ) + if( GAMESTATE->GetEventMode() ) { Profile* pProfile = PROFILEMAN->GetProfile(pn); if( pProfile && !pProfile->m_sLastUsedHighScoreName.empty() ) diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index 9c28884a66..5752c99ecb 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -193,11 +193,11 @@ bool Screen::JoinInput( const MenuInput &MenuI ) /* subtract coins */ int iCoinsToCharge = 0; - if( PREFSMAN->GetCoinMode() == COIN_PAY ) + if( GAMESTATE->GetCoinMode() == COIN_PAY ) iCoinsToCharge = PREFSMAN->m_iCoinsPerCredit; // If joint premium don't take away a credit for the 2nd join. - if( PREFSMAN->GetPremium() == PREMIUM_JOINT && + if( GAMESTATE->GetPremium() == PREMIUM_JOINT && GAMESTATE->GetNumSidesJoined() == 1 ) iCoinsToCharge = 0; diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index 18f4a6ef93..c385814f75 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -75,7 +75,7 @@ void ScreenAttract::AttractInput( const DeviceInput& DeviceI, const InputEventTy case MENU_BUTTON_START: case MENU_BUTTON_BACK: case MENU_BUTTON_COIN: - switch( PREFSMAN->GetCoinMode() ) + switch( GAMESTATE->GetCoinMode() ) { case COIN_PAY: LOG->Trace("ScreenAttract::AttractInput: COIN_PAY (%i/%i)", GAMESTATE->m_iCoins, PREFSMAN->m_iCoinsPerCredit ); diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index dd42073716..bd9fbc9d3f 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -1375,8 +1375,10 @@ void ScreenEvaluation::HandleScreenMessage( const ScreenMessage SM ) break; case SM_GoToNextScreen: { - if( PREFSMAN->m_bEventMode ) + if( GAMESTATE->GetEventMode() ) + { SCREENMAN->SetNewScreen( NEXT_SCREEN ); + } else { /* Go to FAILED_SCREEN if we failed a non-extra stage. */ @@ -1457,7 +1459,7 @@ void ScreenEvaluation::EndScreen() FOREACH_PlayerNumber( p ) m_Grades[p].SettleImmediately(); - if( !PREFSMAN->m_bEventMode ) + if( !GAMESTATE->GetEventMode() ) { switch( m_Type ) { diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index d40c547bb8..c21bb09e7b 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -951,7 +951,7 @@ void ScreenGameplay::LoadNextSong() if( GAMESTATE->m_SongOptions.m_LifeType==SongOptions::LIFE_BATTERY && STATSMAN->m_CurStageStats.m_player[p].bFailed ) // already failed ShowOniGameOver(p); - if( GAMESTATE->m_SongOptions.m_LifeType==SongOptions::LIFE_BAR && GAMESTATE->m_PlayMode == PLAY_MODE_REGULAR && !PREFSMAN->m_bEventMode && !GAMESTATE->m_bDemonstrationOrJukebox) + if( GAMESTATE->m_SongOptions.m_LifeType==SongOptions::LIFE_BAR && GAMESTATE->m_PlayMode == PLAY_MODE_REGULAR && !GAMESTATE->GetEventMode() && !GAMESTATE->m_bDemonstrationOrJukebox) { m_pLifeMeter[p]->UpdateNonstopLifebar( GAMESTATE->GetStageIndex(), diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp index 9cfaa99a01..de4f52f42d 100644 --- a/stepmania/src/ScreenNameEntry.cpp +++ b/stepmania/src/ScreenNameEntry.cpp @@ -386,7 +386,7 @@ void ScreenNameEntry::HandleScreenMessage( const ScreenMessage SM ) // There shouldn't be NameEntry in event mode. -Chris // /* Hack: go back to the select course screen in event mode. */ -// if( PREFSMAN->m_bEventMode && GAMESTATE->IsCourseMode() ) +// if( GAMESTATE->GetEventMode() && GAMESTATE->IsCourseMode() ) // { // SCREENMAN->SetNewScreen( "ScreenSelectCourse" ); // break; diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index e02192cf9b..7a9e05da15 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -110,7 +110,7 @@ void ScreenSelect::Update( float fDelta ) } // don't time out on this screen is coin mode is pay. // If we're here, then there's a credit in the machine. - if( PREFSMAN->GetCoinMode() != COIN_PAY ) + if( GAMESTATE->GetCoinMode() != COIN_PAY ) { if( IDLE_TIMEOUT_SECONDS > 0 && m_timerIdleTimeout.PeekDeltaTime() >= IDLE_TIMEOUT_SECONDS ) { diff --git a/stepmania/src/ScreenSelectMode.cpp b/stepmania/src/ScreenSelectMode.cpp index 515b18701b..72b3cf57dc 100644 --- a/stepmania/src/ScreenSelectMode.cpp +++ b/stepmania/src/ScreenSelectMode.cpp @@ -197,9 +197,9 @@ void ScreenSelectMode::UpdateSelectableChoices() (mc.m_pStyle == NULL) ? 1 : 1; - if( PREFSMAN->GetPremium()!=PREMIUM_JOINT || + if( GAMESTATE->GetPremium()!=PREMIUM_JOINT || ( - (PREFSMAN->GetPremium()==PREMIUM_JOINT) && + (GAMESTATE->GetPremium()==PREMIUM_JOINT) && ( (INCLUDE_DOUBLE_IN_JP == 1 && (GAMESTATE->GetNumSidesJoined() == SidesJoinedToPlay)) || ( diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index a5efc9dd83..f2e3c7de39 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -1098,7 +1098,7 @@ void ScreenSelectMusic::MenuStart( PlayerNumber pn ) /* See if this song is a repeat. If we're in event mode, only check the last five songs. */ bool bIsRepeat = false; int i = 0; - if( PREFSMAN->m_bEventMode ) + if( GAMESTATE->GetEventMode() ) i = max( 0, int(STATSMAN->m_vPlayedStageStats.size())-5 ); for( ; i < (int)STATSMAN->m_vPlayedStageStats.size(); ++i ) if( STATSMAN->m_vPlayedStageStats[i].vpSongs.back() == m_MusicWheel.GetSelectedSong() ) diff --git a/stepmania/src/ScreenSelectStyle.cpp b/stepmania/src/ScreenSelectStyle.cpp index d4da8122d8..19f8cdd109 100644 --- a/stepmania/src/ScreenSelectStyle.cpp +++ b/stepmania/src/ScreenSelectStyle.cpp @@ -100,7 +100,7 @@ ScreenSelectStyle::ScreenSelectStyle( CString sClassName ) : ScreenSelect( sClas m_sprPremium.SetName( "Premium" ); - switch( PREFSMAN->GetPremium() ) + switch( GAMESTATE->GetPremium() ) { case PREMIUM_DOUBLES: m_sprPremium.Load( THEME->GetPathG(m_sName,"doubles premium") ); diff --git a/stepmania/src/ScreenSystemLayer.cpp b/stepmania/src/ScreenSystemLayer.cpp index fae1c15d7e..32e5e3e44e 100644 --- a/stepmania/src/ScreenSystemLayer.cpp +++ b/stepmania/src/ScreenSystemLayer.cpp @@ -183,7 +183,7 @@ void ScreenSystemLayer::RefreshCreditsMessages() } else // bShowCreditsMessage { - switch( PREFSMAN->GetCoinMode() ) + switch( GAMESTATE->GetCoinMode() ) { case COIN_HOME: if( GAMESTATE->PlayersCanJoin() ) diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 8fff661d99..1dc5b2c0c3 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -37,7 +37,7 @@ ScreenTitleMenu::ScreenTitleMenu( CString sScreenName ) : // Don't show screen title menu (says "Press Start") // if there are 0 credits and inserted and CoinMode is pay. - if( PREFSMAN->GetCoinMode() == COIN_PAY && + if( GAMESTATE->GetCoinMode() == COIN_PAY && GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit ) { SCREENMAN->SetNewScreen( INITIAL_SCREEN ); @@ -78,7 +78,7 @@ ScreenTitleMenu::ScreenTitleMenu( CString sScreenName ) : m_textMaxStages.LoadFromFont( THEME->GetPathF(m_sName,"MaxStages") ); m_textMaxStages.SetName( "MaxStages" ); CString sText = - PREFSMAN->m_bEventMode ? + GAMESTATE->GetEventMode() ? CString("event mode") : ssprintf( "%d %s%s max", PREFSMAN->m_iNumArcadeStages, MAX_STAGES_TEXT.c_str(), (PREFSMAN->m_iNumArcadeStages>1)?"s":"" ); m_textMaxStages.SetText( sText ); diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 8ab916b29b..2a2481db20 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -1436,7 +1436,7 @@ static void HandleInputEvents(float fDeltaTime) continue; // skip // check back in event mode - if( PREFSMAN->m_bEventMode && + if( GAMESTATE->GetEventMode() && CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_BACK_IN_EVENT_MODE) ) { MenuI.player = PLAYER_1;