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