From fbb611cf24fbdc8ebf26299506d281d2ab259f6d Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Thu, 31 Mar 2005 21:01:11 +0000 Subject: [PATCH] Workaround: let P2 use P1's menu buttons for changing P2's own difficulty, but only when P1 isn't around. --- stepmania/src/ScreenNetSelectBase.cpp | 8 +++++++- stepmania/src/ScreenNetSelectMusic.cpp | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/stepmania/src/ScreenNetSelectBase.cpp b/stepmania/src/ScreenNetSelectBase.cpp index 2171f86f22..6ef18e982a 100644 --- a/stepmania/src/ScreenNetSelectBase.cpp +++ b/stepmania/src/ScreenNetSelectBase.cpp @@ -11,6 +11,7 @@ #include "MenuTimer.h" #include "NetworkSyncManager.h" #include "RageUtil.h" +#include "GameState.h" #define CHATINPUT_WIDTH THEME->GetMetricF(m_sName,"ChatInputBoxWidth") #define CHATINPUT_HEIGHT THEME->GetMetricF(m_sName,"ChatInputBoxHeight") @@ -169,7 +170,12 @@ void ScreenNetSelectBase::Input( const DeviceInput& DeviceI, const InputEventTyp m_sTextInput += c; UpdateTextInput(); } - if( c >= ' ' ) + + //Tricky: If both players are playing, allow the 2 button through to the keymapper + if( c == '2' && GAMESTATE->IsPlayerEnabled( PLAYER_2 ) && GAMESTATE->IsPlayerEnabled( PLAYER_1 ) ) + break; + + if( c >= ' ' ) return; break; } diff --git a/stepmania/src/ScreenNetSelectMusic.cpp b/stepmania/src/ScreenNetSelectMusic.cpp index 2ad26bdb20..18421aaae7 100644 --- a/stepmania/src/ScreenNetSelectMusic.cpp +++ b/stepmania/src/ScreenNetSelectMusic.cpp @@ -339,6 +339,14 @@ void ScreenNetSelectMusic::MenuUp( PlayerNumber pn, const InputEventType type ) void ScreenNetSelectMusic::MenuDown( PlayerNumber pn, const InputEventType type ) { + /*Tricky: If we have a player on player 2, and there is only + player 2, allow them to use player 1's controls to change + their difficulty. */ + + if ( GAMESTATE->IsPlayerEnabled( PLAYER_2 ) && + !GAMESTATE->IsPlayerEnabled( PLAYER_1 ) ) + pn = PLAYER_2; + if ( GAMESTATE->m_pCurSong == NULL ) return; StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;