Skip to content

Commit

Permalink
edit autoplay and kick sound
Browse files Browse the repository at this point in the history
  • Loading branch information
eithwa committed Nov 9, 2020
1 parent f18d5c9 commit 240f30d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 19 deletions.
34 changes: 24 additions & 10 deletions src/ScreenEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,14 @@ void ScreenEdit::PlayTicks()
* ahead. This is just to make sure that we request the sound early enough for it to
* come out on time; the actual precise timing is handled by SetStartTime. */
float fPositionSeconds = GAMESTATE->m_fMusicSeconds;
fPositionSeconds += SOUND->GetPlayLatency() + (float)TICK_EARLY_SECONDS + 0.250f;
if (m_soundMusic.GetPlaybackRate() < 1)
{
fPositionSeconds += (SOUND->GetPlayLatency() + (float)TICK_EARLY_SECONDS + 0.250f) * m_soundMusic.GetPlaybackRate();
}
else
{
fPositionSeconds += (SOUND->GetPlayLatency() + (float)TICK_EARLY_SECONDS + 0.250f);
}
const float fSongBeat = GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds );

const int iSongRow = max( -1, BeatToNoteRowNotRounded( fSongBeat ) );
Expand Down Expand Up @@ -1586,20 +1593,27 @@ void ScreenEdit::InputPlay( const DeviceInput& DeviceI, const InputEventType typ
bool bIsHoldingShift =
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT)) ||
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT));
PREFSMAN->m_bAutoPlay = !PREFSMAN->m_bAutoPlay;
if(PREFSMAN->m_bAutoPlay)
if(PREFSMAN->m_iPlayerControllerType==1 && bIsHoldingShift)
{
PREFSMAN->m_iPlayerControllerType = 2;
}
else
{
if(bIsHoldingShift)
PREFSMAN->m_bAutoPlay = !PREFSMAN->m_bAutoPlay;
if(PREFSMAN->m_bAutoPlay)
{
PREFSMAN->m_iPlayerControllerType = 2;
if(bIsHoldingShift)
{
PREFSMAN->m_iPlayerControllerType = 2;
}else
{
PREFSMAN->m_iPlayerControllerType = 1;
}

}else
{
PREFSMAN->m_iPlayerControllerType = 1;
PREFSMAN->m_iPlayerControllerType = 0;
}

}else
{
PREFSMAN->m_iPlayerControllerType = 0;
}
UpdateAutoPlayText();
FOREACH_PlayerNumber( p )
Expand Down
26 changes: 17 additions & 9 deletions src/ScreenGameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1919,23 +1919,31 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
break;
case KEY_F8:
{
PREFSMAN->m_bAutoPlay = !PREFSMAN->m_bAutoPlay;
// PREFSMAN->m_bAutoPlay = !PREFSMAN->m_bAutoPlay;
bool bIsHoldingShift =
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT)) ||
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT));
if(PREFSMAN->m_bAutoPlay)
if(PREFSMAN->m_iPlayerControllerType==1 && bIsHoldingShift)
{
if(bIsHoldingShift)
PREFSMAN->m_iPlayerControllerType = 2;
}
else
{
PREFSMAN->m_bAutoPlay = !PREFSMAN->m_bAutoPlay;
if(PREFSMAN->m_bAutoPlay)
{
PREFSMAN->m_iPlayerControllerType = 2;
if(bIsHoldingShift)
{
PREFSMAN->m_iPlayerControllerType = 2;
}else
{
PREFSMAN->m_iPlayerControllerType = 1;
}

}else
{
PREFSMAN->m_iPlayerControllerType = 1;
PREFSMAN->m_iPlayerControllerType = 0;
}

}else
{
PREFSMAN->m_iPlayerControllerType = 0;
}
UpdateAutoPlayText();
// LOG->Info("PREFSMAN->m_iPlayerControllerType %d", PREFSMAN->m_iPlayerControllerType);
Expand Down

0 comments on commit 240f30d

Please sign in to comment.