- Declaration
static FCavrnusBinding BindJoinableSpaces(FCavrnusSpaceInfoEvent SpaceAdded, FCavrnusSpaceInfoEvent SpaceUpdated, FCavrnusSpaceInfoEvent SpaceRemoved);
...
DECLARE_DYNAMIC_DELEGATE_OneParam(FCavrnusSpaceInfoEvent, FCavrnusSpaceInfo, SpaceInfo);
- Description
Triggers when spaces become available to you that you can join, or when their metadata changes.
When called, you will immediately get SpaceAdded
events for all spaces currently in your list.
- Blueprint Sample
- Code Sample
SpaceListWidget.h:
Code Block |
---|
#pragma once #include "CoreMinimal.h" #include "Types/CavrnusCallbackTypes.h" #include "Blueprint/UserWidget.h" #incldue "SpaceWidget.h" #include "SpaceListWidget.generated.h" UCLASS() class MODULE_API USpaceListWidget: public UUserWidget { GENERATED_BODY() public: void NativeConstruct(); private: void OnSpaceAdded(FCavrnusSpaceInfo& SpaceInfo); void OnSpaceUpdated(FCavrnusSpaceInfo& SpaceInfo); void OnSpaceRemoved(FCavrnusSpaceInfo& SpaceInfo); FCavrnusBinding JoinableSpacesBinding; FCavrnusSpaceInfoEvent SpaceAdded; FCavrnusSpaceInfoEvent SpaceUpdated; FCavrnusSpaceInfoEvent SpaceRemoved; // USpaceWidget - theoretical list item or button that displays one joinable space TMap<FString, USpaceWidget*> SpaceWidgets; }; |
...