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 GuiIconProvider |
iconLeftProvider
IconProvider for Mojang fix
|
protected GuiIconProvider |
iconTopProvider
IconProvider 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)
On button press.
|
boolean |
onButtonRelease(int x,
int y,
MouseButton button)
On button release.
|
boolean |
onClick(int x,
int y)
On click.
|
boolean |
onDoubleClick(int x,
int y,
MouseButton button)
On double click.
|
boolean |
onDrag(int lastX,
int lastY,
int x,
int y,
MouseButton button)
On drag.
|
void |
onHovered(StateChangeEvent.HoveredStateChange<UISlot> event) |
boolean |
onKeyTyped(char keyChar,
int keyCode)
Called when a key is typed inside
MalisisGui. |
boolean |
onRightClick(int x,
int y)
On right click.
|
void |
onSlotChanged(InventoryEvent.SlotChanged event) |
UISlot |
setTooltip(UITooltip tooltip)
Sets the
UITooltip of this UIComponent. |
protected void |
updateTooltip()
|
addControlComponent, attachData, componentX, componentY, draw, fireEvent, getAlpha, getAnchor, getComponentAt, getData, getGui, getHeight, getIconProvider, getName, getParent, getPropertyString, getRawHeight, getRawWidth, getRenderer, getTooltip, getWidth, getX, getY, getZIndex, isDisabled, isFocused, isHovered, isInsideBounds, isRelativeHeight, isRelativeWidth, isVisible, onAddedToScreen, onMouseMove, onScrollWheel, parentX, parentY, register, relativeX, relativeY, removeAllControlComponents, removeControlComponent, screenX, screenY, self, setAlpha, setAnchor, setDisabled, setFocused, setHovered, setName, setParent, setPosition, setPosition, setSize, setTooltip, setVisible, setZIndex, toString, unregisterprotected GuiIconProvider iconLeftProvider
protected GuiIconProvider iconTopProvider
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)
UIComponentUITooltip of this UIComponent.setTooltip in class UIComponent<UISlot>tooltip - the tooltipUIComponentprotected void updateTooltip()
public void drawBackground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick)
UIComponentUIComponent.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)
UIComponentUIComponent.drawForeground in class UIComponent<UISlot>renderer - the renderermouseX - the mouse xmouseY - the mouse ypartialTick - the partial tickpublic boolean onClick(int x,
int y)
UIComponentonClick in class UIComponent<UISlot>x - the xy - the ypublic boolean onRightClick(int x,
int y)
UIComponentonRightClick in class UIComponent<UISlot>x - the xy - the ypublic boolean onButtonPress(int x,
int y,
MouseButton button)
UIComponentonButtonPress in class UIComponent<UISlot>x - the xy - the ybutton - the buttonpublic boolean onButtonRelease(int x,
int y,
MouseButton button)
UIComponentonButtonRelease in class UIComponent<UISlot>x - the xy - the ybutton - the buttonpublic boolean onDrag(int lastX,
int lastY,
int x,
int y,
MouseButton button)
UIComponentonDrag in class UIComponent<UISlot>lastX - the last xlastY - the last yx - the xy - the ybutton - the buttonpublic boolean onDoubleClick(int x,
int y,
MouseButton button)
UIComponentonDoubleClick in class UIComponent<UISlot>x - the xy - the ybutton - the buttonpublic boolean onKeyTyped(char keyChar,
int keyCode)
IKeyListenerMalisisGui.onKeyTyped in interface IKeyListeneronKeyTyped in class UIComponent<UISlot>keyChar - the key charkeyCode - the key codepublic void onSlotChanged(InventoryEvent.SlotChanged event)
public void onHovered(StateChangeEvent.HoveredStateChange<UISlot> event)