public class UISlot extends UIComponent<UISlot>
ITransformable.Alpha, ITransformable.Brightness, ITransformable.Color, ITransformable.Position<T>, ITransformable.Rotate, ITransformable.Scale, ITransformable.Size<T>, ITransformable.Translate
Modifier and Type | Field and Description |
---|---|
static boolean |
buttonRelased
Whether the mouse button has been released at least once.
|
protected UITooltip |
defaultTooltip |
protected GuiIcon |
icon
Icon to use for the background of this
UISlot |
protected GuiIcon |
iconLeft
Icon for Mojang fix
|
protected GuiIcon |
iconTop
Icon for Mojang fix
|
protected MalisisSlot |
slot
Slot to draw containing the itemStack
|
Constructor and Description |
---|
UISlot(MalisisGui gui)
Instantiates a new
UISlot . |
UISlot(MalisisGui gui,
MalisisSlot slot)
Instantiates a new
UISlot . |
Modifier and Type | Method and Description |
---|---|
void |
drawBackground(GuiRenderer renderer,
int mouseX,
int mouseY,
float partialTick)
Called first when drawing this
UIComponent . |
void |
drawForeground(GuiRenderer renderer,
int mouseX,
int mouseY,
float partialTick)
Called last when drawing this
UIComponent . |
boolean |
onButtonPress(int x,
int y,
MouseButton button) |
boolean |
onButtonRelease(int x,
int y,
MouseButton button) |
boolean |
onClick(int x,
int y) |
boolean |
onDoubleClick(int x,
int y,
MouseButton button) |
boolean |
onDrag(int lastX,
int lastY,
int x,
int y,
MouseButton button) |
void |
onHovered(StateChangeEvent.HoveredStateChange<UISlot> event) |
boolean |
onKeyTyped(char keyChar,
int keyCode)
Called when a key is typed while this
UIComponent is focused or hovered. |
boolean |
onRightClick(int x,
int y) |
void |
onSlotChanged(InventoryEvent.SlotChanged event) |
UISlot |
setTooltip(UITooltip tooltip)
Sets the
UITooltip of this UIComponent . |
protected void |
updateTooltip()
|
addControlComponent, componentX, componentY, draw, fireEvent, getAlpha, getAnchor, getComponentAt, getGui, getHeight, getName, getParent, getPropertyString, getRawHeight, getRawWidth, getTooltip, getWidth, getX, getY, getZIndex, isDisabled, isFocused, isHovered, isInsideBounds, isRelativeHeight, isRelativeWidth, isVisible, onAddedToScreen, onMouseMove, onScrollWheel, parentX, parentY, register, relativeX, relativeY, removeAllControlComponents, removeControlComponent, screenX, screenY, setAlpha, setAnchor, setDisabled, setFocused, setHovered, setName, setParent, setPosition, setPosition, setSize, setTooltip, setVisible, setZIndex, toString, unregister
protected GuiIcon iconLeft
protected GuiIcon iconTop
public static boolean buttonRelased
protected MalisisSlot slot
protected UITooltip defaultTooltip
public UISlot(MalisisGui gui, MalisisSlot slot)
UISlot
.gui
- the guislot
- the slotpublic UISlot(MalisisGui gui)
UISlot
.gui
- the guipublic UISlot setTooltip(UITooltip tooltip)
UIComponent
UITooltip
of this UIComponent
.setTooltip
in class UIComponent<UISlot>
tooltip
- the tooltipUIComponent
protected void updateTooltip()
public void drawBackground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick)
UIComponent
UIComponent
.drawBackground
in class UIComponent<UISlot>
renderer
- the renderermouseX
- the mouse xmouseY
- the mouse ypartialTick
- the partial tickpublic void drawForeground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick)
UIComponent
UIComponent
.drawForeground
in class UIComponent<UISlot>
renderer
- the renderermouseX
- the mouse xmouseY
- the mouse ypartialTick
- the partial tickpublic boolean onClick(int x, int y)
onClick
in class UIComponent<UISlot>
public boolean onRightClick(int x, int y)
onRightClick
in class UIComponent<UISlot>
public boolean onButtonPress(int x, int y, MouseButton button)
onButtonPress
in class UIComponent<UISlot>
public boolean onButtonRelease(int x, int y, MouseButton button)
onButtonRelease
in class UIComponent<UISlot>
public boolean onDrag(int lastX, int lastY, int x, int y, MouseButton button)
onDrag
in class UIComponent<UISlot>
public boolean onDoubleClick(int x, int y, MouseButton button)
onDoubleClick
in class UIComponent<UISlot>
public boolean onKeyTyped(char keyChar, int keyCode)
UIComponent
UIComponent
is focused or hovered.onKeyTyped
in class UIComponent<UISlot>
keyChar
- the key charkeyCode
- the key codepublic void onSlotChanged(InventoryEvent.SlotChanged event)
public void onHovered(StateChangeEvent.HoveredStateChange<UISlot> event)