Equipment Slot Element
🛡️ EquipmentSlotElement Class
A draggable UI element representing an equipment slot with hover, click, and drag behavior.
Namespace:
Esper.Inventool.UI
Access:public
Type:class
Inherits:DraggableElement
Attributes:[UxmlElement]
📦 Fields
public
slot
EquipmentSlot
Underlying equipment slot data.
public
containerElement
VisualElement
Container for icon styling and cropping.
public
iconElement
VisualElement
Element displaying the equipped item’s icon.
protected
dragElement
VisualElement
Visual element shown during dragging.
protected
dragIconElement
VisualElement
Icon shown within the drag element.
🔍 Properties
public
IsVisible
bool
True if the slot is visible.
public
HasItem
bool
True if an item is equipped in this slot.
🧰 Methods
public
EquipmentSlotElement()
—
Constructor wiring drag and pointer callbacks and building UI.
protected virtual
OnPointerEnter(PointerEnterEvent e)
void
Show hover details for this slot.
protected virtual
OnPointerLeave(PointerLeaveEvent e)
void
Hide hover details.
protected virtual
OnClick()
void
Invoke click event and open action menu.
protected
DragStartedHandler()
void
Initialize drag visuals and register for movement.
protected
DragHandlerImmediate(GeometryChangedEvent e)
void
Immediately follow pointer when drag visuals appear.
protected
DragHandler()
void
Update drag element position to follow pointer.
protected
DropHandler()
void
Handle drop logic, equip/unequip or swap items accordingly.
protected
OpenActionMenu()
void
Open context menu for this slot’s available actions.
public
Refresh()
void
Update visuals based on current slot and item state.
public
SetData(EquipmentSlot slot)
void
Assign slot data and refresh visibility and visuals.
Last updated