Class CycleButton<T>
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractButton
net.minecraft.client.gui.components.CycleButton<T>
- All Implemented Interfaces:
GuiEventListener
,Renderable
,TabOrderedElement
,LayoutElement
,NarratableEntry
,NarrationSupplier
,IAbstractWidgetExtension
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
static interface
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BooleanSupplier
private final boolean
private int
private final Component
private final Function<CycleButton<T>,
MutableComponent> private final CycleButton.OnValueChange<T>
private final OptionInstance.TooltipSupplier<T>
private T
private final CycleButton.ValueListSupplier<T>
Fields inherited from class net.minecraft.client.gui.components.AbstractButton
SPRITES, TEXT_MARGIN
Fields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, width
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorDescriptionCycleButton
(int p_232484_, int p_232485_, int p_232486_, int p_232487_, Component p_232488_, Component p_232489_, int p_232490_, T p_232491_, CycleButton.ValueListSupplier<T> p_232492_, Function<T, Component> p_232493_, Function<CycleButton<T>, MutableComponent> p_232494_, CycleButton.OnValueChange<T> p_232495_, OptionInstance.TooltipSupplier<T> p_232496_, boolean p_232497_) -
Method Summary
Modifier and TypeMethodDescriptionstatic CycleButton.Builder<Boolean>
booleanBuilder
(Component p_168897_, Component p_168898_) static <T> CycleButton.Builder<T>
private MutableComponent
createFullName
(T p_168913_) private Component
createLabelForValue
(T p_168911_) protected MutableComponent
private void
cycleValue
(int p_168909_) private T
getCycledValue
(int p_168915_) getValue()
boolean
mouseScrolled
(double p_168885_, double p_168886_, double p_168887_, double p_294881_) static CycleButton.Builder<Boolean>
static CycleButton.Builder<Boolean>
onOffBuilder
(boolean p_168917_) void
onPress()
void
private void
private void
updateValue
(T p_168906_) void
updateWidgetNarration
(NarrationElementOutput p_168889_) Methods inherited from class net.minecraft.client.gui.components.AbstractButton
keyPressed, onClick, renderString, renderWidget
Methods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, clicked, createTooltipPositioner, defaultButtonNarrationText, getFGColor, getHeight, getMessage, getRectangle, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, onDrag, onRelease, playDownSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setFocused, setHeight, setMessage, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
charTyped, getCurrentFocusPath, keyReleased, mouseMoved
Methods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension
onClick
Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPosition
-
Field Details
-
DEFAULT_ALT_LIST_SELECTOR
-
BOOLEAN_OPTIONS
-
name
-
index
private int index -
value
-
values
-
valueStringifier
-
narrationProvider
-
onValueChange
-
displayOnlyValue
private final boolean displayOnlyValue -
tooltipSupplier
-
-
Constructor Details
-
CycleButton
CycleButton(int p_232484_, int p_232485_, int p_232486_, int p_232487_, Component p_232488_, Component p_232489_, int p_232490_, T p_232491_, CycleButton.ValueListSupplier<T> p_232492_, Function<T, Component> p_232493_, Function<CycleButton<T>, MutableComponent> p_232494_, CycleButton.OnValueChange<T> p_232495_, OptionInstance.TooltipSupplier<T> p_232496_, boolean p_232497_)
-
-
Method Details
-
updateTooltip
private void updateTooltip() -
onPress
public void onPress()- Specified by:
onPress
in classAbstractButton
-
cycleValue
private void cycleValue(int p_168909_) -
getCycledValue
-
mouseScrolled
public boolean mouseScrolled(double p_168885_, double p_168886_, double p_168887_, double p_294881_) -
setValue
-
updateValue
-
createLabelForValue
-
createFullName
-
getValue
-
createNarrationMessage
- Overrides:
createNarrationMessage
in classAbstractWidget
-
updateWidgetNarration
- Specified by:
updateWidgetNarration
in classAbstractWidget
-
createDefaultNarrationMessage
-
builder
-
booleanBuilder
-
onOffBuilder
-
onOffBuilder
-