update textinfo after each keypress, so changes don't appear lagged
This commit is contained in:
@@ -455,7 +455,19 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
if(m_EditMode == MODE_PLAYING && PlayTicks())
|
||||
m_soundAssistTick.Play();
|
||||
|
||||
static float fUpdateCounter = 0;
|
||||
fUpdateCounter -= fDeltaTime;
|
||||
if( fUpdateCounter < 0 )
|
||||
{
|
||||
fUpdateCounter = 0.5;
|
||||
UpdateTextInfo();
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenEdit::UpdateTextInfo()
|
||||
{
|
||||
int iNumTapNotes = m_NoteFieldEdit.GetNumTapNotes();
|
||||
int iNumHoldNotes = m_NoteFieldEdit.GetNumHoldNotes();
|
||||
|
||||
CString sNoteType;
|
||||
switch( m_SnapDisplay.GetNoteType() )
|
||||
@@ -469,16 +481,6 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
default: ASSERT(0);
|
||||
}
|
||||
|
||||
|
||||
static float fUpdateCounter = 0.5;
|
||||
fUpdateCounter -= fDeltaTime;
|
||||
if( fUpdateCounter < 0 )
|
||||
{
|
||||
fUpdateCounter = 0.5;
|
||||
|
||||
int iNumTapNotes = m_NoteFieldEdit.GetNumTapNotes();
|
||||
int iNumHoldNotes = m_NoteFieldEdit.GetNumHoldNotes();
|
||||
|
||||
CString sText;
|
||||
sText += ssprintf( "Current Beat:\n %.2f\n", GAMESTATE->m_fSongBeat );
|
||||
sText += ssprintf( "Snap to:\n %s\n", sNoteType.GetString() );
|
||||
@@ -495,8 +497,6 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
|
||||
m_textInfo.SetText( sText );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ScreenEdit::DrawPrimitives()
|
||||
{
|
||||
@@ -942,6 +942,10 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
HandleAreaMenuChoice( delete_and_shift, NULL );
|
||||
break;
|
||||
}
|
||||
|
||||
/* Make sure the displayed time is up-to-date after possibly changing something,
|
||||
* so it doesn't feel lagged. */
|
||||
UpdateTextInfo();
|
||||
}
|
||||
|
||||
void ScreenEdit::InputRecord( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
||||
|
||||
@@ -44,6 +44,7 @@ protected:
|
||||
void TransitionToEdit();
|
||||
bool PlayTicks() const;
|
||||
void PlayPreviewMusic();
|
||||
void UpdateTextInfo();
|
||||
|
||||
void OnSnapModeChange();
|
||||
void MenuItemGainFocus( BitmapText* menuitem );
|
||||
|
||||
Reference in New Issue
Block a user