use of net.runelite.api.GrandExchangeOffer in project runelite by runelite.
the class RSClientMixin method onGrandExchangeOffersChanged.
@Inject
@FieldHook("grandExchangeOffers")
public static void onGrandExchangeOffersChanged(int idx) {
if (idx == -1) {
return;
}
GrandExchangeOffer internalOffer = client.getGrandExchangeOffers()[idx];
if (internalOffer == null) {
return;
}
GrandExchangeOfferChanged offerChangedEvent = new GrandExchangeOfferChanged();
offerChangedEvent.setOffer(internalOffer);
offerChangedEvent.setSlot(idx);
eventBus.post(offerChangedEvent);
}
use of net.runelite.api.GrandExchangeOffer in project runelite by runelite.
the class GrandExchangePlugin method onGrandExchangeOfferChanged.
@Subscribe
public void onGrandExchangeOfferChanged(GrandExchangeOfferChanged offerEvent) {
GrandExchangeOffer offer = offerEvent.getOffer();
ItemComposition offerItem = itemManager.getItemComposition(offer.getItemId());
boolean shouldStack = offerItem.isStackable() || offer.getTotalQuantity() > 1;
BufferedImage itemImage = itemManager.getImage(offer.getItemId(), offer.getTotalQuantity(), shouldStack);
SwingUtilities.invokeLater(() -> panel.updateOffer(offerItem, itemImage, offerEvent.getOffer(), offerEvent.getSlot()));
}
Aggregations