public abstract class GuiSlotNew extends GuiEventHandlerNew
Modifier and Type | Field and Description |
---|---|
protected double |
amountScrolled
How far down this slot has been scrolled
|
int |
bottom
The bottom of the slot container.
|
protected boolean |
centerListVertically |
protected boolean |
hasListHeader |
int |
headerPadding |
int |
height |
protected int |
initialClickY
Where the mouse was in the window when you first clicked to scroll
|
protected long |
lastClicked
The time when this button was last clicked.
|
int |
left |
protected net.minecraft.client.Minecraft |
mc |
int |
right |
protected int |
selectedElement
The element in the list that was selected
|
protected boolean |
showSelectionBox
Set to true if a selected element in this gui will show an outline box
|
int |
slotHeight
The height of a slot.
|
int |
top
The top of the slot container.
|
protected boolean |
visible |
int |
width |
Constructor and Description |
---|
GuiSlotNew(net.minecraft.client.Minecraft mcIn,
int width,
int height,
int topIn,
int bottomIn,
int slotHeightIn) |
Modifier and Type | Method and Description |
---|---|
protected void |
bindAmountScrolled()
Stop the thing from scrolling out of bounds
|
boolean |
charTyped(char p_charTyped_1_,
int p_charTyped_2_) |
protected void |
checkScrollbarClick(double mouseX,
double mouseY,
int button)
Checks if the mouse clicked on the scrollbar.
|
static double |
clamp(double num,
double min,
double max) |
static int |
clamp(int num,
int min,
int max) |
protected void |
clickedHeader(int p_148132_1_,
int p_148132_2_)
Called when the mouse left-clicks the header or anywhere else that isn't on an entry.
|
protected abstract void |
drawBackground() |
protected void |
drawContainerBackground(net.minecraft.client.renderer.Tessellator tessellator) |
protected void |
drawListHeader(int insideLeft,
int insideTop,
net.minecraft.client.renderer.Tessellator tessellatorIn)
Handles drawing a list's header row.
|
void |
drawScreen(int mouseXIn,
int mouseYIn,
float partialTicks) |
protected void |
drawSelectionBox(int insideLeft,
int insideTop,
int mouseXIn,
int mouseYIn,
float partialTicks)
Draws the selection box around the selected slot element.
|
protected abstract void |
drawSlot(int slotIndex,
int xPos,
int yPos,
int heightIn,
int mouseXIn,
int mouseYIn,
float partialTicks) |
static int |
floor(double value) |
int |
getAmountScrolled()
Returns the amountScrolled field as an integer.
|
protected java.util.List<? extends IGuiEventListener> |
getChildren()
Gets a mutable list of child listeners.
|
protected int |
getContentHeight()
Return the height of the content being scrolled
|
int |
getEntryAt(double x,
double y)
Gets the entry at the given position on screen.
|
int |
getListWidth()
Gets the width of the list
|
int |
getMaxScroll() |
protected int |
getScrollBarX() |
protected abstract int |
getSize() |
int |
getSlotHeight() |
boolean |
isMouseInList(double p_195079_1_,
double p_195079_3_) |
protected abstract boolean |
isSelected(int slotIndex)
Returns true if the element passed in is currently selected
|
boolean |
isVisible() |
boolean |
keyPressed(int p_keyPressed_1_,
int p_keyPressed_2_,
int p_keyPressed_3_) |
boolean |
mouseClicked(double p_mouseClicked_1_,
double p_mouseClicked_3_,
int p_mouseClicked_5_) |
protected boolean |
mouseClicked(int index,
int button,
double mouseX,
double mouseY)
Called when the mouse is clicked onto an entry.
|
boolean |
mouseDragged(double p_mouseDragged_1_,
double p_mouseDragged_3_,
int p_mouseDragged_5_,
double p_mouseDragged_6_,
double p_mouseDragged_8_) |
boolean |
mouseReleased(double p_mouseReleased_1_,
double p_mouseReleased_3_,
int p_mouseReleased_5_) |
boolean |
mouseScrolled(double p_mouseScrolled_1_) |
protected void |
overlayBackground(int startY,
int endY,
int startAlpha,
int endAlpha)
Overlays the background to hide scrolled items
|
protected void |
renderDecorations(int mouseXIn,
int mouseYIn) |
void |
scrollBy(int amount)
Scrolls the slot by the given amount.
|
void |
setDimensions(int widthIn,
int heightIn,
int topIn,
int bottomIn) |
protected void |
setHasListHeader(boolean hasListHeaderIn,
int headerPaddingIn)
Sets hasListHeader and headerHeight.
|
void |
setSelectedEntry(int index)
Called when the given entry is selected; sets
selectedElement to the index and updates lastClicked . |
void |
setShowSelectionBox(boolean showSelectionBoxIn) |
void |
setSlotXBoundsFromLeft(int leftIn)
Sets the left and right bounds of the slot.
|
protected void |
updateItemPos(int entryID,
int insideLeft,
int yPos,
float partialTicks) |
focusNext, focusOn, getFocused, setDragging, setFocused
drawCenteredString, drawGradientRect, drawHorizontalLine, drawModalRectWithCustomSizedTexture, drawRect, drawScaledCustomSizeModalRect, drawString, drawTexturedModalRect, drawTexturedModalRect, drawTexturedModalRect, drawVerticalLine
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
keyReleased
canFocus, focusChanged
protected final net.minecraft.client.Minecraft mc
public int width
public int height
public int top
public int bottom
public int right
public int left
public final int slotHeight
protected boolean centerListVertically
protected int initialClickY
protected double amountScrolled
protected int selectedElement
protected long lastClicked
protected boolean visible
protected boolean showSelectionBox
protected boolean hasListHeader
public int headerPadding
public GuiSlotNew(net.minecraft.client.Minecraft mcIn, int width, int height, int topIn, int bottomIn, int slotHeightIn)
public void setDimensions(int widthIn, int heightIn, int topIn, int bottomIn)
public void setShowSelectionBox(boolean showSelectionBoxIn)
protected void setHasListHeader(boolean hasListHeaderIn, int headerPaddingIn)
public boolean isVisible()
protected abstract int getSize()
public void setSelectedEntry(int index)
selectedElement
to the index and updates lastClicked
.protected java.util.List<? extends IGuiEventListener> getChildren()
GuiListExtended
, this is a list of the entries of the list (in
the order they are displayed); for a GuiScreen
this is the sub-controls.getChildren
in class GuiEventHandlerNew
protected boolean mouseClicked(int index, int button, double mouseX, double mouseY)
protected abstract boolean isSelected(int slotIndex)
protected int getContentHeight()
protected abstract void drawBackground()
protected void updateItemPos(int entryID, int insideLeft, int yPos, float partialTicks)
protected abstract void drawSlot(int slotIndex, int xPos, int yPos, int heightIn, int mouseXIn, int mouseYIn, float partialTicks)
protected void drawListHeader(int insideLeft, int insideTop, net.minecraft.client.renderer.Tessellator tessellatorIn)
protected void clickedHeader(int p_148132_1_, int p_148132_2_)
protected void renderDecorations(int mouseXIn, int mouseYIn)
public int getEntryAt(double x, double y)
public static int floor(double value)
protected void bindAmountScrolled()
public static double clamp(double num, double min, double max)
public int getMaxScroll()
public int getAmountScrolled()
public boolean isMouseInList(double p_195079_1_, double p_195079_3_)
public void scrollBy(int amount)
public void drawScreen(int mouseXIn, int mouseYIn, float partialTicks)
protected void checkScrollbarClick(double mouseX, double mouseY, int button)
public boolean mouseClicked(double p_mouseClicked_1_, double p_mouseClicked_3_, int p_mouseClicked_5_)
mouseClicked
in interface IGuiEventListener
mouseClicked
in interface IGuiEventListenerDeferred
mouseClicked
in class GuiEventHandlerNew
public boolean mouseReleased(double p_mouseReleased_1_, double p_mouseReleased_3_, int p_mouseReleased_5_)
mouseReleased
in interface IGuiEventListener
mouseReleased
in interface IGuiEventListenerDeferred
mouseReleased
in class GuiEventHandlerNew
public boolean mouseDragged(double p_mouseDragged_1_, double p_mouseDragged_3_, int p_mouseDragged_5_, double p_mouseDragged_6_, double p_mouseDragged_8_)
mouseDragged
in interface IGuiEventListener
mouseDragged
in interface IGuiEventListenerDeferred
mouseDragged
in class GuiEventHandlerNew
public static int clamp(int num, int min, int max)
public boolean mouseScrolled(double p_mouseScrolled_1_)
public boolean keyPressed(int p_keyPressed_1_, int p_keyPressed_2_, int p_keyPressed_3_)
keyPressed
in interface IGuiEventListener
keyPressed
in interface IGuiEventListenerDeferred
keyPressed
in class GuiEventHandlerNew
public boolean charTyped(char p_charTyped_1_, int p_charTyped_2_)
public int getListWidth()
protected void drawSelectionBox(int insideLeft, int insideTop, int mouseXIn, int mouseYIn, float partialTicks)
protected int getScrollBarX()
protected void overlayBackground(int startY, int endY, int startAlpha, int endAlpha)
public void setSlotXBoundsFromLeft(int leftIn)
public int getSlotHeight()
protected void drawContainerBackground(net.minecraft.client.renderer.Tessellator tessellator)