1
0
Fork 0

Fix phantom tooltips, more mapping modes.

Null the tooltip ID in update-hover, regardless of visibility. Avoids later tooltips when picking other (tooltip-less) pickable objects.

Also add two more mapping models for bools: up-down and down-up.
This commit is contained in:
James Turner 2013-03-11 17:19:32 +00:00
parent b12777d3ae
commit 5b84e09572

View file

@ -151,6 +151,9 @@ var Tooltip = {
# TODO - translate me!
if (me._mapping == "on-off") return (val == 1) ? "ON" : "OFF";
if (me._mapping == "arm-disarm") return (val == 1) ? "ARMED" : "DISARMED";
# provide both 'senses' of the flag here
if (me._mapping == "up-down") return (val == 1) ? "UP" : "DOWN";
if (me._mapping == "down-up") return (val == 1) ? "DOWN" : "UP";
if (me._mapping == "heading") return geo.normdeg(val);
return val;
@ -248,6 +251,7 @@ var setTooltip = func(node)
tooltip.setMapping(mapping == nil ? "" : mapping.getValue());
} else {
tooltip.setProperty(nil);
tooltip.setMapping(nil);
}
# don't actually show here, we do that response to tooltip-timeout
@ -267,12 +271,14 @@ var showTooltip = func(node)
var updateHover = func(node)
{
tooltip.setTooltipId(nil);
# if not shown, nothing to do here
if (!tooltip.isVisible()) return;
# reset cursor to standard
tooltip.fadeOut();
tooltip.setTooltipId(nil);
}
addcommand("update-hover", updateHover);