Skip to content
Permalink
Browse files

Make tooltip_show_delay=0 work

  • Loading branch information
Zefram sapier
Zefram authored and sapier committed Jul 2, 2014
1 parent 07f444e commit 7d72ac6a6954e25d635795e099fbe51e4a668df9
Showing with 6 additions and 4 deletions.
  1. +6 −4 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
*/

0 comments on commit 7d72ac6

Please sign in to comment.
You can’t perform that action at this time.