use of net.runelite.api.queries.InventoryWidgetItemQuery in project runelite by runelite.
the class JewelleryCountOverlay method getJewelleryWidgetItems.
private Collection<WidgetItem> getJewelleryWidgetItems() {
Query inventoryQuery = new InventoryWidgetItemQuery();
WidgetItem[] inventoryWidgetItems = queryRunner.runQuery(inventoryQuery);
Query equipmentQuery = new EquipmentItemQuery().slotEquals(WidgetInfo.EQUIPMENT_AMULET, WidgetInfo.EQUIPMENT_RING, WidgetInfo.EQUIPMENT_GLOVES, WidgetInfo.EQUIPMENT_WEAPON);
WidgetItem[] equipmentWidgetItems = queryRunner.runQuery(equipmentQuery);
Collection<WidgetItem> jewellery = new ArrayList<>();
jewellery.addAll(Arrays.asList(inventoryWidgetItems));
jewellery.addAll(Arrays.asList(equipmentWidgetItems));
return jewellery;
}
use of net.runelite.api.queries.InventoryWidgetItemQuery in project runelite by runelite.
the class ItemStatOverlay method render.
@Override
public Dimension render(Graphics2D graphics) {
if (client.isMenuOpen() || (!config.relative() && !config.absolute() && !config.theoretical())) {
return null;
}
WidgetItem[] inventory = queryRunner.runQuery(new InventoryWidgetItemQuery());
Point mousePos = new Point(client.getMouseCanvasPosition().getX(), client.getMouseCanvasPosition().getY());
for (WidgetItem item : inventory) {
if (item.getCanvasBounds().contains(mousePos)) {
Effect change = statChanges.get(item.getId());
if (change != null) {
StringBuilder b = new StringBuilder();
StatsChanges statsChanges = change.calculate(client);
for (StatChange c : statsChanges.getStatChanges()) {
b.append(buildStatChangeString(c));
}
tooltipManager.add(new Tooltip(b.toString()));
}
}
}
return null;
}
Aggregations