Class EnchantWidget.Locked
java.lang.Object
johnsmith.enchantingoverhauled.client.gui.widget.enchant.EnchantWidget
johnsmith.enchantingoverhauled.client.gui.widget.enchant.EnchantWidget.Locked
- Enclosing class:
EnchantWidget
Represents a widget where the underlying enchantment action cannot be performed
due to missing context criteria (e.g., attempting to upgrade an item but providing
a source catalyst with an insufficient level or wrong type).
Renders identically to an unaffordable available slot, drawing a disabled background and grayed-out text components, and intercepts all mouse interactions to prevent execution.
-
Nested Class Summary
Nested classes/interfaces inherited from class johnsmith.enchantingoverhauled.client.gui.widget.enchant.EnchantWidget
EnchantWidget.Available, EnchantWidget.Empty, EnchantWidget.Locked, EnchantWidget.Maxed, EnchantWidget.Overleveled -
Field Summary
Fields inherited from class johnsmith.enchantingoverhauled.client.gui.widget.enchant.EnchantWidget
DISABLED_LEVEL_SPRITES, ENABLED_LEVEL_SPRITES, GALACTIC_FONT_ID, isHovered, layout, onPressAction, state, texIndex, usePlainBackground, x, y -
Constructor Summary
ConstructorsConstructorDescriptionLocked(int x, int y, EnchantRenderState state, int texIndex, boolean usePlainBackground, Runnable onPressAction) Constructs a new EnchantWidget.Locked. -
Method Summary
Modifier and TypeMethodDescriptionbooleanmouseClicked(double mouseX, double mouseY, int button) Denies all interaction with this widget, as the underlying action is locked.protected voidrenderWidget(net.minecraft.client.gui.GuiGraphics context, int mouseX, int mouseY, float partialTick) Renders the widget in a disabled visual state.Methods inherited from class johnsmith.enchantingoverhauled.client.gui.widget.enchant.EnchantWidget
drawScrollingString, getFormattedEnchantmentName, getState, render, setOnPressAction, setState, setTexIndex, updatePosition
-
Constructor Details
-
Method Details
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) Denies all interaction with this widget, as the underlying action is locked.- Overrides:
mouseClickedin classEnchantWidget- Parameters:
mouseX- The X coordinate of the mouse pointer.mouseY- The Y coordinate of the mouse pointer.button- The mouse button being pressed.- Returns:
- Always false.
-
renderWidget
protected void renderWidget(net.minecraft.client.gui.GuiGraphics context, int mouseX, int mouseY, float partialTick) Renders the widget in a disabled visual state.- Specified by:
renderWidgetin classEnchantWidget- Parameters:
context- The GUI graphics context to draw to.mouseX- The current mouse X coordinate.mouseY- The current mouse Y coordinate.partialTick- The partial tick time for animations.
-