Search in sources :

Example 1 with FieldHook

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

the class RSActorMixin method animationChanged.

@FieldHook("animation")
@Inject
public void animationChanged(int idx) {
    AnimationChanged animationChange = new AnimationChanged();
    animationChange.setActor(this);
    eventBus.post(animationChange);
}
Also used : AnimationChanged(net.runelite.api.events.AnimationChanged) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Example 2 with FieldHook

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

the class RSClientMixin method cachedNPCsChanged.

@FieldHook("cachedNPCs")
@Inject
public static void cachedNPCsChanged(int idx) {
    RSNPC[] cachedNPCs = client.getCachedNPCs();
    if (idx < 0 || idx >= cachedNPCs.length) {
        return;
    }
    RSNPC npc = cachedNPCs[idx];
    if (npc != null) {
        npc.setIndex(idx);
    }
}
Also used : RSNPC(net.runelite.rs.api.RSNPC) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Example 3 with FieldHook

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

the class RSClientMixin method settingsChanged.

@FieldHook("clientVarps")
@Inject
public static void settingsChanged(int idx) {
    VarbitChanged varbitChanged = new VarbitChanged();
    eventBus.post(varbitChanged);
}
Also used : VarbitChanged(net.runelite.api.events.VarbitChanged) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Example 4 with FieldHook

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

the class RSClientMixin method mapRegionsChanged.

@FieldHook("mapRegions")
@Inject
public static void mapRegionsChanged(int idx) {
    MapRegionChanged regionChanged = new MapRegionChanged();
    regionChanged.setIndex(idx);
    eventBus.post(regionChanged);
}
Also used : MapRegionChanged(net.runelite.api.events.MapRegionChanged) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Example 5 with FieldHook

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

the class RSClientMixin method playerOptionsChanged.

@FieldHook("playerOptions")
@Inject
public static void playerOptionsChanged(int idx) {
    // Reset the menu type
    MenuAction[] playerActions = { PLAYER_FIRST_OPTION, PLAYER_SECOND_OPTION, PLAYER_THIRD_OPTION, PLAYER_FOURTH_OPTION, PLAYER_FIFTH_OPTION, PLAYER_SIXTH_OPTION, PLAYER_SEVENTH_OPTION, PLAYER_EIGTH_OPTION };
    if (idx >= 0 && idx < playerActions.length) {
        MenuAction playerAction = playerActions[idx];
        client.getPlayerMenuTypes()[idx] = playerAction.getId();
    }
    PlayerMenuOptionsChanged optionsChanged = new PlayerMenuOptionsChanged();
    optionsChanged.setIndex(idx);
    eventBus.post(optionsChanged);
}
Also used : MenuAction(net.runelite.api.MenuAction) PlayerMenuOptionsChanged(net.runelite.api.events.PlayerMenuOptionsChanged) 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