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 floatamountScrolledprotected intbottomprotected booleanfield_148163_iprotected booleanfield_178041_qprotected booleanhasListHeaderprotected intheaderPaddingprotected intheightprotected intinitialClickY+ Where the mouse was in the window when you first clicked to scrollprotected longlastClickedprotected intleftprotected Minecraftmcprotected intmouseXprotected intmouseYprotected intrightprotected floatscrollMultiplierprotected intselectedElement+ The element in the list that was selectedprotected booleanshowSelectionBox+ Set to true if a selected element in this gui will show an outline boxprotected intslotHeightprotected inttopprotected intwidth
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(GuiButton button)protected voidbindAmountScrolled()+ Stop the thing from scrolling out of boundsprotected abstract voiddrawBackground()protected voiddrawListHeader(int parInt1, int parInt2, Tessellator parTessellator)+ Handles drawing a list's header row.voiddrawScreen(int mouseXIn, int mouseYIn, float parFloat1)protected voiddrawSelectionBox(int mouseXIn, int mouseYIn, int parInt3, int parInt4)+ Draws the selection box around the selected slot element.protected abstract voiddrawSlot(int var1, int var2, int var3, int var4, int var5, int var6)protected abstract voidelementClicked(int var1, boolean var2, int var3, int var4)protected voidfunc_148132_a(int parInt1, int parInt2)intfunc_148135_f()protected voidfunc_148142_b(int parInt1, int parInt2)protected voidfunc_178040_a(int var1, int var2, int var3)intgetAmountScrolled()+ Returns the amountScrolled field as an integer.protected intgetContentHeight()+ Return the height of the content being scrolledbooleangetEnabled()intgetListWidth()+ Gets the width of the listprotected intgetScrollBarX()protected abstract intgetSize()intgetSlotHeight()intgetSlotIndexFromScreenCoords(int parInt1, int parInt2)voidhandleMouseInput()booleanisMouseYWithinSlotBounds(int parInt1)protected abstract booleanisSelected(int var1)protected voidoverlayBackground(int startY, int endY, int startAlpha, int endAlpha)+ Overlays the background to hide scrolled itemsvoidregisterScrollButtons(int scrollUpButtonIDIn, int scrollDownButtonIDIn)+ Registers the IDs that can be used for the scrollbar's up/down buttons.voidscrollBy(int amount)+ Scrolls the slot by the given amount.voidsetDimensions(int widthIn, int heightIn, int topIn, int bottomIn)voidsetEnabled(boolean enabledIn)protected voidsetHasListHeader(boolean hasListHeaderIn, int headerPaddingIn)+ Sets hasListHeader and headerHeight.voidsetShowSelectionBox(boolean showSelectionBoxIn)voidsetSlotXBoundsFromLeft(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()
-
-