Interface IQuickConfigMenu


@NonExtendable public interface IQuickConfigMenu
A modal menu for editing selected config values over the current Minecraft screen. MezzConfigGui draws it above the host screen with a dimmed backdrop and handles its input and lifecycle. Host controls and shortcuts are blocked while open. Clicking outside the menu and its editor popups closes it without activating the host. All methods must be called on the client thread.
Since:
0.6.4
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the quick menu and apply its pending edits, including selection changes.
    boolean
    Whether this quick menu is open.
    default boolean
    open(Supplier<net.minecraft.client.renderer.Rect2i> anchor, BooleanSupplier available)
    Opens beside a custom control.
    boolean
    open(Supplier<net.minecraft.client.renderer.Rect2i> anchor, BooleanSupplier available, Runnable onAnchorClick, Supplier<@Nullable ConfigInfo> anchorInfo)
    Opens beside a custom control that remains usable while the menu is open.
    default boolean
    open(net.minecraft.client.gui.components.AbstractWidget button)
    Open the quick menu in the current screen, replacing any other quick menu.
  • Method Details

    • open

      default boolean open(net.minecraft.client.gui.components.AbstractWidget button)
      Open the quick menu in the current screen, replacing any other quick menu. The same menu can be reopened after closing. An empty selection still allows choosing options with Customize. Opening fails when there is no host screen, the host is a MezzConfigGui config screen, the menu is unavailable, the anchor has nonpositive dimensions, or there is insufficient space to display the menu.
      Parameters:
      button - the control to open beside
      Returns:
      true if opened; false if the quick menu cannot be displayed
      Since:
      0.6.4
    • open

      default boolean open(Supplier<net.minecraft.client.renderer.Rect2i> anchor, BooleanSupplier available)
      Opens beside a custom control. Bounds use GUI-scaled screen coordinates and are read while open.
      Parameters:
      anchor - current control bounds; nonpositive dimensions close the menu
      available - whether the control is available; false closes the menu
      Returns:
      whether the menu opened
      Since:
      0.6.4
    • open

      boolean open(Supplier<net.minecraft.client.renderer.Rect2i> anchor, BooleanSupplier available, Runnable onAnchorClick, Supplier<@Nullable ConfigInfo> anchorInfo)
      Opens beside a custom control that remains usable while the menu is open.
      Parameters:
      anchor - current control bounds in GUI-scaled coordinates
      available - whether the control is available
      onAnchorClick - action to run after closing and saving when the control is clicked
      anchorInfo - help shown when hovering the control, or null for no help
      Returns:
      whether the menu opened
      Since:
      0.6.4
    • close

      void close()
      Close the quick menu and apply its pending edits, including selection changes. This also happens when the menu closes after an outside click, screen change, or replacement by another menu. If saving fails, pending edits are retained for retry when the same menu is reopened and closed.
      Since:
      0.6.4
    • isOpen

      boolean isOpen()
      Whether this quick menu is open.
      Since:
      0.6.4