Package net.openosrs.api.dispatch
Class MenuDispatcher
- java.lang.Object
-
- net.openosrs.api.dispatch.MenuDispatcher
-
- All Implemented Interfaces:
Dispatcher
@Singleton public class MenuDispatcher extends java.lang.Object implements Dispatcher
The interaction entry point every service calls.This is a facade over
InputRouter: it packages the call into aMenuRequestand lets the router decide whether the native menu pipeline or the cursor delivers it. The default is the native pipeline, so behaviour is unchanged unless a cursor backend is registered and selected.Callers that must have one specific path should say so with an
InputScoperather than reaching past this class.
-
-
Constructor Summary
Constructors Constructor Description MenuDispatcher(InputRouter router)MenuDispatcher(net.runelite.api.Client client)Build a dispatcher backed by the native menu pipeline alone.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidanticipate(net.runelite.api.MenuAction action, int identifier, int param0, int param1, java.lang.String option, java.lang.String target, int itemId, int worldViewId)Hint that an interaction is likely imminent.booleandispatch(net.runelite.api.MenuAction action, int identifier, int param0, int param1, java.lang.String option, java.lang.String target, int itemId, int worldViewId)booleandispatch(net.runelite.api.MenuAction action, int identifier, int param0, int param1, java.lang.String option, java.lang.String target, int itemId, int worldViewId, int canvasX, int canvasY)InputModeresolveMode(net.runelite.api.MenuAction action, int identifier, int param0, int param1, java.lang.String option, java.lang.String target, int itemId, int worldViewId)Which path a request of this shape would take right now.SubmissionResultsubmit(net.runelite.api.MenuAction action, int identifier, int param0, int param1, java.lang.String option, java.lang.String target, int itemId, int worldViewId)SubmissionResultsubmit(net.runelite.api.MenuAction action, int identifier, int param0, int param1, java.lang.String option, java.lang.String target, int itemId, int worldViewId, int canvasX, int canvasY)java.util.List<net.runelite.api.MenuAction>unsupportedActions()Actions this dispatcher cannot carry; the router falls back to another tier.
-
-
-
Constructor Detail
-
MenuDispatcher
@Inject public MenuDispatcher(InputRouter router)
-
MenuDispatcher
public MenuDispatcher(net.runelite.api.Client client)
Build a dispatcher backed by the native menu pipeline alone.Kept so that code holding only a
Clientkeeps working. There is no cursor backend on this route and no shared settings, so the result always dispatches natively regardless of the user's preference. Prefer the injected constructor anywhere the container is available.
-
-
Method Detail
-
dispatch
public boolean dispatch(net.runelite.api.MenuAction action, int identifier, int param0, int param1, java.lang.String option, java.lang.String target, int itemId, int worldViewId)- Specified by:
dispatchin interfaceDispatcher
-
dispatch
public boolean dispatch(net.runelite.api.MenuAction action, int identifier, int param0, int param1, java.lang.String option, java.lang.String target, int itemId, int worldViewId, int canvasX, int canvasY)- Specified by:
dispatchin interfaceDispatcher
-
submit
public SubmissionResult submit(net.runelite.api.MenuAction action, int identifier, int param0, int param1, java.lang.String option, java.lang.String target, int itemId, int worldViewId)
-
submit
public SubmissionResult submit(net.runelite.api.MenuAction action, int identifier, int param0, int param1, java.lang.String option, java.lang.String target, int itemId, int worldViewId, int canvasX, int canvasY)
-
anticipate
public void anticipate(net.runelite.api.MenuAction action, int identifier, int param0, int param1, java.lang.String option, java.lang.String target, int itemId, int worldViewId)Hint that an interaction is likely imminent. Only the cursor backend acts on this, and only when it is the selected mode; otherwise it is a no-op.
-
resolveMode
public InputMode resolveMode(net.runelite.api.MenuAction action, int identifier, int param0, int param1, java.lang.String option, java.lang.String target, int itemId, int worldViewId)
Which path a request of this shape would take right now.
-
unsupportedActions
public java.util.List<net.runelite.api.MenuAction> unsupportedActions()
Description copied from interface:DispatcherActions this dispatcher cannot carry; the router falls back to another tier.- Specified by:
unsupportedActionsin interfaceDispatcher
-
-