Merge pull request #519 from Kamielvf/runepouch-fix
Prevent tooltip from being shown when runepouch is empty
This commit is contained in:
@@ -32,6 +32,7 @@ public class WidgetID
|
||||
public static final int DEPOSIT_BOX_GROUP_ID = 192;
|
||||
public static final int INVENTORY_GROUP_ID = 149;
|
||||
public static final int EQUIPMENT_GROUP_ID = 387;
|
||||
public static final int RUNE_POUCH_GROUP_ID = 190;
|
||||
public static final int DIARY_GROUP_ID = 259;
|
||||
public static final int PESTRCONTROL_GROUP_ID = 408;
|
||||
public static final int CLAN_CHAT_GROUP_ID = 7;
|
||||
|
||||
@@ -91,6 +91,8 @@ public enum WidgetInfo
|
||||
SHOP_ITEMS_CONTAINER(WidgetID.SHOP_GROUP_ID, WidgetID.Shop.ITEMS_CONTAINER),
|
||||
SHOP_INVENTORY_ITEMS_CONTAINER(WidgetID.SHOP_INVENTORY_GROUP_ID, WidgetID.Shop.INVENTORY_ITEM_CONTAINER),
|
||||
|
||||
RUNE_POUCH_ITEM_CONTAINER(WidgetID.RUNE_POUCH_GROUP_ID, 0),
|
||||
|
||||
MINIMAP_XP_ORB(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.XP_ORB),
|
||||
MINIMAP_PRAYER_ORB(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.PRAYER_ORB),
|
||||
MINIMAP_RUN_ORB(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.RUN_ORB),
|
||||
|
||||
@@ -257,7 +257,8 @@ public class ExaminePlugin extends Plugin
|
||||
itemId = widgetItem.getItemId();
|
||||
}
|
||||
}
|
||||
else if (WidgetInfo.BANK_INVENTORY_ITEMS_CONTAINER.getGroupId() == widgetGroup)
|
||||
else if (WidgetInfo.BANK_INVENTORY_ITEMS_CONTAINER.getGroupId() == widgetGroup
|
||||
|| WidgetInfo.RUNE_POUCH_ITEM_CONTAINER.getGroupId() == widgetGroup)
|
||||
{
|
||||
Widget widgetItem = widget.getChild(pendingExamine.getActionParam());
|
||||
if (widgetItem != null)
|
||||
|
||||
@@ -101,6 +101,7 @@ public class RunepouchOverlay extends Overlay
|
||||
graphics.setFont(FontManager.getRunescapeSmallFont());
|
||||
|
||||
StringBuilder tooltipBuilder = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < AMOUNT_VARBITS.length; i++)
|
||||
{
|
||||
Varbits amountVarbit = AMOUNT_VARBITS[i];
|
||||
@@ -146,10 +147,12 @@ public class RunepouchOverlay extends Overlay
|
||||
runeImg);
|
||||
}
|
||||
}
|
||||
|
||||
String tooltip = tooltipBuilder.toString();
|
||||
|
||||
if (runePouch.getCanvasBounds().contains(client.getMouseCanvasPosition().getX(), client.getMouseCanvasPosition().getY()))
|
||||
if (!tooltip.isEmpty() && runePouch.getCanvasBounds().contains(client.getMouseCanvasPosition().getX(), client.getMouseCanvasPosition().getY()))
|
||||
{
|
||||
tooltipManager.add(new Tooltip(tooltipBuilder.toString()));
|
||||
tooltipManager.add(new Tooltip(tooltip));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user