Search in sources :

Example 1 with GrandExchangeOfferChanged

use of net.runelite.api.events.GrandExchangeOfferChanged 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);
}
Also used : GrandExchangeOffer(net.runelite.api.GrandExchangeOffer) GrandExchangeOfferChanged(net.runelite.api.events.GrandExchangeOfferChanged) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Aggregations

GrandExchangeOffer (net.runelite.api.GrandExchangeOffer)1 GrandExchangeOfferChanged (net.runelite.api.events.GrandExchangeOfferChanged)1 FieldHook (net.runelite.api.mixins.FieldHook)1 Inject (net.runelite.api.mixins.Inject)1