Search in sources :

Example 41 with Inject

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

the class RSClientMixin method setMenuEntries.

@Inject
@Override
public void setMenuEntries(MenuEntry[] entries) {
    int count = 0;
    String[] menuOptions = getMenuOptions();
    String[] menuTargets = getMenuTargets();
    int[] menuIdentifiers = getMenuIdentifiers();
    int[] menuTypes = getMenuTypes();
    int[] params0 = getMenuActionParams0();
    int[] params1 = getMenuActionParams1();
    for (MenuEntry entry : entries) {
        menuOptions[count] = entry.getOption();
        menuTargets[count] = entry.getTarget();
        menuIdentifiers[count] = entry.getIdentifier();
        menuTypes[count] = entry.getType();
        params0[count] = entry.getParam0();
        params1[count] = entry.getParam1();
        ++count;
    }
    setMenuOptionCount(count);
}
Also used : MenuEntry(net.runelite.api.MenuEntry) LocalPoint(net.runelite.api.coords.LocalPoint) Point(net.runelite.api.Point) Inject(net.runelite.api.mixins.Inject)

Example 42 with Inject

use of net.runelite.api.mixins.Inject 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 43 with Inject

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

Example 44 with Inject

use of net.runelite.api.mixins.Inject 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 45 with Inject

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

Aggregations

Inject (net.runelite.api.mixins.Inject)57 Point (net.runelite.api.Point)20 FieldHook (net.runelite.api.mixins.FieldHook)20 ArrayList (java.util.ArrayList)14 LocalPoint (net.runelite.api.coords.LocalPoint)10 RSWidget (net.runelite.rs.api.RSWidget)6 Vertex (net.runelite.api.model.Vertex)5 Widget (net.runelite.api.widgets.Widget)5 Node (net.runelite.api.Node)4 RSNode (net.runelite.rs.api.RSNode)4 WidgetNode (net.runelite.api.WidgetNode)3 Triangle (net.runelite.api.model.Triangle)3 Polygon (java.awt.Polygon)2 MenuEntry (net.runelite.api.MenuEntry)2 Model (net.runelite.api.Model)2 NPC (net.runelite.api.NPC)2 Player (net.runelite.api.Player)2 Skill (net.runelite.api.Skill)2 WidgetItem (net.runelite.api.widgets.WidgetItem)2 RSCombatInfoList (net.runelite.rs.api.RSCombatInfoList)2