item prices: always show tooltip when alching if option is enabled

This commit is contained in:
Daniel
2020-05-25 02:09:53 -04:00
committed by GitHub
parent 4faf36edc2
commit fc7e697aa7
2 changed files with 4 additions and 3 deletions

View File

@@ -89,7 +89,7 @@ public interface ItemPricesConfig extends Config
@ConfigItem( @ConfigItem(
keyName = "showWhileAlching", keyName = "showWhileAlching",
name = "Show prices while alching", name = "Show prices while alching",
description = "Show the price overlay while using High Alchemy", description = "Show the price overlay while using High Alchemy. Takes priority over \"Hide tooltips on Inventory Items\"",
position = 6 position = 6
) )
default boolean showWhileAlching() default boolean showWhileAlching()

View File

@@ -93,12 +93,13 @@ class ItemPricesOverlay extends Overlay
final MenuAction action = MenuAction.of(menuEntry.getType()); final MenuAction action = MenuAction.of(menuEntry.getType());
final int widgetId = menuEntry.getParam1(); final int widgetId = menuEntry.getParam1();
final int groupId = WidgetInfo.TO_GROUP(widgetId); final int groupId = WidgetInfo.TO_GROUP(widgetId);
final boolean isAlching = menuEntry.getOption().equals("Cast") && menuEntry.getTarget().contains("High Level Alchemy");
// Tooltip action type handling // Tooltip action type handling
switch (action) switch (action)
{ {
case ITEM_USE_ON_WIDGET: case ITEM_USE_ON_WIDGET:
if (!config.showWhileAlching() || !menuEntry.getOption().equals("Cast") || !menuEntry.getTarget().contains("High Level Alchemy")) if (!config.showWhileAlching() || !isAlching)
{ {
break; break;
} }
@@ -118,7 +119,7 @@ class ItemPricesOverlay extends Overlay
return null; return null;
} }
case WidgetID.INVENTORY_GROUP_ID: case WidgetID.INVENTORY_GROUP_ID:
if (config.hideInventory()) if (config.hideInventory() && !(config.showWhileAlching() && isAlching))
{ {
return null; return null;
} }