Interface ConfigPopup

All Superinterfaces:
net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.TabOrderedElement
All Known Implementing Classes:
AbstractConfigPopup, ColorPickerPopup, ConfirmPopup, ListDetailPopup, NumericDetailPopup, StringDetailPopup, TextDetailPopup

public interface ConfigPopup extends net.minecraft.client.gui.components.events.GuiEventListener
Contract for an overlay modal popup hosted inside a ConfigScreen.

Popups render on a dedicated stratum above the parent screen without replacing the active Screen, preserving tab selection, scroll offsets, search queries, and group collapse states.

  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Whether pressing the Escape key should dismiss the popup.
    default boolean
    Whether left-clicking outside the popup frame should dismiss it.
    void
    extractRenderState(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTick)
    Renders the popup backdrop, frame, and child widgets on top of the parent screen.
    void
    init(int screenWidth, int screenHeight)
    Initializes or recalculates the popup's layout for the given parent screen dimensions.
    default boolean
     
    default void
    Invoked when the popup is dismissed, replaced, or when the parent screen closes.
    default void
    setFocused(boolean focused)
     
    default void
    Optional per-tick update hook for animations or timed UI states.

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    capturesInput, charTyped, getBorderForArrowNavigation, getCurrentFocusPath, getRectangle, isMouseOver, keyPressed, keyReleased, mouseClicked, mouseDragged, mouseMoved, mouseReleased, mouseScrolled, nextFocusPath, preeditUpdated, shouldTakeFocusAfterInteraction

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Method Details

    • init

      void init(int screenWidth, int screenHeight)
      Initializes or recalculates the popup's layout for the given parent screen dimensions. Invoked when the popup is first opened and whenever the window is resized.
      Parameters:
      screenWidth - The current width of the parent screen.
      screenHeight - The current height of the parent screen.
    • extractRenderState

      void extractRenderState(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTick)
      Renders the popup backdrop, frame, and child widgets on top of the parent screen.
      Parameters:
      guiGraphics - The graphics extractor for the current frame.
      mouseX - The current mouse X coordinate.
      mouseY - The current mouse Y coordinate.
      partialTick - The partial frame tick delta.
    • tick

      default void tick()
      Optional per-tick update hook for animations or timed UI states.
    • onClose

      default void onClose()
      Invoked when the popup is dismissed, replaced, or when the parent screen closes. Implementations that allocate GPU resources (such as dynamic textures) should release them here.
    • closeOnOutsideClick

      default boolean closeOnOutsideClick()
      Whether left-clicking outside the popup frame should dismiss it.
      Returns:
      true to close when clicking outside the modal bounds.
    • closeOnEscape

      default boolean closeOnEscape()
      Whether pressing the Escape key should dismiss the popup.
      Returns:
      true to close on Escape.
    • setFocused

      default void setFocused(boolean focused)
      Specified by:
      setFocused in interface net.minecraft.client.gui.components.events.GuiEventListener
    • isFocused

      default boolean isFocused()
      Specified by:
      isFocused in interface net.minecraft.client.gui.components.events.GuiEventListener