Package net.mezzdev.config.gui.api
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.7.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the quick menu and apply its pending edits, including selection changes.booleanisOpen()Whether this quick menu is open.default booleanopen(Supplier<net.minecraft.client.renderer.Rect2i> anchor, BooleanSupplier available) Opens beside a custom control.booleanopen(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 booleanopen(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.7.0
-
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 menuavailable- whether the control is available; false closes the menu- Returns:
- whether the menu opened
- Since:
- 0.7.0
-
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 coordinatesavailable- whether the control is availableonAnchorClick- action to run after closing and saving when the control is clickedanchorInfo- help shown when hovering the control, ornullfor no help- Returns:
- whether the menu opened
- Since:
- 0.7.0
-
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.7.0
-
isOpen
boolean isOpen()Whether this quick menu is open.- Since:
- 0.7.0
-