fixed tooltips not working with only right click things

This commit is contained in:
James Munson
2019-06-14 01:22:12 -07:00
2 changed files with 23 additions and 2 deletions

View File

@@ -85,4 +85,15 @@ public interface MouseHighlightConfig extends Config
{
return false;
}
@ConfigItem(
position = 5,
keyName = "rightclickoptionTooltip",
name = "Right Click Option Tooltips",
description = "Whether or not tooltips are shown for options that right-click only."
)
default boolean isRightClickTooltipEnabled()
{
return true;
}
}

View File

@@ -75,9 +75,8 @@ class MouseHighlightOverlay extends Overlay
String option = menuEntry.getOption();
int type = menuEntry.getType();
if (type == MenuAction.RUNELITE_OVERLAY.getId() || type == MenuAction.EXAMINE_ITEM_BANK_EQ.getId())
if (shouldNotRenderMenuAction(type))
{
// These are always right click only
return null;
}
@@ -141,4 +140,15 @@ class MouseHighlightOverlay extends Overlay
tooltipManager.addFront(new Tooltip(option + (Strings.isNullOrEmpty(target) ? "" : " " + target)));
return null;
}
private boolean shouldNotRenderMenuAction(int type)
{
return type == MenuAction.RUNELITE_OVERLAY.getId()
|| (!config.isRightClickTooltipEnabled() && isMenuActionRightClickOnly(type));
}
private boolean isMenuActionRightClickOnly(int type)
{
return type == MenuAction.EXAMINE_ITEM_BANK_EQ.getId();
}
}