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:

  1. The CavrnusSpaceListWidget creates instances of USpaceListOption for each space in the list.

  2. Each USpaceListOption widget displays the thumbnail and name of a space.

  3. When a user clicks on a space entry, the ButtonSpaceSelected function is called, triggering the OnSelect event, which is likely handled by the CavrnusSpaceListWidget to perform actions like joining the selected space.

  4. The UPagination widget manages the display of spaces in pages, allowing users to navigate through the list.

Interaction with Other Components:

  • CavrnusSpaceListWidget: This widget uses USpaceListOption to populate the list of spaces. It manages the overall display and interaction with the list, including pagination and search functionality.

  • Pagination: The UPagination 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: The USpaceListOption 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:

  1. 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.

  1. SpaceListOption.h:

  • Purpose: This file defines the USpaceListOption class, which is a concrete implementation of USpaceListEntry. 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 the OnSelect event when the space's button is clicked.