public class WidgetComboBox extends WidgetTextField implements IDrawAfterRender
| Constructor and Description |
|---|
WidgetComboBox(net.minecraft.client.gui.FontRenderer fontRenderer,
int x,
int y,
int width,
int height) |
WidgetComboBox(net.minecraft.client.gui.FontRenderer fontRenderer,
int x,
int y,
int width,
int height,
java.util.function.Consumer<WidgetComboBox> pressable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
charTyped(char key,
int keyCode) |
int |
getSelectedElementIndex() |
<T extends java.lang.Enum<T> & ITranslatableEnum> |
initFromEnum(T initialValue) |
<T extends java.lang.Enum<T>> |
initFromEnum(T initialValue,
java.util.function.Function<T,java.lang.String> xlate)
Convenience method: set up a combo box to display the values of an enum
|
void |
insertText(java.lang.String textToWrite) |
boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers) |
boolean |
mouseClicked(double mouseX,
double mouseY,
int button) |
void |
renderAfterEverythingElse(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int mouseX,
int mouseY,
float partialTick) |
void |
renderButton(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int mouseX,
int mouseY,
float partialTick) |
void |
selectElement(int index) |
void |
setEditable(boolean enabled) |
WidgetComboBox |
setElements(java.util.Collection<java.lang.String> elements) |
WidgetComboBox |
setElements(java.lang.String[] elements) |
WidgetComboBox |
setFixedOptions() |
WidgetComboBox |
setShouldSort(boolean shouldSort) |
addTooltip, setAsPasswordBox, setTooltip, setTooltipcanConsumeInput, changeFocus, createNarrationMessage, deleteChars, deleteWords, getCursorPosition, getHighlighted, getInnerWidth, getScreenX, getValue, getWordPosition, isMouseOver, isVisible, moveCursor, moveCursorTo, moveCursorToEnd, moveCursorToStart, onFocusedChanged, setBordered, setCanLoseFocus, setCursorPosition, setFilter, setFocus, setFormatter, setHighlightPos, setMaxLength, setResponder, setSuggestion, setTextColor, setTextColorUneditable, setValue, setVisible, setX, tickclearFGColor, clicked, getFGColor, getHeight, getMessage, getWidth, getYImage, isFocused, isHovered, isValidClickButton, mouseDragged, mouseReleased, narrate, onClick, onDrag, onRelease, playDownSound, queueNarration, render, renderBg, renderToolTip, setAlpha, setFGColor, setFocused, setHeight, setMessage, setWidthblit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawString, drawString, fill, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLinepublic WidgetComboBox(net.minecraft.client.gui.FontRenderer fontRenderer,
int x,
int y,
int width,
int height)
public WidgetComboBox(net.minecraft.client.gui.FontRenderer fontRenderer,
int x,
int y,
int width,
int height,
java.util.function.Consumer<WidgetComboBox> pressable)
public WidgetComboBox setElements(java.util.Collection<java.lang.String> elements)
public WidgetComboBox setElements(java.lang.String[] elements)
public WidgetComboBox setShouldSort(boolean shouldSort)
public void insertText(java.lang.String textToWrite)
insertText in class net.minecraft.client.gui.widget.TextFieldWidgetpublic void renderButton(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int mouseX,
int mouseY,
float partialTick)
renderButton in class WidgetTextFieldpublic void renderAfterEverythingElse(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int mouseX,
int mouseY,
float partialTick)
renderAfterEverythingElse in interface IDrawAfterRenderpublic boolean mouseClicked(double mouseX,
double mouseY,
int button)
mouseClicked in interface net.minecraft.client.gui.IGuiEventListenermouseClicked in class WidgetTextFieldpublic boolean keyPressed(int keyCode,
int scanCode,
int modifiers)
keyPressed in interface net.minecraft.client.gui.IGuiEventListenerkeyPressed in class net.minecraft.client.gui.widget.TextFieldWidgetpublic boolean charTyped(char key,
int keyCode)
charTyped in interface net.minecraft.client.gui.IGuiEventListenercharTyped in class net.minecraft.client.gui.widget.TextFieldWidgetpublic void setEditable(boolean enabled)
setEditable in class net.minecraft.client.gui.widget.TextFieldWidgetpublic WidgetComboBox setFixedOptions()
public int getSelectedElementIndex()
public void selectElement(int index)
public final <T extends java.lang.Enum<T>> WidgetComboBox initFromEnum(T initialValue, java.util.function.Function<T,java.lang.String> xlate)
T - enum typeinitialValue - the initial value to displayxlate - a function which gets the string representation of a given value of the enumpublic final <T extends java.lang.Enum<T> & ITranslatableEnum> WidgetComboBox initFromEnum(T initialValue)