smarter menu button blinking

This commit is contained in:
Chris Danford
2004-03-30 08:03:00 +00:00
parent 95e11e9220
commit 493c6c8103
3 changed files with 35 additions and 7 deletions
+16 -1
View File
@@ -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
+1
View File
@@ -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();
+18 -6
View File
@@ -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
//