Search in sources :

Example 11 with FieldHook

use of net.runelite.api.mixins.FieldHook in project runelite by runelite.

the class RSClientMixin method gameStateChanged.

@FieldHook("gameState")
@Inject
public static void gameStateChanged(int idx) {
    GameStateChanged gameStateChange = new GameStateChanged();
    gameStateChange.setGameState(client.getGameState());
    eventBus.post(gameStateChange);
}
Also used : GameStateChanged(net.runelite.api.events.GameStateChanged) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Example 12 with FieldHook

use of net.runelite.api.mixins.FieldHook 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)

Example 13 with FieldHook

use of net.runelite.api.mixins.FieldHook in project runelite by runelite.

the class RSClientMixin method boostedSkillLevelsChanged.

@FieldHook("boostedSkillLevels")
@Inject
public static void boostedSkillLevelsChanged(int idx) {
    Skill[] skills = Skill.values();
    if (idx >= 0 && idx < skills.length - 1) {
        Skill updatedSkill = skills[idx];
        BoostedLevelChanged boostedLevelChanged = new BoostedLevelChanged();
        boostedLevelChanged.setSkill(updatedSkill);
        eventBus.post(boostedLevelChanged);
    }
}
Also used : Skill(net.runelite.api.Skill) BoostedLevelChanged(net.runelite.api.events.BoostedLevelChanged) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Example 14 with FieldHook

use of net.runelite.api.mixins.FieldHook in project runelite by runelite.

the class RSClientMixin method resizeChanged.

@FieldHook("isResized")
@Inject
public static void resizeChanged(int idx) {
    // maybe couple with varbitChanged. resizeable may not be a varbit but it would fit with the other client settings.
    ResizeableChanged resizeableChanged = new ResizeableChanged();
    resizeableChanged.setResized(client.isResized());
    eventBus.post(resizeableChanged);
}
Also used : ResizeableChanged(net.runelite.api.events.ResizeableChanged) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Example 15 with FieldHook

use of net.runelite.api.mixins.FieldHook in project runelite by runelite.

the class RSTileMixin method groundObjectChanged.

@FieldHook("groundObject")
@Inject
public void groundObjectChanged(int idx) {
    GroundObject previous = previousGroundObject;
    GroundObject current = getGroundObject();
    previousGroundObject = current;
    if (current == null && previous != null) {
        GroundObjectDespawned groundObjectDespawned = new GroundObjectDespawned();
        groundObjectDespawned.setTile(this);
        groundObjectDespawned.setGroundObject(previous);
        eventBus.post(groundObjectDespawned);
    } else if (current != null && previous == null) {
        GroundObjectSpawned groundObjectSpawned = new GroundObjectSpawned();
        groundObjectSpawned.setTile(this);
        groundObjectSpawned.setGroundObject(current);
        eventBus.post(groundObjectSpawned);
    } else if (current != null && previous != null) {
        GroundObjectChanged groundObjectChanged = new GroundObjectChanged();
        groundObjectChanged.setTile(this);
        groundObjectChanged.setPrevious(previous);
        groundObjectChanged.setGroundObject(current);
        eventBus.post(groundObjectChanged);
    }
}
Also used : GroundObjectSpawned(net.runelite.api.events.GroundObjectSpawned) GroundObject(net.runelite.api.GroundObject) GroundObjectChanged(net.runelite.api.events.GroundObjectChanged) GroundObjectDespawned(net.runelite.api.events.GroundObjectDespawned) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Aggregations

FieldHook (net.runelite.api.mixins.FieldHook)20 Inject (net.runelite.api.mixins.Inject)20 Skill (net.runelite.api.Skill)2 Actor (net.runelite.api.Actor)1 DecorativeObject (net.runelite.api.DecorativeObject)1 GameObject (net.runelite.api.GameObject)1 GrandExchangeOffer (net.runelite.api.GrandExchangeOffer)1 GroundObject (net.runelite.api.GroundObject)1 MenuAction (net.runelite.api.MenuAction)1 Point (net.runelite.api.Point)1 WallObject (net.runelite.api.WallObject)1 AnimationChanged (net.runelite.api.events.AnimationChanged)1 BoostedLevelChanged (net.runelite.api.events.BoostedLevelChanged)1 DecorativeObjectChanged (net.runelite.api.events.DecorativeObjectChanged)1 DecorativeObjectDespawned (net.runelite.api.events.DecorativeObjectDespawned)1 DecorativeObjectSpawned (net.runelite.api.events.DecorativeObjectSpawned)1 DraggingWidgetChanged (net.runelite.api.events.DraggingWidgetChanged)1 ExperienceChanged (net.runelite.api.events.ExperienceChanged)1 GameObjectChanged (net.runelite.api.events.GameObjectChanged)1 GameObjectDespawned (net.runelite.api.events.GameObjectDespawned)1