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);
}
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);
}
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);
}
}
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);
}
}
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);
}
}
Aggregations