Add function to get appropriate SongPosition.
This restore highlighting areas in Song Timing. This does NOT readjust the highlighted area when timing modes are switched.
This commit is contained in:
+11
-2
@@ -1527,11 +1527,11 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
break;
|
||||
case EDIT_BUTTON_LAY_SELECT:
|
||||
{
|
||||
const int iCurrentRow = BeatToNoteRow(GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat);
|
||||
const int iCurrentRow = BeatToNoteRow(GetAppropriatePosition().m_fSongBeat);
|
||||
if( m_NoteFieldEdit.m_iBeginMarker==-1 && m_NoteFieldEdit.m_iEndMarker==-1 )
|
||||
{
|
||||
// lay begin marker
|
||||
m_NoteFieldEdit.m_iBeginMarker = BeatToNoteRow(GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat);
|
||||
m_NoteFieldEdit.m_iBeginMarker = BeatToNoteRow(GetAppropriatePosition().m_fSongBeat);
|
||||
}
|
||||
else if( m_NoteFieldEdit.m_iEndMarker==-1 ) // only begin marker is laid
|
||||
{
|
||||
@@ -3146,6 +3146,15 @@ TimingData & ScreenEdit::GetAppropriateTiming() const
|
||||
return m_pSong->m_SongTiming;
|
||||
}
|
||||
|
||||
SongPosition & ScreenEdit::GetAppropriatePosition() const
|
||||
{
|
||||
if (GAMESTATE->m_bIsUsingStepTiming)
|
||||
{
|
||||
return GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position;
|
||||
}
|
||||
return GAMESTATE->m_Position;
|
||||
}
|
||||
|
||||
inline void ScreenEdit::SetBeat(float fBeat)
|
||||
{
|
||||
if( !GAMESTATE->m_bIsUsingStepTiming )
|
||||
|
||||
@@ -580,6 +580,10 @@ private:
|
||||
* @brief Retrieve the appropriate TimingData based on GAMESTATE.
|
||||
* @return the proper TimingData. */
|
||||
TimingData & GetAppropriateTiming() const;
|
||||
/**
|
||||
* @brief Retrieve the appropriate SongPosition data based on GAMESTATE.
|
||||
* @return the proper SongPosition. */
|
||||
SongPosition & GetAppropriatePosition() const;
|
||||
void SetBeat(float fBeat);
|
||||
float GetBeat();
|
||||
int GetRow();
|
||||
|
||||
Reference in New Issue
Block a user