From 3dd62d55680b3b110975a4331354cf4b44207813 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 13 Mar 2003 20:46:59 +0000 Subject: [PATCH] improve Skippy select last chosen NotesType and Difficulty in EditMenu --- stepmania/src/EditMenu.cpp | 16 +++++++++++ stepmania/src/NoteData.cpp | 39 +++++++++++++++++---------- stepmania/src/NoteData.h | 2 +- stepmania/src/ScreenPlayerOptions.cpp | 23 +++++++++------- 4 files changed, 55 insertions(+), 25 deletions(-) diff --git a/stepmania/src/EditMenu.cpp b/stepmania/src/EditMenu.cpp index 473907e8c1..caa52e3d19 100644 --- a/stepmania/src/EditMenu.cpp +++ b/stepmania/src/EditMenu.cpp @@ -16,6 +16,7 @@ #include "GameState.h" #include "ThemeManager.h" #include "GameManager.h" +#include "Notes.h" // // Defines specific to EditMenu @@ -123,6 +124,21 @@ EditMenu::EditMenu() if( GAMESTATE->m_pCurSong == m_pSongs[i] ) m_iSelection[ROW_SONG] = i; OnRowValueChanged( ROW_SONG ); + + // Select the current NotesType and difficulty if any + if( GAMESTATE->m_pCurNotes ) + { + for( i=0; im_pCurNotes[PLAYER_1]->m_NotesType ) + { + m_iSelection[ROW_NOTES_TYPE] = i; + OnRowValueChanged( ROW_NOTES_TYPE ); + } + + m_iSelection[ROW_DIFFICULTY] = GAMESTATE->m_pCurNotes[PLAYER_1]->GetDifficulty(); + OnRowValueChanged( ROW_DIFFICULTY ); + } + } } diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index ef7585b059..22d96afaaa 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -1046,20 +1046,20 @@ void NoteDataUtil::Wide( NoteData &in ) void NoteDataUtil::Big( NoteData &in ) { - InsertIntelligentTaps(in,1.0f,0.5f); // add 8ths between 4ths + InsertIntelligentTaps(in,1.0f,0.5f,false); // add 8ths between 4ths } void NoteDataUtil::Quick( NoteData &in ) { - InsertIntelligentTaps(in,0.5f,0.25f); // add 16ths between 8ths + InsertIntelligentTaps(in,0.5f,0.25f,false); // add 16ths between 8ths } void NoteDataUtil::Skippy( NoteData &in ) { - InsertIntelligentTaps(in,1.0f,0.75f); // add 16ths between 4ths + InsertIntelligentTaps(in,1.0f,0.75f,true); // add 16ths between 4ths } -void NoteDataUtil::InsertIntelligentTaps( NoteData &in, float fBeatInterval, float fInsertBeatOffset ) +void NoteDataUtil::InsertIntelligentTaps( NoteData &in, float fBeatInterval, float fInsertBeatOffset, bool bNewTapSameAsBeginning ) { ASSERT( fInsertBeatOffset <= fBeatInterval ); @@ -1094,19 +1094,30 @@ void NoteDataUtil::InsertIntelligentTaps( NoteData &in, float fBeatInterval, flo // add a note determinitsitcally somewhere on a track different from the two surrounding notes int iTrackOfNoteEarlier = in.GetFirstNonEmptyTrack(iRowEarlier); int iTrackOfNoteLater = in.GetFirstNonEmptyTrack(iRowLater); - int iTrackOfNoteMiddle = 0; - if( abs(iTrackOfNoteEarlier-iTrackOfNoteLater) == 2 ) - iTrackOfNoteMiddle = (iTrackOfNoteEarlier+iTrackOfNoteLater)/2; - else - for( int t=min(iTrackOfNoteEarlier,iTrackOfNoteLater)-1; t<=max(iTrackOfNoteEarlier,iTrackOfNoteLater)+1; t++ ) + int iTrackOfNoteToAdd = 0; + if( bNewTapSameAsBeginning && + iTrackOfNoteEarlier != iTrackOfNoteLater ) // Don't make skips on the same note + { + iTrackOfNoteToAdd = iTrackOfNoteEarlier; + } + else // bNewTapSameAsBeginning + { + // choose a randomish track + if( abs(iTrackOfNoteEarlier-iTrackOfNoteLater) == 2 ) + iTrackOfNoteToAdd = (iTrackOfNoteEarlier+iTrackOfNoteLater)/2; + else { - iTrackOfNoteMiddle = t; - CLAMP( iTrackOfNoteMiddle, 0, in.GetNumTracks()-1 ); - if( iTrackOfNoteMiddle!=iTrackOfNoteEarlier && iTrackOfNoteMiddle!=iTrackOfNoteLater ) - break; + for( int t=min(iTrackOfNoteEarlier,iTrackOfNoteLater)-1; t<=max(iTrackOfNoteEarlier,iTrackOfNoteLater)+1; t++ ) + { + iTrackOfNoteToAdd = t; + CLAMP( iTrackOfNoteToAdd, 0, in.GetNumTracks()-1 ); + if( iTrackOfNoteToAdd!=iTrackOfNoteEarlier && iTrackOfNoteToAdd!=iTrackOfNoteLater ) + break; + } } + } - in.SetTapNote(iTrackOfNoteMiddle, iRowToAdd, TAP_TAP); + in.SetTapNote(iTrackOfNoteToAdd, iRowToAdd, TAP_TAP); } in.Convert4sToHoldNotes(); diff --git a/stepmania/src/NoteData.h b/stepmania/src/NoteData.h index f542ee0946..445352f0d9 100644 --- a/stepmania/src/NoteData.h +++ b/stepmania/src/NoteData.h @@ -163,7 +163,7 @@ namespace NoteDataUtil void Big( NoteData &in ); void Quick( NoteData &in ); void Skippy( NoteData &in ); - void InsertIntelligentTaps( NoteData &in, float fBeatInterval, float fInsertBeatOffset ); + void InsertIntelligentTaps( NoteData &in, float fBeatInterval, float fInsertBeatOffset, bool bNewTapSameAsBeginning ); void SuperShuffleTaps( NoteData &in ); void Backwards( NoteData &in ); void SwapSides( NoteData &in ); diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index e34a6bf967..6af0abeac8 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -245,17 +245,20 @@ void ScreenPlayerOptions::HandleScreenMessage( const ScreenMessage SM ) { m_bAcceptedChoices = true; - float fShowSeconds = m_Menu.m_Out.GetLengthSeconds(); + if( !GAMESTATE->m_bEditing ) + { + float fShowSeconds = m_Menu.m_Out.GetLengthSeconds(); - // show "hold START for options" - m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); - m_sprOptionsMessage.BeginTweening( 0.15f ); // fade in - m_sprOptionsMessage.SetTweenZoomY( 1 ); - m_sprOptionsMessage.SetTweenDiffuse( RageColor(1,1,1,1) ); - m_sprOptionsMessage.BeginTweening( fShowSeconds-0.3f ); // sleep - m_sprOptionsMessage.BeginTweening( 0.15f ); // fade out - m_sprOptionsMessage.SetTweenDiffuse( RageColor(1,1,1,0) ); - m_sprOptionsMessage.SetTweenZoomY( 0 ); + // show "hold START for options" + m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); + m_sprOptionsMessage.BeginTweening( 0.15f ); // fade in + m_sprOptionsMessage.SetTweenZoomY( 1 ); + m_sprOptionsMessage.SetTweenDiffuse( RageColor(1,1,1,1) ); + m_sprOptionsMessage.BeginTweening( fShowSeconds-0.3f ); // sleep + m_sprOptionsMessage.BeginTweening( 0.15f ); // fade out + m_sprOptionsMessage.SetTweenDiffuse( RageColor(1,1,1,0) ); + m_sprOptionsMessage.SetTweenZoomY( 0 ); + } } break; }