(LookupItem): moved timestamp update to InputData class.

This commit is contained in:
morkt 2017-01-07 04:30:34 +04:00
parent 3cc72a43c6
commit 9c27c8b4f8

View File

@ -628,6 +628,15 @@ namespace GARbro.GUI
Phrase.Clear (); Phrase.Clear ();
Mismatch = false; Mismatch = false;
} }
public void Update (int timestamp)
{
if (timestamp - LastTime >= TextLookupTimeout)
{
Reset();
}
LastTime = timestamp;
}
} }
const int TextLookupTimeout = 1000; // milliseconds const int TextLookupTimeout = 1000; // milliseconds
@ -653,11 +662,7 @@ namespace GARbro.GUI
if (source == null) if (source == null)
return; return;
if (timestamp - m_current_input.LastTime > TextLookupTimeout) m_current_input.Update (timestamp);
{
m_current_input.Reset();
}
m_current_input.LastTime = timestamp;
if (m_current_input.Mismatch) if (m_current_input.Mismatch)
return; return;