Package net.minecraft.client.gui
Class GuiSlot
- java.lang.Object
-
- net.minecraft.client.gui.GuiSlot
-
- Direct Known Subclasses:
GuiListExtended
public abstract class GuiSlot extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected float
amountScrolled
protected int
bottom
protected boolean
field_148163_i
protected boolean
field_178041_q
protected boolean
hasListHeader
protected int
headerPadding
protected int
height
protected int
initialClickY
+ Where the mouse was in the window when you first clicked to scrollprotected long
lastClicked
protected int
left
protected Minecraft
mc
protected int
mouseX
protected int
mouseY
protected int
right
protected float
scrollMultiplier
protected int
selectedElement
+ The element in the list that was selectedprotected boolean
showSelectionBox
+ Set to true if a selected element in this gui will show an outline boxprotected int
slotHeight
protected int
top
protected int
width
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(GuiButton button)
protected void
bindAmountScrolled()
+ Stop the thing from scrolling out of boundsprotected abstract void
drawBackground()
protected void
drawListHeader(int parInt1, int parInt2, Tessellator parTessellator)
+ Handles drawing a list's header row.void
drawScreen(int mouseXIn, int mouseYIn, float parFloat1)
protected void
drawSelectionBox(int mouseXIn, int mouseYIn, int parInt3, int parInt4)
+ Draws the selection box around the selected slot element.protected abstract void
drawSlot(int var1, int var2, int var3, int var4, int var5, int var6)
protected abstract void
elementClicked(int var1, boolean var2, int var3, int var4)
protected void
func_148132_a(int parInt1, int parInt2)
int
func_148135_f()
protected void
func_148142_b(int parInt1, int parInt2)
protected void
func_178040_a(int var1, int var2, int var3)
int
getAmountScrolled()
+ Returns the amountScrolled field as an integer.protected int
getContentHeight()
+ Return the height of the content being scrolledboolean
getEnabled()
int
getListWidth()
+ Gets the width of the listprotected int
getScrollBarX()
protected abstract int
getSize()
int
getSlotHeight()
int
getSlotIndexFromScreenCoords(int parInt1, int parInt2)
void
handleMouseInput()
boolean
isMouseYWithinSlotBounds(int parInt1)
protected abstract boolean
isSelected(int var1)
protected void
overlayBackground(int startY, int endY, int startAlpha, int endAlpha)
+ Overlays the background to hide scrolled itemsvoid
registerScrollButtons(int scrollUpButtonIDIn, int scrollDownButtonIDIn)
+ Registers the IDs that can be used for the scrollbar's up/down buttons.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.
-
-
-
Field Detail
-
mc
protected final Minecraft mc
-
width
protected int width
-
height
protected int height
-
top
protected int top
-
bottom
protected int bottom
-
right
protected int right
-
left
protected int left
-
slotHeight
protected final int slotHeight
-
mouseX
protected int mouseX
-
mouseY
protected int mouseY
-
field_148163_i
protected boolean field_148163_i
-
initialClickY
protected int initialClickY
+ Where the mouse was in the window when you first clicked to scroll
-
scrollMultiplier
protected float scrollMultiplier
-
amountScrolled
protected float amountScrolled
-
selectedElement
protected int selectedElement
+ The element in the list that was selected
-
lastClicked
protected long lastClicked
-
field_178041_q
protected boolean field_178041_q
-
showSelectionBox
protected boolean showSelectionBox
+ Set to true if a selected element in this gui will show an outline box
-
hasListHeader
protected boolean hasListHeader
-
headerPadding
protected int headerPadding
-
-
Constructor Detail
-
GuiSlot
public GuiSlot(Minecraft mcIn, int width, int height, int topIn, int bottomIn, int slotHeightIn)
-
-
Method Detail
-
setDimensions
public void setDimensions(int widthIn, int heightIn, int topIn, int bottomIn)
-
setShowSelectionBox
public void setShowSelectionBox(boolean showSelectionBoxIn)
-
setHasListHeader
protected void setHasListHeader(boolean hasListHeaderIn, int headerPaddingIn)
+ Sets hasListHeader and headerHeight. Params: hasListHeader, headerHeight. If hasListHeader is false headerHeight is set to 0.
-
getSize
protected abstract int getSize()
-
elementClicked
protected abstract void elementClicked(int var1, boolean var2, int var3, int var4)
-
isSelected
protected abstract boolean isSelected(int var1)
-
getContentHeight
protected int getContentHeight()
+ Return the height of the content being scrolled
-
drawBackground
protected abstract void drawBackground()
-
func_178040_a
protected void func_178040_a(int var1, int var2, int var3)
-
drawSlot
protected abstract void drawSlot(int var1, int var2, int var3, int var4, int var5, int var6)
-
drawListHeader
protected void drawListHeader(int parInt1, int parInt2, Tessellator parTessellator)
+ Handles drawing a list's header row.
-
func_148132_a
protected void func_148132_a(int parInt1, int parInt2)
-
func_148142_b
protected void func_148142_b(int parInt1, int parInt2)
-
getSlotIndexFromScreenCoords
public int getSlotIndexFromScreenCoords(int parInt1, int parInt2)
-
registerScrollButtons
public void registerScrollButtons(int scrollUpButtonIDIn, int scrollDownButtonIDIn)
+ Registers the IDs that can be used for the scrollbar's up/down buttons.
-
bindAmountScrolled
protected void bindAmountScrolled()
+ Stop the thing from scrolling out of bounds
-
func_148135_f
public int func_148135_f()
-
getAmountScrolled
public int getAmountScrolled()
+ Returns the amountScrolled field as an integer.
-
isMouseYWithinSlotBounds
public boolean isMouseYWithinSlotBounds(int parInt1)
-
scrollBy
public void scrollBy(int amount)
+ Scrolls the slot by the given amount. A positive value scrolls down, and a negative value scrolls up.
-
actionPerformed
public void actionPerformed(GuiButton button)
-
drawScreen
public void drawScreen(int mouseXIn, int mouseYIn, float parFloat1)
-
handleMouseInput
public void handleMouseInput()
-
setEnabled
public void setEnabled(boolean enabledIn)
-
getEnabled
public boolean getEnabled()
-
getListWidth
public int getListWidth()
+ Gets the width of the list
-
drawSelectionBox
protected void drawSelectionBox(int mouseXIn, int mouseYIn, int parInt3, int parInt4)
+ Draws the selection box around the selected slot element.
-
getScrollBarX
protected int getScrollBarX()
-
overlayBackground
protected void overlayBackground(int startY, int endY, int startAlpha, int endAlpha)
+ Overlays the background to hide scrolled items
-
setSlotXBoundsFromLeft
public void setSlotXBoundsFromLeft(int leftIn)
+ Sets the left and right bounds of the slot. Param is the left bound, right is calculated as left + width.
-
getSlotHeight
public int getSlotHeight()
-
-