FInventoryGridCellUpdate
Overview
This struct is used to encapsulate data related to updates in a grid cell, such as whether it contains an item and its stack number. It is typically passed between components for state management.
Properties
Type | Name | Access | Description |
|---|---|---|---|
bool | bHasItem | BlueprintReadOnly | Indicates if the cell has an item. |
int32 | StackNumber | BlueprintReadOnly | The stack number of items in the cell. |
FInventoryGridCellData
Overview
This struct is used to store detailed information about a grid cell, such as whether it contains an item, the stack number, and the icon representing the item. It is passed between components for rendering and interaction purposes.
Properties
Type | Name | Access | Description |
|---|---|---|---|
bool | bHasItem | BlueprintReadOnly | Indicates if the cell has an item. |
int32 | StackNumber | BlueprintReadOnly | The stack number of items in the cell. |
FSlateBrush | Icon | BlueprintReadOnly | The icon representing the item in the cell. |
TObjectPtr< ALimenItemBase > | Item | BlueprintReadOnly | A pointer to the item contained in the cell. |
TObjectPtr< ULimenGridInventoryComponent > | Inventory | BlueprintReadOnly | A pointer to the inventory component that contains this cell. |
ULimenGridCellWidget
Overview
This class extends ULimenWidget and is responsible for rendering and handling interactions with a single grid cell in an inventory system. It can display an item, highlight its state (valid or invalid placement), and handle drag-and-drop operations.
Properties
Type | Name | Access | Description |
|---|---|---|---|
FInventoryGridCellData | CellData | BlueprintReadOnly | The data representing the current state of the grid cell. |
EGridCellHighlightCase | CurrentHighlightCase | BlueprintReadOnly | The current highlight case for the grid cell (none, invalid placement, valid placement). |
Functions
Return Type | Signature | Description |
|---|---|---|
void | SetPlacementHighlightCase(EGridCellHighlightCase NewCase) | Sets the highlight case of the grid cell and triggers a native event. |
void | SetCellData(const FInventoryGridCellData& InData) | Updates the data representing the grid cell and triggers a native event. |
FGridEntryDragDropOperation
Overview
This class extends FDragDropOperation and is used to handle the drag-and-drop of items within a grid cell. It provides methods to get the current cursor position, the default decorator widget, and other properties related to the drag-and-drop operation.
Functions
Return Type | Signature | Description |
|---|---|---|
void | OnDragged(const FDragDropEvent& DragDropEvent) | Updates the cursor position during a drag-and-drop operation. |
TSharedPtr | GetDefaultDecorator() const | Returns the default decorator widget for the drag-and-drop operation. |
FVector2D | GetDecoratorPosition() const | Calculates the position of the decorator widget based on the current cursor position and grid cell size. |
SLimenGridInventoryEntry
Overview
This class extends SCompoundWidget and is used to create a user interface element that represents an inventory entry, including a grid cell and associated item data. It handles mouse events for drag-and-drop operations and updates the display accordingly.
Functions
Return Type | Signature | Description |
|---|---|---|
FReply | OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) | Handles mouse button down events to initiate a drag-and-drop operation. |
FReply | OnDragDetected(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) | Handles drag detection events and starts the drag-and-drop operation if an item is present in the grid cell. |
Usage & Implementation Notes
Threading Constraints: This widget operates on the game thread.
Replication Requirements: None.
Memory Lifetime Management: The widget manages memory for its child widgets, ensuring proper cleanup when no longer needed.
Initialization Dependencies: Requires a valid
ULimenGridInventoryComponentand an associated grid cell definition.