diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index c5bdfbcd93..ba7b245ffc 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -633,7 +633,22 @@ int GameState::GetCourseSongIndex() const bool GameState::PlayersCanJoin() const { - return GetNumSidesJoined() == 0 || this->m_CurStyle == STYLE_INVALID; + return GetNumSidesJoined() == 0 || this->m_CurStyle == STYLE_INVALID; // selecting a style finalizes the players +} + +bool GameState::EnoughCreditsToJoin() const +{ + switch( PREFSMAN->m_iCoinMode ) + { + case COIN_PAY: + return GAMESTATE->m_iCoins >= PREFSMAN->m_iCoinsPerCredit; + case COIN_HOME: + case COIN_FREE: + return true; + default: + ASSERT(0); + return false; + } } int GameState::GetNumSidesJoined() const diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index ffd0255d1b..19f01a0678 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -65,6 +65,7 @@ public: int m_iGameSeed, m_iRoundSeed; bool PlayersCanJoin() const; // true if it's not too late for a player to join + bool EnoughCreditsToJoin() const; // true if an unjoined player can join by pressint start int GetNumSidesJoined() const; GameDef* GetCurrentGameDef(); diff --git a/stepmania/src/LightsManager.cpp b/stepmania/src/LightsManager.cpp index c748a24e07..09552d8b53 100644 --- a/stepmania/src/LightsManager.cpp +++ b/stepmania/src/LightsManager.cpp @@ -77,8 +77,8 @@ void LightsManager::Update( float fDeltaTime ) { case LIGHTSMODE_JOINING: { - int iSec = (int)(RageTimer::GetTimeSinceStart()*4); - bool bBlinkOn = (iSec%2)==0; + int iBeat = (int)(GAMESTATE->m_fSongBeat); + bool bBlinkOn = (iBeat%2)==0; FOREACH_PlayerNumber( pn ) { @@ -89,10 +89,6 @@ void LightsManager::Update( float fDeltaTime ) m_LightsState.m_bCabinetLights[LIGHT_BUTTONS_LEFT+pn] = true; m_LightsState.m_bCabinetLights[LIGHT_BASS_LEFT+pn] = true; } - else - { - m_LightsState.m_bCabinetLights[LIGHT_BUTTONS_LEFT+pn] = bBlinkOn; - } } } break; @@ -183,6 +179,22 @@ void LightsManager::Update( float fDeltaTime ) ASSERT(0); } + + // If not joined, has enough credits, and not too late to join, then + // blink the menu buttons rapidly so they'll press Start + { + int iBeat = (int)(GAMESTATE->m_fSongBeat*4); + bool bBlinkOn = (iBeat%2)==0; + FOREACH_PlayerNumber( pn ) + { + if( !GAMESTATE->m_bSideIsJoined[pn] && GAMESTATE->PlayersCanJoin() && GAMESTATE->EnoughCreditsToJoin() ) + { + m_LightsState.m_bCabinetLights[LIGHT_BUTTONS_LEFT+pn] = bBlinkOn; + } + } + } + + // // Update game controller lights //