diff --git a/stepmania/Docs/SMLanProtocol.txt b/stepmania/Docs/SMLanProtocol.txt index bad856fb89..9c1e5e4d36 100644 --- a/stepmania/Docs/SMLanProtocol.txt +++ b/stepmania/Docs/SMLanProtocol.txt @@ -144,6 +144,11 @@ CLIENT to SERVER protocol: 1 If this value is 1 then the user entered the screen If this value is 0 then the user exited the screen +011: User has changed player options + Size: + NT Player 0's options + NT Player 1's options + SERVER to CLIENT protocol: (begins at 128) NOTE: Server responces always add 128, thus a server responce for no operation @@ -270,6 +275,8 @@ NOTE: Server responces always add 128, thus a server responce for no operation NT Set Specified gametype NT Set Specified style +011: Reserved + ///Potential for SMOnline/SMLAN (Changed to 020) 020: SMonline Packet. (Adam) Bytemap(Game Packet - SMO/TCP[C=010] Data) diff --git a/stepmania/Themes/default/Graphics/ScreenNetSelectMusic options.png b/stepmania/Themes/default/Graphics/ScreenNetSelectMusic options.png new file mode 100644 index 0000000000..e807bd3947 Binary files /dev/null and b/stepmania/Themes/default/Graphics/ScreenNetSelectMusic options.png differ diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index f225eabe4a..9a4504bdb0 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -888,6 +888,11 @@ SelOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0 SelTo1Command=linear,0.3;zoomy,1.0;zoomx,1.0;x,480;y,150 SelTo2Command=linear,0.3;zoomy,1.0;zoomx,1.0;x,480;y,350 SelTo3Command=linear,0.3;x,260;y,400;zoomx,0.3;zoomy,2.0 +SelTo4Command=linear,0.3;x,80;y,70;zoomx,0.4;zoomy,2.2 +optionsY=70 +optionsX=80 +optionsOnCommand=zoomx,0.0;zoomy,0.0;linear,0.5;zoomy,0.7;zoomx,0.7 +optionsOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0 MeterP1Y=435 MeterP1X=240 MeterP1OnCommand=zoomx,0.0;zoomy,0.0;linear,0.5;zoomy,1.0;zoomx,1.0 @@ -1417,10 +1422,10 @@ User2Y=80 User2X=500 UserDX=0 UserDY=32 -UserOnCommand=zoomx,0.0;zoomy,0.0;linear,0.1;zoomx,1.0;zoomy,1.0 -UserOffCommand=zoomx,1.0;zoomy,1.0;linear,0.1;zoomx,0.0;zoomy,0.0 -UserDeSelCommand=zoomx,1.4;zoomy,1.4;linear,0.3;zoomx,1.0;zoomy,1.0 -UserSelCommand=zoomx,1.0;zoomy,1.0;linear,0.3;zoomx,1.4;zoomy,1.4 +UserOnCommand=zoomx,0.0;zoomy,0.0;linear,0.5;zoomx,1.0;zoomy,1.0 +UserOffCommand=zoomx,1.0;zoomy,1.0;linear,0.5;zoomx,0.0;zoomy,0.0 +UserDeSelCommand=zoomx,1.4;zoomy,1.4;linear,0.1;zoomx,1.0;zoomy,1.0 +UserSelCommand=zoomx,1.0;zoomy,1.0;linear,0.1;zoomx,1.4;zoomy,1.4 [ScreenEvaluationStage] Fallback=ScreenEvaluation @@ -4115,7 +4120,7 @@ PrevScreen=ScreenTitleMenu # when using entries that change the screen; otherwise, the only way to # exit the screen when in regular mode is "exit". -LineNames=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 +LineNames=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 OptionMenuFlags=together;forceallplayers;smnavigation # This NextScreen is only used for the "exit" choice. Line1=list,Appearance Options @@ -4133,6 +4138,7 @@ Line12=list,Profile Options Line13=list,Other Options Line14=list,Reload Songs/Courses Line15=list,Test Input +Line16=list,Network Options [TextBanner] TitleX=-90 diff --git a/stepmania/src/NetworkSyncManager.cpp b/stepmania/src/NetworkSyncManager.cpp index 5c14eb0758..9c2f39876f 100644 --- a/stepmania/src/NetworkSyncManager.cpp +++ b/stepmania/src/NetworkSyncManager.cpp @@ -660,6 +660,14 @@ void NetworkSyncManager::SendChat( CString message ) NetPlayerClient->SendPack((char*)&m_packet.Data, m_packet.Position); } +void NetworkSyncManager::ReportPlayerOptions() +{ + m_packet.ClearPacket(); + m_packet.Write1( 11 ); + FOREACH_PlayerNumber (pn) + m_packet.WriteNT( GAMESTATE->m_PlayerOptions[pn].GetString() ); +} + void NetworkSyncManager::SelectUserSong() { m_packet.ClearPacket(); diff --git a/stepmania/src/NetworkSyncManager.h b/stepmania/src/NetworkSyncManager.h index db2fe185b5..01ae593652 100644 --- a/stepmania/src/NetworkSyncManager.h +++ b/stepmania/src/NetworkSyncManager.h @@ -97,6 +97,9 @@ public: void SendChat( CString message ); CString m_WaitingChat; + //Used for options + void ReportPlayerOptions(); + //Used for song checking/changing CString m_sMainTitle; CString m_sArtist; diff --git a/stepmania/src/ScreenNetSelectMusic.cpp b/stepmania/src/ScreenNetSelectMusic.cpp index 8d7b7dc3b6..aa361adeea 100644 --- a/stepmania/src/ScreenNetSelectMusic.cpp +++ b/stepmania/src/ScreenNetSelectMusic.cpp @@ -54,6 +54,7 @@ const ScreenMessage SM_NoSongs = ScreenMessage(SM_User+3); const ScreenMessage SM_AddToChat = ScreenMessage(SM_User+4); const ScreenMessage SM_ChangeSong = ScreenMessage(SM_User+5); +const ScreenMessage SM_BackFromOpts = ScreenMessage(SM_User+6); const CString AllGroups = "[ALL MUSIC]"; @@ -158,6 +159,11 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( const CString& sName ) : ScreenWithM SET_XY_AND_ON_COMMAND( m_textSubtitle ); this->AddChild( &m_textSubtitle ); + //SelectOptions Sprite + m_sprSelOptions.Load( THEME->GetPathG( m_sName, "options" ) ); + m_sprSelOptions.SetName( "options" ); + SET_XY_AND_ON_COMMAND( m_sprSelOptions ); + this->AddChild( &m_sprSelOptions ); //Diff Icon background m_rectDiff.SetDiffuse( DIFFBG_COLOR ); @@ -288,12 +294,13 @@ void ScreenNetSelectMusic::Input( const DeviceInput& DeviceI, const InputEventTy case ']': c='}'; break; case '\\': c='|'; break; case ';': c=':'; break; - case '\'': c='"'; break; case ',': c='<'; break; case '.': c='>'; break; case '/': c='?'; break; } } + if ( !bHoldingShift && (c == '\"') ) + c = '\''; //Search list for given letter (to aide in searching) if( bHoldingCtrl ) @@ -392,6 +399,11 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM ) } } break; + case SM_BackFromOpts: + //XXX: HACK: This will causes ScreenSelectOptions to go back here. + GAMESTATE->m_bEditing = false; + NSMAN->ReportPlayerOptions(); + break; } } @@ -413,25 +425,33 @@ void ScreenNetSelectMusic::MenuLeft( PlayerNumber pn, const InputEventType type UpdateSongsListPos(); break; case SelectDifficulty: - StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; - vector MultiSteps; - MultiSteps = GAMESTATE->m_pCurSong->GetAllSteps( st ); - if (MultiSteps.size() == 0) - m_DC[pn] = NUM_DIFFICULTIES; - else { - for ( i=0; i<(int)MultiSteps.size(); i++ ) - if ( MultiSteps[i]->GetDifficulty() >= m_DC[pn] ) - break; - - if ( i == (int)MultiSteps.size() ) - m_DC[pn] = MultiSteps[i-1]->GetDifficulty(); + StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; + vector MultiSteps; + MultiSteps = GAMESTATE->m_pCurSong->GetAllSteps( st ); + if (MultiSteps.size() == 0) + m_DC[pn] = NUM_DIFFICULTIES; else - if (i > 0) //If we are at the easiest difficulty, do nothign + { + for ( i=0; i<(int)MultiSteps.size(); i++ ) + if ( MultiSteps[i]->GetDifficulty() >= m_DC[pn] ) + break; + + if ( i == (int)MultiSteps.size() ) m_DC[pn] = MultiSteps[i-1]->GetDifficulty(); + else + if (i > 0) //If we are at the easiest difficulty, do nothign + m_DC[pn] = MultiSteps[i-1]->GetDifficulty(); + } + UpdateDifficulties( pn ); + GAMESTATE->m_PreferredDifficulty[pn] = m_DC[pn]; } - UpdateDifficulties( pn ); - GAMESTATE->m_PreferredDifficulty[pn] = m_DC[pn]; + break; + case SelectOptions: + //XXX: HACK: This will causes ScreenSelectOptions to go back here. + GAMESTATE->m_bEditing = true; + SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromOpts ); + break; } } @@ -452,25 +472,33 @@ void ScreenNetSelectMusic::MenuRight( PlayerNumber pn, const InputEventType type UpdateSongsListPos(); break; case SelectDifficulty: - StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; - vector MultiSteps; - MultiSteps = GAMESTATE->m_pCurSong->GetAllSteps( st ); - if (MultiSteps.size() == 0) - m_DC[pn] = NUM_DIFFICULTIES; - else { - for ( i=0; i<(int)MultiSteps.size(); i++ ) - if ( MultiSteps[i]->GetDifficulty() >= m_DC[pn] ) - break; - - if ( i == (int)MultiSteps.size() ) - m_DC[pn] = MultiSteps[i-1]->GetDifficulty(); + StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; + vector MultiSteps; + MultiSteps = GAMESTATE->m_pCurSong->GetAllSteps( st ); + if (MultiSteps.size() == 0) + m_DC[pn] = NUM_DIFFICULTIES; else - if (i < (int)MultiSteps.size() - 1 ) //If we are at the hardest difficulty, do nothign - m_DC[pn] = MultiSteps[i+1]->GetDifficulty(); + { + for ( i=0; i<(int)MultiSteps.size(); i++ ) + if ( MultiSteps[i]->GetDifficulty() >= m_DC[pn] ) + break; + + if ( i == (int)MultiSteps.size() ) + m_DC[pn] = MultiSteps[i-1]->GetDifficulty(); + else + if (i < (int)MultiSteps.size() - 1 ) //If we are at the hardest difficulty, do nothign + m_DC[pn] = MultiSteps[i+1]->GetDifficulty(); + } + UpdateDifficulties( pn ); + GAMESTATE->m_PreferredDifficulty[pn] = m_DC[pn]; } - UpdateDifficulties( pn ); - GAMESTATE->m_PreferredDifficulty[pn] = m_DC[pn]; + break; + case SelectOptions: + //XXX: HACK: This will causes ScreenSelectOptions to go back here. + GAMESTATE->m_bEditing = true; + SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromOpts ); + break; } } @@ -533,6 +561,8 @@ void ScreenNetSelectMusic::TweenOffScreen() OFF_COMMAND( m_rectExInfo ); OFF_COMMAND( m_rectDiff ); + OFF_COMMAND( m_sprSelOptions ); + FOREACH_EnabledPlayer (pn) { OFF_COMMAND( m_DifficultyMeters[pn] ); diff --git a/stepmania/src/ScreenNetSelectMusic.h b/stepmania/src/ScreenNetSelectMusic.h index b450495b7d..8500132d2d 100644 --- a/stepmania/src/ScreenNetSelectMusic.h +++ b/stepmania/src/ScreenNetSelectMusic.h @@ -42,6 +42,7 @@ private: SelectGroup = 0, SelectSong, SelectDifficulty, + SelectOptions, SelectModes, }; @@ -93,6 +94,9 @@ private: DifficultyIcon m_DifficultyIcon[NUM_PLAYERS]; Difficulty m_DC[NUM_PLAYERS]; + //Select Options + Sprite m_sprSelOptions; + void UpdateDifficulties( PlayerNumber pn ); DifficultyMeter m_DifficultyMeters[NUM_PLAYERS];