Search in sources :

Example 16 with FieldHook

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

the class RSTileMixin method decorativeObjectChanged.

@FieldHook("decorativeObject")
@Inject
public void decorativeObjectChanged(int idx) {
    DecorativeObject previous = previousDecorativeObject;
    DecorativeObject current = getDecorativeObject();
    previousDecorativeObject = current;
    if (current == null && previous != null) {
        DecorativeObjectDespawned decorativeObjectDespawned = new DecorativeObjectDespawned();
        decorativeObjectDespawned.setTile(this);
        decorativeObjectDespawned.setDecorativeObject(previous);
        eventBus.post(decorativeObjectDespawned);
    } else if (current != null && previous == null) {
        DecorativeObjectSpawned decorativeObjectSpawned = new DecorativeObjectSpawned();
        decorativeObjectSpawned.setTile(this);
        decorativeObjectSpawned.setDecorativeObject(current);
        eventBus.post(decorativeObjectSpawned);
    } else if (current != null && previous != null) {
        DecorativeObjectChanged decorativeObjectChanged = new DecorativeObjectChanged();
        decorativeObjectChanged.setTile(this);
        decorativeObjectChanged.setPrevious(previous);
        decorativeObjectChanged.setDecorativeObject(current);
        eventBus.post(decorativeObjectChanged);
    }
}
Also used : DecorativeObjectDespawned(net.runelite.api.events.DecorativeObjectDespawned) DecorativeObjectChanged(net.runelite.api.events.DecorativeObjectChanged) DecorativeObject(net.runelite.api.DecorativeObject) DecorativeObjectSpawned(net.runelite.api.events.DecorativeObjectSpawned) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Example 17 with FieldHook

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

the class RSTileMixin method wallObjectChanged.

@FieldHook("wallObject")
@Inject
public void wallObjectChanged(int idx) {
    WallObject previous = previousWallObject;
    WallObject current = getWallObject();
    previousWallObject = current;
    if (current == null && previous != null) {
        WallObjectDespawned wallObjectDespawned = new WallObjectDespawned();
        wallObjectDespawned.setTile(this);
        wallObjectDespawned.setWallObject(previous);
        eventBus.post(wallObjectDespawned);
    } else if (current != null && previous == null) {
        WallObjectSpawned wallObjectSpawned = new WallObjectSpawned();
        wallObjectSpawned.setTile(this);
        wallObjectSpawned.setWallObject(current);
        eventBus.post(wallObjectSpawned);
    } else if (current != null && previous != null) {
        WallObjectChanged wallObjectChanged = new WallObjectChanged();
        wallObjectChanged.setTile(this);
        wallObjectChanged.setPrevious(previous);
        wallObjectChanged.setWallObject(current);
        eventBus.post(wallObjectChanged);
    }
}
Also used : WallObject(net.runelite.api.WallObject) WallObjectDespawned(net.runelite.api.events.WallObjectDespawned) WallObjectChanged(net.runelite.api.events.WallObjectChanged) WallObjectSpawned(net.runelite.api.events.WallObjectSpawned) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Example 18 with FieldHook

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

the class RSTileMixin method itemLayerChanged.

@FieldHook("itemLayer")
@Inject
public void itemLayerChanged(int idx) {
    ItemLayerChanged itemLayerChanged = new ItemLayerChanged(this);
    eventBus.post(itemLayerChanged);
}
Also used : ItemLayerChanged(net.runelite.api.events.ItemLayerChanged) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Example 19 with FieldHook

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

the class MenuEntryEventMixin method onMenuOptionsChanged.

@FieldHook("menuOptionCount")
@Inject
public static void onMenuOptionsChanged(int idx) {
    int newCount = client.getMenuOptionCount();
    if (newCount == oldMenuEntryCount + 1) {
        MenuEntryAdded event = new MenuEntryAdded(client.getMenuOptions()[newCount - 1], client.getMenuTargets()[newCount - 1], client.getMenuTypes()[newCount - 1], client.getMenuIdentifiers()[newCount - 1], client.getMenuActionParams0()[newCount - 1], client.getMenuActionParams1()[newCount - 1]);
        eventBus.post(event);
    }
    oldMenuEntryCount = newCount;
}
Also used : MenuEntryAdded(net.runelite.api.events.MenuEntryAdded) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Example 20 with FieldHook

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

the class RSNpcCompositionMixin method actionsHook.

@FieldHook("actions")
@Inject
public void actionsHook(int idx) {
    NpcActionChanged npcActionChanged = new NpcActionChanged();
    npcActionChanged.setNpcComposition(this);
    npcActionChanged.setIdx(idx);
    eventBus.post(npcActionChanged);
}
Also used : NpcActionChanged(net.runelite.api.events.NpcActionChanged) 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