mouse tooltips: Don't add a tooltip if another is present

VarClientInt(2) is set to `1` whenever a tooltip is present, meaning we
should never render a tooltip when it is set that way. Some menu options
(world map dungeon links) have a null widget associated with them, and
do not utilize the TOOLTIP_TIMEOUT VarClientInt, so this check is
necessary to avoid adding a duplicate tooltip.

Fixes runelite/runelite#3278
This commit is contained in:
Jordan Atwood
2018-10-07 14:38:21 -07:00
parent 84fe8d8f58
commit b5f534f9fe
2 changed files with 13 additions and 0 deletions

View File

@@ -36,6 +36,12 @@ public enum VarClientInt
{
TOOLTIP_TIMEOUT(1),
/**
* 0 = no tooltip displayed
* 1 = tooltip displaying
*/
TOOLTIP_VISIBLE(2),
MEMBERSHIP_STATUS(103),
WORLD_MAP_SEARCH_FOCUSED(190);

View File

@@ -118,6 +118,13 @@ class MouseHighlightOverlay extends Overlay
}
}
// If this varc is set, a tooltip is already being displayed
int tooltipDisplayed = client.getVar(VarClientInt.TOOLTIP_VISIBLE);
if (tooltipDisplayed == 1)
{
return null;
}
tooltipManager.addFront(new Tooltip(option + (Strings.isNullOrEmpty(target) ? "" : " " + target)));
return null;
}