diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 8c25dc5608..a30fa5a004 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -1751,6 +1751,10 @@ ScreenModsCommand=setupmusicstagemods PreviousSongButton="MenuLeft" NextSongButton="MenuRight" # +ChangeStepsWithGameButtons=false +PreviousDifficultyButton="MenuUp" +NextDifficultyButton="MenuDown" +# TwoPartSelection=false TwoPartConfirmsOnly=false TwoPartTimerSeconds=15 diff --git a/Themes/default/Scripts/03 ThemePrefs.lua b/Themes/default/Scripts/03 ThemePrefs.lua index e3e5fa3267..171613afcf 100644 --- a/Themes/default/Scripts/03 ThemePrefs.lua +++ b/Themes/default/Scripts/03 ThemePrefs.lua @@ -75,7 +75,6 @@ function OptionRowProTiming() return t; end; - function UserPrefGameplayShowScore() local t = { Name = "UserPrefGameplayShowScore"; diff --git a/src/GameManager.cpp b/src/GameManager.cpp index f02c44709a..d3b6b605a3 100644 --- a/src/GameManager.cpp +++ b/src/GameManager.cpp @@ -653,7 +653,7 @@ static const Style g_Style_Pump_HalfDouble = { TRACK_4, +PUMP_COL_SPACING*0.5f+4, NULL }, { TRACK_5, +PUMP_COL_SPACING*1.5f+4, NULL }, { TRACK_6, +PUMP_COL_SPACING*2.5f+4, NULL }, - } + }, { // PLAYER_2 { TRACK_1, -PUMP_COL_SPACING*2.5f-4, NULL }, { TRACK_2, -PUMP_COL_SPACING*1.5f-4, NULL }, @@ -783,7 +783,7 @@ static const Style g_Style_Pump_Couple_Edit = { TRACK_8, +PUMP_COL_SPACING*3.0f+4, NULL }, { TRACK_9, +PUMP_COL_SPACING*4.0f+4, NULL }, { TRACK_10, +PUMP_COL_SPACING*5.0f+4, NULL }, - } + }, { // PLAYER_2 { TRACK_1, -PUMP_COL_SPACING*2.0f, NULL }, { TRACK_2, -PUMP_COL_SPACING*1.0f, NULL }, diff --git a/src/NotesLoaderKSF.cpp b/src/NotesLoaderKSF.cpp index d2d6969738..b52b1cb50a 100644 --- a/src/NotesLoaderKSF.cpp +++ b/src/NotesLoaderKSF.cpp @@ -508,22 +508,23 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant tickToChange = (int)numTemp; continue; } - else if (BeginsWith(NoteRowString, "|B")) + if (BeginsWith(NoteRowString, "|B")) { bBPMChangeNeeded = true; speedToChange = numTemp; continue; } - else if (BeginsWith(NoteRowString, "|E")) + if (BeginsWith(NoteRowString, "|E")) { bBPMStopNeeded = true; - timeToStop = (60 / out.m_Timing.GetBPMAtBeat(NoteRowToBeat(i)) * numTemp) / (float)iTickCount; + timeToStop = 60 / out.m_Timing.GetBPMAtBeat(NoteRowToBeat(i)) * numTemp / (float)tickToChange; continue; } - else if (BeginsWith(NoteRowString, "|D")) + if (BeginsWith(NoteRowString, "|D")) { bBPMStopNeeded = true; - timeToStop = numTemp / 1000.0f; + //bool bDelay = true; + timeToStop = numTemp / 1000.0f; // + out.m_Timing.GetStopAtRow(i-1, bDelay); continue; } } @@ -531,7 +532,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant { // Quit while we're ahead if any bad syntax is spotted. LOG->UserLog( "Song file", sPath, "has an invalid RowString \"%s\".", - NoteRowString.c_str() ); + NoteRowString.c_str() ); return false; } } @@ -542,8 +543,8 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant LOG->Trace( "Adding time signature of %i/4 at beat %f", iTickCount, fCurBeat ); TimeSignatureSegment seg; seg.m_iStartRow = BeatToNoteRow(fCurBeat); - seg.m_iNumerator = iTickCount; - seg.m_iDenominator = 4; + seg.m_iNumerator = iTickCount; + seg.m_iDenominator = 4; out.m_Timing.AddTimeSignatureSegment( seg ); bTickChangeNeeded = false; } @@ -563,6 +564,8 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant } } + out.m_fMusicSampleLengthSeconds = 7.0f; + // Try to fill in missing bits of information from the pathname. { vector asBits; diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index 9d09a2bcd3..601ff0902c 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -90,9 +90,18 @@ void ScreenSelectMusic::Init() TWO_PART_CONFIRMS_ONLY.Load( m_sName, "TwoPartConfirmsOnly" ); TWO_PART_TIMER_SECONDS.Load( m_sName, "TwoPartTimerSeconds" ); WRAP_CHANGE_STEPS.Load( m_sName, "WrapChangeSteps" ); + //To allow changing steps with gamebuttons -DaisuMaster + CHANGE_STEPS_WITH_GAME_BUTTONS.Load( m_sName, "ChangeStepsWithGameButtons" ); m_GameButtonPreviousSong = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric(m_sName,"PreviousSongButton") ); m_GameButtonNextSong = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric(m_sName,"NextSongButton") ); + + //Ask for those only if changing steps with gamebuttons is allowed -DaisuMaster + if( CHANGE_STEPS_WITH_GAME_BUTTONS ) + { + m_GameButtonPreviousDifficulty = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric(m_sName,"PreviousDifficultyButton") ); + m_GameButtonNextDifficulty = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric(m_sName,"NextDifficultyButton") ); + } FOREACH_ENUM( PlayerNumber, p ) { @@ -552,6 +561,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) bool bLeftIsDown = false; bool bRightIsDown = false; + FOREACH_HumanPlayer( p ) { if( m_OptionsList[p].IsOpened() ) @@ -614,10 +624,31 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) } } + // To allow changing steps with gamebuttons, NOT WITH THE GODDAMN CODEDETECTOR + // yeah, wanted this since a while ago... -DaisuMaster + if(CHANGE_STEPS_WITH_GAME_BUTTONS) + { + // avoid anything not being just press (read: release or repeat/hold) + if(input.type != IET_FIRST_PRESS) + return; + + if(m_SelectionState == SelectionState_SelectingSong) + { + if(input.MenuI == m_GameButtonPreviousDifficulty) + { + ChangeSteps(input.pn, -1); + } + else if( input.MenuI == m_GameButtonNextDifficulty ) + { + ChangeSteps(input.pn, +1); + } + } + } + // two part confirms only means we can actually change songs here, // so we need some hackery. oops looks like this is never going into // mainline sm4 then -aj - if(TWO_PART_CONFIRMS_ONLY) + if( TWO_PART_CONFIRMS_ONLY ) { if( m_SelectionState == SelectionState_SelectingSteps ) { @@ -643,6 +674,30 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) m_MusicWheel.ChangeMusicUnlessLocked( +1 ); } } + // added an entry for difficulty change with + // gamebuttons -DaisuMaster + else if( input.MenuI == m_GameButtonPreviousDifficulty ) + { + if( GAMESTATE->IsAnExtraStageAndSelectionLocked() ) + m_soundLocked.Play(); + else + { + m_SelectionState = SelectionState_SelectingSong; + MESSAGEMAN->Broadcast("TwoPartConfirmCanceled"); + ChangeSteps( input.pn, -1); + } + } + else if( input.MenuI == m_GameButtonNextDifficulty ) + { + if( GAMESTATE->IsAnExtraStageAndSelectionLocked() ) + m_soundLocked.Play(); + else + { + m_SelectionState = SelectionState_SelectingSong; + MESSAGEMAN->Broadcast("TwoPartConfirmCanceled"); + ChangeSteps( input.pn, +1); + } + } } } else @@ -737,6 +792,7 @@ bool ScreenSelectMusic::DetectCodes( const InputEventPlus &input ) m_MusicWheel.SelectSection(sNewGroup); m_MusicWheel.SetOpenSection(sNewGroup); AfterMusicChange(); + //m_MusicWheel. } } else if( CodeDetector::EnteredCloseFolder(input.GameI.controller) ) diff --git a/src/ScreenSelectMusic.h b/src/ScreenSelectMusic.h index 08f506de99..c5505ae71b 100644 --- a/src/ScreenSelectMusic.h +++ b/src/ScreenSelectMusic.h @@ -89,6 +89,8 @@ protected: ThemeMetric TWO_PART_TIMER_SECONDS; ThemeMetric WRAP_CHANGE_STEPS; + ThemeMetric CHANGE_STEPS_WITH_GAME_BUTTONS; + bool CanChangeSong() const { return m_SelectionState == SelectionState_SelectingSong; } bool CanChangeSteps() const { return TWO_PART_SELECTION ? m_SelectionState == SelectionState_SelectingSteps : m_SelectionState == SelectionState_SelectingSong; } SelectionState GetNextSelectionState() const @@ -105,6 +107,8 @@ protected: GameButton m_GameButtonPreviousSong; GameButton m_GameButtonNextSong; + GameButton m_GameButtonPreviousDifficulty; + GameButton m_GameButtonNextDifficulty; RString m_sSectionMusicPath; RString m_sSortMusicPath;