ULimenItemSelectionWidget
Overview
ULimenItemSelectionWidget is a subclass of ULimenGameMenuWidget designed to handle the selection of items from a predefined set. It provides functionality to set available item options and notify when an item is selected. The widget uses a multicast delegate to broadcast the selection event, making it easy for other parts of the application to react to item selections.
Properties
Type | Name | Access | Description |
|---|---|---|---|
| OnItemSelected | BlueprintAssignable | A delegate that is called when an item is selected. |
| Options | Private, BlueprintReadOnly | The list of available item classes. |
Functions
Return Type | Signature | Description |
|---|---|---|
| SetAvailableItemOptions(const TArray<TSubclassOf< ALimenItemBase >>& InOptions) | Sets the available item options and triggers the |
| NotifyItemSelected(ALimenItemBase* Item) | Notifies that an item has been selected and broadcasts it via the |
Usage & Implementation Notes
Threading Constraints: This widget is designed to be used in the Unreal Engine's main thread, as it interacts with UI elements.
Replication Requirements: No replication is required for this widget since it does not contain any data that needs to be synchronized across networked clients.
Memory Lifetime Management: The
Optionsarray is managed by the widget and should be set during initialization or through theSetAvailableItemOptionsfunction. Ensure that the lifetime of the item classes in the array is managed correctly to avoid dangling pointers.Initialization Dependencies: This widget assumes that it will receive a valid list of item options through the
SetAvailableItemOptionsfunction before any selection events are triggered.
Properties
Type | Name | Access | Description |
|---|---|---|---|
| OnItemSelected | BlueprintAssignable | A delegate that is called when an item is selected. |
| Options | Private, BlueprintReadOnly | The list of available item classes. |
Functions
Return Type | Signature | Description |
|---|---|---|
| SetAvailableItemOptions(const TArray<TSubclassOf< ALimenItemBase >>& InOptions) | Sets the available item options and triggers the |
| NotifyItemSelected(ALimenItemBase* Item) | Notifies that an item has been selected and broadcasts it via the |
Usage & Implementation Notes
Threading Constraints: This widget is designed to be used in the Unreal Engine's main thread, as it interacts with UI elements.
Replication Requirements: No replication is required for this widget since it does not contain any data that needs to be synchronized across networked clients.
Memory Lifetime Management: The
Optionsarray is managed by the widget and should be set during initialization or through theSetAvailableItemOptionsfunction. Ensure that the lifetime of the item classes in the array is managed correctly to avoid dangling pointers.Initialization Dependencies: This widget assumes that it will receive a valid list of item options through the
SetAvailableItemOptionsfunction before any selection events are triggered.