Class NumericDetailPopup<T extends Number & Comparable<T>>
java.lang.Object
johnsmith.configoverhauled.api.client.gui.popup.AbstractConfigPopup<T>
johnsmith.configoverhauled.impl.client.gui.popup.TextDetailPopup<T>
johnsmith.configoverhauled.impl.client.gui.popup.NumericDetailPopup<T>
- Type Parameters:
T- The numeric value type.
- All Implemented Interfaces:
ConfigPopup, net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.TabOrderedElement
Detailed modal editor for bounded numeric properties (
Integer, Long, Float, Double).
Provides live numeric and range validation, explicit out-of-bounds error messages, and an optional bidirectionally synchronized slider whenever the property defines a finite, non-sentinel numeric range.
-
Nested Class Summary
Nested classes/interfaces inherited from class TextDetailPopup
TextDetailPopup.ValidationResult<T> -
Field Summary
Fields inherited from class TextDetailPopup
clearButton, editBox, INFO_TEXT_COLOR, INVALID_TEXT_COLOR, lastAcceptedText, parsedValue, VALID_TEXT_COLOR, validationError, workingTextFields 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
ConstructorsConstructorDescriptionNumericDetailPopup(ConfigScreen parentScreen, net.minecraft.client.Minecraft minecraft, DefaultProperty.Bounded<T> property, @Nullable String initialText, Function<String, T> parser, Predicate<String> partialPredicate, String regexFilter, Function<T, String> formatter, boolean isLocked, Consumer<T> onApply) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringformatValue(T value) protected intprotected Stringprotected @Nullable net.minecraft.network.chat.Componentprotected voidinitExtraContent(int left, int top, int width, int height) protected voidonWorkingValueChanged(T newValue, boolean valid) protected TextDetailPopup.ValidationResult<T> validateInput(String text) Methods inherited from class TextDetailPopup
buildResultValue, canResetWorkingValue, extractBody, getDefaultInfoText, getDefaultValueTooltip, getMaxLength, getPreferredWidth, initContent, isWorkingValueValid, resetWorkingValue, revalidate, setWorkingText, trimToWidthMethods 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, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, onClose, 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, setFocused, tickMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
capturesInput, getBorderForArrowNavigation, getCurrentFocusPath, getRectangle, isMouseOver, mouseMoved, nextFocusPath, preeditUpdated, shouldTakeFocusAfterInteractionMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Constructor Details
-
NumericDetailPopup
public NumericDetailPopup(ConfigScreen parentScreen, net.minecraft.client.Minecraft minecraft, DefaultProperty.Bounded<T> property, @Nullable @Nullable String initialText, Function<String, T> parser, Predicate<String> partialPredicate, String regexFilter, Function<T, String> formatter, boolean isLocked, Consumer<T> onApply)
-
-
Method Details
-
getPreferredHeight
protected int getPreferredHeight()- Overrides:
getPreferredHeightin classTextDetailPopup<T extends Number & Comparable<T>>
-
getRegexFilter
- Overrides:
getRegexFilterin classTextDetailPopup<T extends Number & Comparable<T>>
-
formatValue
- Specified by:
formatValuein classTextDetailPopup<T extends Number & Comparable<T>>
-
validateInput
- Specified by:
validateInputin classTextDetailPopup<T extends Number & Comparable<T>>
-
getRightInfoText
@Nullable protected @Nullable net.minecraft.network.chat.Component getRightInfoText()- Overrides:
getRightInfoTextin classTextDetailPopup<T extends Number & Comparable<T>>
-
initExtraContent
protected void initExtraContent(int left, int top, int width, int height) - Overrides:
initExtraContentin classTextDetailPopup<T extends Number & Comparable<T>>
-
onWorkingValueChanged
- Overrides:
onWorkingValueChangedin classTextDetailPopup<T extends Number & Comparable<T>>
-