diff options
author | Zefram <zefram@fysh.org> | 2014-07-02 14:32:54 +0100 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2014-07-16 18:06:31 +0200 |
commit | 7d72ac6a6954e25d635795e099fbe51e4a668df9 (patch) | |
tree | 7568c6f4162e1c1f86b88c8312b27a958e7c5a0c | |
parent | 07f444ed85dd900a75062e7dcf0cc0690063283b (diff) | |
download | minetest-7d72ac6a6954e25d635795e099fbe51e4a668df9.tar.gz minetest-7d72ac6a6954e25d635795e099fbe51e4a668df9.tar.bz2 minetest-7d72ac6a6954e25d635795e099fbe51e4a668df9.zip |
Make tooltip_show_delay=0 work
-rw-r--r-- | src/guiFormSpecMenu.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index d6a4b4f47..d6ca12b70 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -2350,16 +2350,19 @@ void GUIFormSpecMenu::drawMenu() if (hovered != NULL) { s32 id = hovered->getID(); + u32 delta; if (id == -1) { m_old_tooltip_id = id; m_old_tooltip = ""; + delta = 0; } else if (id != m_old_tooltip_id) { m_hoovered_time = getTimeMs(); m_old_tooltip_id = id; + delta = 0; } else if (id == m_old_tooltip_id) { - u32 delta = porting::getDeltaMs(m_hoovered_time, getTimeMs()); - if (delta <= m_tooltip_show_delay) - goto skip_tooltip; + delta = porting::getDeltaMs(m_hoovered_time, getTimeMs()); + } + if (id != -1 && delta >= m_tooltip_show_delay) { for(std::vector<FieldSpec>::iterator iter = m_fields.begin(); iter != m_fields.end(); iter++) { if ( (iter->fid == id) && (m_tooltips[iter->fname].tooltip != "") ){ @@ -2392,7 +2395,6 @@ void GUIFormSpecMenu::drawMenu() } } - skip_tooltip: /* Draw dragged item stack */ |