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 TypeMethodDescriptiondefault booleanWhether pressing the Escape key should dismiss the popup.default booleanWhether left-clicking outside the popup frame should dismiss it.voidextractRenderState(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.voidinit(int screenWidth, int screenHeight) Initializes or recalculates the popup's layout for the given parent screen dimensions.default booleandefault voidonClose()Invoked when the popup is dismissed, replaced, or when the parent screen closes.default voidsetFocused(boolean focused) default voidtick()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, shouldTakeFocusAfterInteractionMethods 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:
trueto close when clicking outside the modal bounds.
-
closeOnEscape
default boolean closeOnEscape()Whether pressing the Escape key should dismiss the popup.- Returns:
trueto close on Escape.
-
setFocused
default void setFocused(boolean focused) - Specified by:
setFocusedin interfacenet.minecraft.client.gui.components.events.GuiEventListener
-
isFocused
default boolean isFocused()- Specified by:
isFocusedin interfacenet.minecraft.client.gui.components.events.GuiEventListener
-