From: terencehill Date: Tue, 1 Sep 2015 20:45:44 +0000 (+0200) Subject: Set the "forced fade out" state when mouse touches the tooltip, it makes the code... X-Git-Tag: xonotic-v0.8.2~1808^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0cb52def802298a14694209e12a8250456226101;p=xonotic%2Fxonotic-data.pk3dir.git Set the "forced fade out" state when mouse touches the tooltip, it makes the code less hackish --- diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index 54e785ef8..db5551a5a 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -568,6 +568,9 @@ void m_tooltip(vector pos) strunzone(prev_tooltip); prev_tooltip = strzone(it.tooltip); } + else if(menuTooltipItem && !m_testmousetooltipbox(pos)) + menuTooltipState = 3; // fade out if mouse touches it + } else it = world; @@ -625,10 +628,6 @@ void m_tooltip(vector pos) else if(menuTooltipState == 2) // re-fade in? menuTooltipState = 1; - if(menuTooltipItem) - if(!m_testmousetooltipbox(pos)) - menuTooltipState = 2; // fade out if mouse touches it - switch(menuTooltipState) { case 1: // fade in