Class 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 a MenuRequest and 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 InputScope rather 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
      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.
      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)  
      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)  
      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.
      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)  
      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)  
      java.util.List<net.runelite.api.MenuAction> unsupportedActions()
      Actions this dispatcher cannot carry; the router falls back to another tier.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 Client keeps 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:
        dispatch in interface Dispatcher
      • 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:
        dispatch in interface Dispatcher
      • 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: Dispatcher
        Actions this dispatcher cannot carry; the router falls back to another tier.
        Specified by:
        unsupportedActions in interface Dispatcher