Class ListWidget
java.lang.Object
net.minecraft.src.Gui
emi.shims.java.net.minecraft.client.gui.AbstractParentElement
emi.dev.emi.emi.screen.widget.config.ListWidget
- All Implemented Interfaces:
Drawable,Element,ParentElement
Shamelessly modified vanilla lists to support variable width. This is the lesser of two evils, at
least this way I have vanilla compat.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprotected static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected final Minecraftprotected intprotected intintprotected intprotected intprotected intFields inherited from class net.minecraft.src.Gui
icons, optionsBackground, statIcons, zLevel -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintaddEntry(ListWidget.Entry entry) voidcenterScrollOn(ListWidget.Entry entry) final List<ListWidget.Entry>children()Gets a list of all child GUI elements.protected final voidprotected voidprotected voidensureVisible(ListWidget.Entry entry) protected ListWidget.EntrygetEntry(int index) protected final @Nullable ListWidget.EntrygetEntryAtPosition(double x, double y) protected int@Nullable ListWidget.Entryintprotected intintintintprotected intgetRowTop(int index) intdoubleprotected int@Nullable ListWidget.EntryintgetType()booleanbooleanisMouseOver(double mouseX, double mouseY) protected booleanisSelectedEntry(int index) booleankeyPressed(int keyCode, int scanCode, int modifiers) booleanmouseClicked(double mouseX, double mouseY, int button) booleanmouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) booleanmouseReleased(double mouseX, double mouseY, int button) booleanmouseScrolled(double mouseX, double mouseY, double amount) protected voidmoveSelection(ListWidget.MoveDirection direction) protected voidmoveSelectionIf(ListWidget.MoveDirection direction, Predicate<ListWidget.Entry> predicate) Moves the selection in the specified direction until the predicate returns true.voidrender(DrawContext draw, int mouseX, int mouseY, float delta) protected voidrenderList(DrawContext draw, int x, int y, int mouseX, int mouseY, float delta) protected voidreplaceEntries(Collection<ListWidget.Entry> newEntries) voidsetFocused(boolean focused) voidsetLeftPos(int left) voidsetRenderSelection(boolean renderSelection) voidsetScrollAmount(double amount) voidsetSelected(@Nullable ListWidget.Entry entry) voidprotected voidupdateScrollingState(double mouseX, double mouseY, int button) voidupdateSize(int width, int height, int top, int bottom) Methods inherited from class emi.shims.java.net.minecraft.client.gui.AbstractParentElement
getFocused, isDragging, setDragging, setFocusedMethods inherited from class net.minecraft.src.Gui
drawCenteredString, drawGradientRect, drawHorizontalLine, drawRect, drawString, drawTexturedModalRect, drawTexturedModelRectFromIcon, drawVerticalLineMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface emi.shims.java.net.minecraft.client.gui.Element
mouseMovedMethods inherited from interface emi.shims.java.net.minecraft.client.gui.ParentElement
charTyped, focusOn, hoveredElement, keyReleased
-
Field Details
-
client
-
width
protected int width -
height
protected int height -
top
protected int top -
bottom
protected int bottom -
right
protected int right -
left
protected int left -
padding
public int padding
-
-
Constructor Details
-
ListWidget
-
-
Method Details
-
setRenderSelection
public void setRenderSelection(boolean renderSelection) -
getRowWidth
public int getRowWidth() -
getLogicalHeight
public int getLogicalHeight() -
getSelectedOrNull
-
setSelected
-
children
Description copied from interface:ParentElementGets a list of all child GUI elements.- Specified by:
childrenin interfaceParentElement
-
clearEntries
protected final void clearEntries() -
replaceEntries
-
getEntry
-
addEntry
-
getEntryCount
protected int getEntryCount() -
isSelectedEntry
protected boolean isSelectedEntry(int index) -
getEntryAtPosition
-
updateSize
public void updateSize(int width, int height, int top, int bottom) -
setLeftPos
public void setLeftPos(int left) -
getMaxPosition
protected int getMaxPosition() -
render
-
centerScrollOn
-
ensureVisible
-
getScrollAmount
public double getScrollAmount() -
setScrollAmount
public void setScrollAmount(double amount) -
getMaxScroll
public int getMaxScroll() -
updateScrollingState
protected void updateScrollingState(double mouseX, double mouseY, int button) -
getScrollbarPositionX
protected int getScrollbarPositionX() -
unfocusTextField
public void unfocusTextField() -
getFocusedTextField
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) - Specified by:
mouseClickedin interfaceElement- Specified by:
mouseClickedin interfaceParentElement
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int button) - Specified by:
mouseReleasedin interfaceElement- Specified by:
mouseReleasedin interfaceParentElement
-
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) - Specified by:
mouseDraggedin interfaceElement- Specified by:
mouseDraggedin interfaceParentElement
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double amount) - Specified by:
mouseScrolledin interfaceElement- Specified by:
mouseScrolledin interfaceParentElement
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) - Specified by:
keyPressedin interfaceElement- Specified by:
keyPressedin interfaceParentElement
-
moveSelection
-
ensureSelectedEntryVisible
protected void ensureSelectedEntryVisible() -
moveSelectionIf
protected void moveSelectionIf(ListWidget.MoveDirection direction, Predicate<ListWidget.Entry> predicate) Moves the selection in the specified direction until the predicate returns true.- Parameters:
direction- the direction to move the selection
-
isMouseOver
public boolean isMouseOver(double mouseX, double mouseY) - Specified by:
isMouseOverin interfaceElement
-
renderList
-
getRowLeft
public int getRowLeft() -
getRowRight
public int getRowRight() -
getRowTop
protected int getRowTop(int index) -
isFocused
public boolean isFocused()- Specified by:
isFocusedin interfaceElement- Specified by:
isFocusedin interfaceParentElement
-
getType
-
getHoveredEntry
-
getTotalHeight
public int getTotalHeight() -
setFocused
public void setFocused(boolean focused) - Specified by:
setFocusedin interfaceElement- Specified by:
setFocusedin interfaceParentElement
-