Item Stack Element
🗃️ ItemStackElement Class
Visual element representing an ItemStack
, with drag-and-drop and context-menu support.
Namespace:
Esper.Inventool.UI
Access:public
Type:class
Inherits:DraggableElement
📦 Fields
public
itemStack
ItemStack
The underlying item stack this element represents.
public
iconElement
VisualElement
Displays the item’s inventory sprite.
public
amountLabel
Label
Shows the stack count if the item is stackable.
public
equippedIndicatorElement
VisualElement
Visual marker when the item is currently equipped.
protected
dragElement
VisualElement
Floating proxy used during drag operations.
protected
dragIconElement
VisualElement
Icon inside the drag proxy showing the item sprite.
🧰 Methods
public
ItemStackElement(itemStack)
—
Constructor wiring drag callbacks, building icon, labels, and equippable marker.
protected virtual
OnPointerEnter(PointerEnterEvent e)
void
Bring to front, fire hover event, open hover-details popup.
protected virtual
OnPointerLeave(PointerLeaveEvent e)
void
Close the hover-details popup.
protected virtual
OnClick()
void
Fire click event and open the context action menu.
protected
OpenActionMenu()
void
Collect and display menu options from the ItemStack
.
public
Refresh()
void
Update background, icon, amount, and equipped indicator.
public
SetEquippedIndicatorVisibility(visible)
void
Manually toggle the equipped-indicator based on external state.
protected
DragStartedHandler()
void
Initialize and add the drag proxy to the global drag area.
protected
DragHandlerImmediate(GeometryChangedEvent e)
void
Immediately position drag proxy once it’s added to visual tree.
protected virtual
DragHandler()
void
Follow pointer movements with the drag proxy.
protected virtual
DropHandler()
void
Remove the drag proxy and close hover details if still targeting this element.
Last updated