use of net.runelite.api.events.MenuEntryAdded 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;
}
Aggregations