Class ColorPickerPopup
java.lang.Object
johnsmith.configoverhauled.api.client.gui.popup.AbstractConfigPopup<Integer>
johnsmith.configoverhauled.impl.client.gui.popup.ColorPickerPopup
- All Implemented Interfaces:
ConfigPopup, net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.TabOrderedElement
Detailed modal color picker supporting both
RGB (#RRGGBB) and
ARGB (#AARRGGBB) properties.
Features a 2D Saturation/Value square, vertical Hue spectrum bar, optional Alpha bar with transparency checkerboard, clickable Old/New comparison swatches, and bidirectionally synchronized Hex and R/G/B/(A) numeric fields.
-
Field Summary
Fields inherited from class AbstractConfigPopup
applyButton, BACKDROP_COLOR, BORDER_COLOR, cancelButton, contentHeight, contentLeft, contentTop, contentWidth, copyIdButton, description, DESCRIPTION_COLOR, DIVIDER_COLOR, font, footerHeight, FRAME_BG_COLOR, FRAME_PADDING, frameHeight, frameLeft, frameTop, frameWidth, HEADER_BG_COLOR, headerHeight, isLocked, minecraft, onApply, parentScreen, property, resetButton, screenHeight, screenWidth, title, TITLE_COLOR -
Constructor Summary
ConstructorsConstructorDescriptionColorPickerPopup(ConfigScreen parentScreen, net.minecraft.client.Minecraft minecraft, DefaultProperty.Bounded<Integer> property, int initialColor, boolean hasAlpha, boolean isLocked, Consumer<Integer> onApply) -
Method Summary
Modifier and TypeMethodDescriptionprotected Integerprotected booleanstatic voiddrawCheckerboard(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int x, int y, int width, int height, int cellSize) protected voidextractBody(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTick) Renders custom non-widget content inside the popup body (drawn beneath child widgets).protected net.minecraft.network.chat.Componentprotected intprotected intprotected voidinitContent(int left, int top, int width, int height) Initializes the popup's body widgets inside the provided inner content bounds.protected booleanbooleanmouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean doubleClick) booleanmouseDragged(net.minecraft.client.input.MouseButtonEvent event, double dragX, double dragY) booleanmouseReleased(net.minecraft.client.input.MouseButtonEvent event) protected voidMethods inherited from class AbstractConfigPopup
addListener, addRenderableWidget, applyAndClose, charTyped, clearWidgets, dismiss, extractBackdrop, extractForeground, extractFrame, extractHeader, extractRenderState, getApplyButtonLabel, getCancelButtonLabel, getFocusedWidget, getHeaderRightPadding, getMaxDescriptionLines, getResetButtonLabel, init, initFooter, initHeaderWidgets, isInsideFrame, keyPressed, keyReleased, mouseScrolled, removeWidget, setFocusedWidget, showCopyIdButton, showFooter, showResetButton, updateFooterButtonsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ConfigPopup
closeOnEscape, closeOnOutsideClick, isFocused, onClose, setFocused, tickMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, getCurrentFocusPath, getRectangle, isMouseOver, mouseMoved, nextFocusPath, preeditUpdated, shouldTakeFocusAfterInteractionMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Constructor Details
-
ColorPickerPopup
public ColorPickerPopup(ConfigScreen parentScreen, net.minecraft.client.Minecraft minecraft, DefaultProperty.Bounded<Integer> property, int initialColor, boolean hasAlpha, boolean isLocked, Consumer<Integer> onApply)
-
-
Method Details
-
getPreferredWidth
protected int getPreferredWidth()- Overrides:
getPreferredWidthin classAbstractConfigPopup<Integer>
-
getPreferredHeight
protected int getPreferredHeight()- Overrides:
getPreferredHeightin classAbstractConfigPopup<Integer>
-
getDefaultValueTooltip
protected net.minecraft.network.chat.Component getDefaultValueTooltip()- Overrides:
getDefaultValueTooltipin classAbstractConfigPopup<Integer>
-
initContent
protected void initContent(int left, int top, int width, int height) Description copied from class:AbstractConfigPopupInitializes the popup's body widgets inside the provided inner content bounds.- Specified by:
initContentin classAbstractConfigPopup<Integer>
-
isWorkingValueValid
protected boolean isWorkingValueValid()- Overrides:
isWorkingValueValidin classAbstractConfigPopup<Integer>
-
canResetWorkingValue
protected boolean canResetWorkingValue()- Overrides:
canResetWorkingValuein classAbstractConfigPopup<Integer>
-
resetWorkingValue
protected void resetWorkingValue()- Overrides:
resetWorkingValuein classAbstractConfigPopup<Integer>
-
buildResultValue
- Overrides:
buildResultValuein classAbstractConfigPopup<Integer>
-
extractBody
protected void extractBody(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTick) Description copied from class:AbstractConfigPopupRenders custom non-widget content inside the popup body (drawn beneath child widgets).- Overrides:
extractBodyin classAbstractConfigPopup<Integer>
-
mouseClicked
public boolean mouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean doubleClick) - Specified by:
mouseClickedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
mouseClickedin classAbstractConfigPopup<Integer>
-
mouseDragged
public boolean mouseDragged(net.minecraft.client.input.MouseButtonEvent event, double dragX, double dragY) - Specified by:
mouseDraggedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
mouseDraggedin classAbstractConfigPopup<Integer>
-
mouseReleased
public boolean mouseReleased(net.minecraft.client.input.MouseButtonEvent event) - Specified by:
mouseReleasedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
mouseReleasedin classAbstractConfigPopup<Integer>
-
drawCheckerboard
public static void drawCheckerboard(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int x, int y, int width, int height, int cellSize)
-