Merge pull request #8292 from Hydrox6/show-alch-price-while-alching
item prices: Show alch price while alching
This commit is contained in:
@@ -86,4 +86,14 @@ public interface ItemPricesConfig extends Config
|
||||
return false;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "showWhileAlching",
|
||||
name = "Show prices while alching",
|
||||
description = "Show the price overlay while using High Alchemy",
|
||||
position = 6
|
||||
)
|
||||
default boolean showWhileAlching()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ class ItemPricesOverlay extends Overlay
|
||||
private static final int INVENTORY_ITEM_WIDGETID = WidgetInfo.INVENTORY.getPackedId();
|
||||
private static final int BANK_INVENTORY_ITEM_WIDGETID = WidgetInfo.BANK_INVENTORY_ITEMS_CONTAINER.getPackedId();
|
||||
private static final int BANK_ITEM_WIDGETID = WidgetInfo.BANK_ITEM_CONTAINER.getPackedId();
|
||||
private static final int EXPLORERS_RING_ITEM_WIDGETID = WidgetInfo.EXPLORERS_RING_ALCH_INVENTORY.getPackedId();
|
||||
|
||||
private final Client client;
|
||||
private final ItemPricesConfig config;
|
||||
@@ -95,7 +96,7 @@ class ItemPricesOverlay extends Overlay
|
||||
switch (action)
|
||||
{
|
||||
case ITEM_USE_ON_WIDGET:
|
||||
if (!menuEntry.getTarget().contains("High Level Alchemy") || !config.showAlchProfit())
|
||||
if (!config.showWhileAlching() || !menuEntry.getOption().equals("Cast") || !menuEntry.getTarget().contains("High Level Alchemy"))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -109,6 +110,11 @@ class ItemPricesOverlay extends Overlay
|
||||
// Item tooltip values
|
||||
switch (groupId)
|
||||
{
|
||||
case WidgetID.EXPLORERS_RING_ALCH_GROUP_ID:
|
||||
if (!config.showWhileAlching())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
case WidgetID.INVENTORY_GROUP_ID:
|
||||
if (config.hideInventory())
|
||||
{
|
||||
@@ -142,7 +148,7 @@ class ItemPricesOverlay extends Overlay
|
||||
ItemContainer container = null;
|
||||
|
||||
// Inventory item
|
||||
if (widgetId == INVENTORY_ITEM_WIDGETID || widgetId == BANK_INVENTORY_ITEM_WIDGETID)
|
||||
if (widgetId == INVENTORY_ITEM_WIDGETID || widgetId == BANK_INVENTORY_ITEM_WIDGETID || widgetId == EXPLORERS_RING_ITEM_WIDGETID)
|
||||
{
|
||||
container = client.getItemContainer(InventoryID.INVENTORY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user