From ed0ffb679a19e2e698251072b9404d88c39c088e Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 23 Aug 2005 20:58:24 +0000 Subject: [PATCH] require 2 players to join before continuing --- stepmania/src/ScreenJoinMultiplayer.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/stepmania/src/ScreenJoinMultiplayer.cpp b/stepmania/src/ScreenJoinMultiplayer.cpp index 6612288c03..0bb66113ea 100644 --- a/stepmania/src/ScreenJoinMultiplayer.cpp +++ b/stepmania/src/ScreenJoinMultiplayer.cpp @@ -11,6 +11,8 @@ class Style; #include "InputMapper.h" #include "GameSoundManager.h" #include "GameCommand.h" +#include "ScreenPrompt.h" +#include "ScreenManager.h" enum MultiPlayerStatus { @@ -49,11 +51,15 @@ void ScreenJoinMultiplayer::Init() { ScreenWithMenuElements::Init(); + GAMESTATE->m_bMultiplayer = true; + // Set Style to the first style (should be a one player style) vector v; GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, v, false ); GAMESTATE->m_pCurStyle.Set( v[0] ); + GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); + FOREACH_MultiPlayer( p ) { GameCommand gc; @@ -218,7 +224,24 @@ void ScreenJoinMultiplayer::MenuBack( PlayerNumber pn ) void ScreenJoinMultiplayer::MenuStart( PlayerNumber pn ) { - this->StartTransitioning( SM_BeginFadingOut ); + int iNumJoinedPlayers = 0; + FOREACH_MultiPlayer( p ) + { + bool bJoined = g_MultiPlayerStatus[p] == MultiPlayerStatus_Joined; + GAMESTATE->m_bIsMultiPlayerJoined[p] = bJoined; + if( bJoined ) + iNumJoinedPlayers++; + } + + SCREENMAN->PlayStartSound(); + + if( iNumJoinedPlayers < 2 ) + { + ScreenPrompt::Prompt( SM_None, "You must join 2 or more players before continuing." ); + return; + } + + this->StartTransitioning( SM_GoToNextScreen ); }