Search in sources :

Example 1 with EquipmentItemQuery

use of net.runelite.api.queries.EquipmentItemQuery in project runelite by runelite.

the class SlayerOverlay method getSlayerWidgetItems.

private Collection<WidgetItem> getSlayerWidgetItems() {
    Query inventoryQuery = new InventoryWidgetItemQuery();
    WidgetItem[] inventoryWidgetItems = queryRunner.runQuery(inventoryQuery);
    Query equipmentQuery = new EquipmentItemQuery().slotEquals(WidgetInfo.EQUIPMENT_HELMET, WidgetInfo.EQUIPMENT_RING);
    WidgetItem[] equipmentWidgetItems = queryRunner.runQuery(equipmentQuery);
    WidgetItem[] items = concat(inventoryWidgetItems, equipmentWidgetItems, WidgetItem.class);
    return ImmutableList.copyOf(items);
}
Also used : InventoryWidgetItemQuery(net.runelite.api.queries.InventoryWidgetItemQuery) EquipmentItemQuery(net.runelite.api.queries.EquipmentItemQuery) Query(net.runelite.api.Query) EquipmentItemQuery(net.runelite.api.queries.EquipmentItemQuery) InventoryWidgetItemQuery(net.runelite.api.queries.InventoryWidgetItemQuery) WidgetItem(net.runelite.api.widgets.WidgetItem)

Example 2 with EquipmentItemQuery

use of net.runelite.api.queries.EquipmentItemQuery in project runelite by runelite.

the class BindNeckOverlay method getNecklaceWidgetItems.

private Collection<WidgetItem> getNecklaceWidgetItems() {
    Query inventoryQuery = new InventoryWidgetItemQuery().idEquals(BINDING_NECKLACE);
    WidgetItem[] inventoryWidgetItems = queryRunner.runQuery(inventoryQuery);
    Query equipmentQuery = new EquipmentItemQuery().slotEquals(WidgetInfo.EQUIPMENT_AMULET).idEquals(BINDING_NECKLACE);
    WidgetItem[] equipmentWidgetItems = queryRunner.runQuery(equipmentQuery);
    Collection<WidgetItem> necklaces = new ArrayList<>();
    necklaces.addAll(Arrays.asList(inventoryWidgetItems));
    necklaces.addAll(Arrays.asList(equipmentWidgetItems));
    return necklaces;
}
Also used : InventoryWidgetItemQuery(net.runelite.api.queries.InventoryWidgetItemQuery) EquipmentItemQuery(net.runelite.api.queries.EquipmentItemQuery) Query(net.runelite.api.Query) EquipmentItemQuery(net.runelite.api.queries.EquipmentItemQuery) InventoryWidgetItemQuery(net.runelite.api.queries.InventoryWidgetItemQuery) ArrayList(java.util.ArrayList) WidgetItem(net.runelite.api.widgets.WidgetItem)

Example 3 with EquipmentItemQuery

use of net.runelite.api.queries.EquipmentItemQuery 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;
}
Also used : InventoryWidgetItemQuery(net.runelite.api.queries.InventoryWidgetItemQuery) EquipmentItemQuery(net.runelite.api.queries.EquipmentItemQuery) Query(net.runelite.api.Query) EquipmentItemQuery(net.runelite.api.queries.EquipmentItemQuery) InventoryWidgetItemQuery(net.runelite.api.queries.InventoryWidgetItemQuery) ArrayList(java.util.ArrayList) WidgetItem(net.runelite.api.widgets.WidgetItem)

Aggregations

Query (net.runelite.api.Query)3 EquipmentItemQuery (net.runelite.api.queries.EquipmentItemQuery)3 InventoryWidgetItemQuery (net.runelite.api.queries.InventoryWidgetItemQuery)3 WidgetItem (net.runelite.api.widgets.WidgetItem)3 ArrayList (java.util.ArrayList)2