public abstract class GuiSlot
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected float |
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 Minecraft |
mc |
protected int |
mouseX |
protected int |
mouseY |
int |
right |
protected float |
scrollMultiplier
What to multiply the amount you moved your mouse by (used for slowing down scrolling when over the items and not
on the scroll bar)
|
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 |
---|
GuiSlot(Minecraft mcIn,
int width,
int height,
int topIn,
int bottomIn,
int slotHeightIn) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(GuiButton button) |
protected void |
bindAmountScrolled()
Stop the thing from scrolling out of bounds
|
protected void |
clickedHeader(int p_148132_1_,
int p_148132_2_) |
protected abstract void |
drawBackground() |
protected void |
drawContainerBackground(Tessellator tessellator) |
protected void |
drawListHeader(int insideLeft,
int insideTop,
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)
Draws the selection box around the selected slot element.
|
protected abstract void |
drawSlot(int entryID,
int insideLeft,
int yPos,
int insideSlotHeight,
int mouseXIn,
int mouseYIn) |
protected abstract void |
elementClicked(int slotIndex,
boolean isDoubleClick,
int mouseX,
int mouseY)
The element in the slot that was clicked, boolean for whether it was double clicked or not
|
int |
getAmountScrolled()
Returns the amountScrolled field as an integer.
|
protected int |
getContentHeight()
Return the height of the content being scrolled
|
boolean |
getEnabled() |
int |
getListWidth()
Gets the width of the list
|
int |
getMaxScroll() |
protected int |
getScrollBarX() |
protected abstract int |
getSize() |
int |
getSlotHeight() |
int |
getSlotIndexFromScreenCoords(int posX,
int posY) |
void |
handleMouseInput() |
boolean |
isMouseYWithinSlotBounds(int p_148141_1_) |
protected abstract boolean |
isSelected(int slotIndex)
Returns true if the element passed in is currently selected
|
protected void |
overlayBackground(int startY,
int endY,
int startAlpha,
int endAlpha)
Overlays the background to hide scrolled items
|
void |
registerScrollButtons(int scrollUpButtonIDIn,
int scrollDownButtonIDIn)
Registers the IDs that can be used for the scrollbar's up/down buttons.
|
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) |
void |
setEnabled(boolean enabledIn) |
protected void |
setHasListHeader(boolean hasListHeaderIn,
int headerPaddingIn)
Sets hasListHeader and headerHeight.
|
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) |
protected final 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 int mouseX
protected int mouseY
protected boolean centerListVertically
protected int initialClickY
protected float scrollMultiplier
protected float amountScrolled
protected int selectedElement
protected long lastClicked
protected boolean visible
protected boolean showSelectionBox
protected boolean hasListHeader
public int headerPadding
public GuiSlot(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)
protected abstract int getSize()
protected abstract void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY)
protected abstract boolean isSelected(int slotIndex)
protected int getContentHeight()
protected abstract void drawBackground()
protected void updateItemPos(int entryID, int insideLeft, int yPos)
protected abstract void drawSlot(int entryID, int insideLeft, int yPos, int insideSlotHeight, int mouseXIn, int mouseYIn)
protected void drawListHeader(int insideLeft, int insideTop, Tessellator tessellatorIn)
protected void clickedHeader(int p_148132_1_, int p_148132_2_)
protected void renderDecorations(int mouseXIn, int mouseYIn)
public int getSlotIndexFromScreenCoords(int posX, int posY)
public void registerScrollButtons(int scrollUpButtonIDIn, int scrollDownButtonIDIn)
protected void bindAmountScrolled()
public int getMaxScroll()
public int getAmountScrolled()
public boolean isMouseYWithinSlotBounds(int p_148141_1_)
public void scrollBy(int amount)
public void actionPerformed(GuiButton button)
public void drawScreen(int mouseXIn, int mouseYIn, float partialTicks)
public void handleMouseInput()
public void setEnabled(boolean enabledIn)
public boolean getEnabled()
public int getListWidth()
protected void drawSelectionBox(int insideLeft, int insideTop, int mouseXIn, int mouseYIn)
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(Tessellator tessellator)