From e244495cc65a0be19b788820bc1f9201fc6dfbf2 Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Mon, 6 Sep 2004 03:25:26 +0000 Subject: [PATCH] Added: Player options --- stepmania/Docs/SMLanProtocol.txt | 7 ++ .../Graphics/ScreenNetSelectMusic options.png | Bin 0 -> 5230 bytes stepmania/Themes/default/metrics.ini | 16 ++- stepmania/src/NetworkSyncManager.cpp | 8 ++ stepmania/src/NetworkSyncManager.h | 3 + stepmania/src/ScreenNetSelectMusic.cpp | 94 ++++++++++++------ stepmania/src/ScreenNetSelectMusic.h | 4 + 7 files changed, 95 insertions(+), 37 deletions(-) create mode 100644 stepmania/Themes/default/Graphics/ScreenNetSelectMusic options.png 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 0000000000000000000000000000000000000000..e807bd39474dfad08a63c78e6c14380508c12e35 GIT binary patch literal 5230 zcmZ`-c{r5q+kR%BF%QPr#t35=l&LU7B6`NwAR4kvdMkr8g%C=r*KD>d4N122j3`Mp zdbQEQP^mXH6(ywwZ%Ju;BmGjoso!yY$M?_o$Mf9Ja@@;xUFUUP=Y1FOf>&s3QMCX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JAdgylu>m zru%>NI$KUCe9;`bv z7R|ZklP`}%lYZ@m$B)nju^ZvipPB5UNuz-f2OrHYL9GAq|2@%*2Ewj3ycwEZ)1o;r O1pIx2eNK5rOa2Gfg;+cQ literal 0 HcmV?d00001 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];