Merge pull request #8292 from Hydrox6/show-alch-price-while-alching
item prices: Show alch price while alching
This commit is contained in:
@@ -142,6 +142,7 @@ public class WidgetID
|
|||||||
public static final int SEED_BOX_GROUP_ID = 128;
|
public static final int SEED_BOX_GROUP_ID = 128;
|
||||||
public static final int ITEMS_KEPT_ON_DEATH_GROUP_ID = 4;
|
public static final int ITEMS_KEPT_ON_DEATH_GROUP_ID = 4;
|
||||||
public static final int SEED_VAULT_GROUP_ID = 631;
|
public static final int SEED_VAULT_GROUP_ID = 631;
|
||||||
|
public static final int EXPLORERS_RING_ALCH_GROUP_ID = 483;
|
||||||
|
|
||||||
static class WorldMap
|
static class WorldMap
|
||||||
{
|
{
|
||||||
@@ -828,4 +829,9 @@ public class WidgetID
|
|||||||
static final int ITEM_CONTAINER = 15;
|
static final int ITEM_CONTAINER = 15;
|
||||||
static final int ITEM_TEXT = 16;
|
static final int ITEM_TEXT = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static class ExplorersRing
|
||||||
|
{
|
||||||
|
static final int INVENTORY = 7;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,6 +118,8 @@ public enum WidgetInfo
|
|||||||
|
|
||||||
IGNORE_TITLE(WidgetID.IGNORE_LIST_GROUP_ID, WidgetID.IgnoreList.TITLE),
|
IGNORE_TITLE(WidgetID.IGNORE_LIST_GROUP_ID, WidgetID.IgnoreList.TITLE),
|
||||||
|
|
||||||
|
EXPLORERS_RING_ALCH_INVENTORY(WidgetID.EXPLORERS_RING_ALCH_GROUP_ID, WidgetID.ExplorersRing.INVENTORY),
|
||||||
|
|
||||||
CLAN_CHAT_TITLE(WidgetID.CLAN_CHAT_GROUP_ID, WidgetID.ClanChat.TITLE),
|
CLAN_CHAT_TITLE(WidgetID.CLAN_CHAT_GROUP_ID, WidgetID.ClanChat.TITLE),
|
||||||
CLAN_CHAT_NAME(WidgetID.CLAN_CHAT_GROUP_ID, WidgetID.ClanChat.NAME),
|
CLAN_CHAT_NAME(WidgetID.CLAN_CHAT_GROUP_ID, WidgetID.ClanChat.NAME),
|
||||||
CLAN_CHAT_OWNER(WidgetID.CLAN_CHAT_GROUP_ID, WidgetID.ClanChat.OWNER),
|
CLAN_CHAT_OWNER(WidgetID.CLAN_CHAT_GROUP_ID, WidgetID.ClanChat.OWNER),
|
||||||
|
|||||||
@@ -86,4 +86,14 @@ public interface ItemPricesConfig extends Config
|
|||||||
return false;
|
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 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_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 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 Client client;
|
||||||
private final ItemPricesConfig config;
|
private final ItemPricesConfig config;
|
||||||
@@ -95,7 +96,7 @@ class ItemPricesOverlay extends Overlay
|
|||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case ITEM_USE_ON_WIDGET:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
@@ -109,6 +110,11 @@ class ItemPricesOverlay extends Overlay
|
|||||||
// Item tooltip values
|
// Item tooltip values
|
||||||
switch (groupId)
|
switch (groupId)
|
||||||
{
|
{
|
||||||
|
case WidgetID.EXPLORERS_RING_ALCH_GROUP_ID:
|
||||||
|
if (!config.showWhileAlching())
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
case WidgetID.INVENTORY_GROUP_ID:
|
case WidgetID.INVENTORY_GROUP_ID:
|
||||||
if (config.hideInventory())
|
if (config.hideInventory())
|
||||||
{
|
{
|
||||||
@@ -142,7 +148,7 @@ class ItemPricesOverlay extends Overlay
|
|||||||
ItemContainer container = null;
|
ItemContainer container = null;
|
||||||
|
|
||||||
// Inventory item
|
// 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);
|
container = client.getItemContainer(InventoryID.INVENTORY);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user