Cavrnus Unreal API - UI/SpaceList
The header files in the "SpaceList" folder define the UI elements and logic for displaying and interacting with a list of Cavrnus spaces.
Key Points:
The
CavrnusSpaceListWidget
creates instances ofUSpaceListOption
for each space in the list.Each
USpaceListOption
widget displays the thumbnail and name of a space.When a user clicks on a space entry, the
ButtonSpaceSelected
function is called, triggering theOnSelect
event, which is likely handled by theCavrnusSpaceListWidget
to perform actions like joining the selected space.The
UPagination
widget manages the display of spaces in pages, allowing users to navigate through the list.
Interaction with Other Components:
CavrnusSpaceListWidget
: This widget usesUSpaceListOption
to populate the list of spaces. It manages the overall display and interaction with the list, including pagination and search functionality.Pagination
: TheUPagination
class (from the "Pagination" folder) is used to handle the pagination of the space list, allowing users to navigate through multiple pages of spaces.IListElementInterface
: TheUSpaceListOption
class implements this interface, ensuring it can be used as an element in the paginated list.Texture2dDynamicHelper
: This class is used to get the dimensions of the downloaded thumbnail images.
Header List:
SpaceListEntry.h
:
Purpose: This file defines an abstract base class
USpaceListEntry
for creating UI elements representing individual spaces in a list. It serves as a foundation for more specific space entry widgets.
SpaceListOption.h
:
Purpose: This file defines the
USpaceListOption
class, which is a concrete implementation ofUSpaceListEntry
. It represents a single space entry in the UI, displaying the space's thumbnail image and name.Key Elements:
Setup
: Initializes the widget with space information and a callback for when the space is selected.OnGetThumbnail
: Handles the loading of the space's thumbnail image.ButtonSpaceSelected
: Triggers theOnSelect
event when the space's button is clicked.