Space Plunder
Loading...
Searching...
No Matches
UReplayMenu Class Reference

Player Recorded Replay clips menu widget. More...

#include <ReplayMenu.h>

Inheritance diagram for UReplayMenu:

Public Member Functions

 UReplayMenu (const FObjectInitializer &ObjectInitializer)
 
virtual void NativeConstruct () override
 
virtual bool Initialize () override
 
virtual void OnFindReplays (const TArray< FReplayInfo > &Replays)
 

Protected Member Functions

void OnBrowseReplaysClicked ()
 
void OnBackButtonClicked ()
 

Protected Attributes

UScrollBox * AllReplaysScrollBox = nullptr
 
UButton * BrowseReplaysButton = nullptr
 
UButton * BackButton = nullptr
 
TSubclassOf< UReplaySlotReplaySlotClass
 

Detailed Description

Player Recorded Replay clips menu widget.

This class is responsible for managing the replay menu UI, including displaying the list of available replays and handling user interactions.

Constructor & Destructor Documentation

◆ UReplayMenu()

UReplayMenu::UReplayMenu ( const FObjectInitializer & ObjectInitializer)
12 : UUserWidget(ObjectInitializer)
13{
14 const ConstructorHelpers::FClassFinder<UReplaySlot> ReplaySlotBP(TEXT("/MenuSystem/Widgets/Replays/WBP_ReplaySlot"));
15 if (!ensure(ReplaySlotBP.Class != nullptr)) return;
16 ReplaySlotClass = ReplaySlotBP.Class;
17
18 //Constructor helper, ReplaySlot BP widget
19}
TSubclassOf< UReplaySlot > ReplaySlotClass
Definition ReplayMenu.h:54

Member Function Documentation

◆ Initialize()

bool UReplayMenu::Initialize ( )
overridevirtual
23{
24 const bool bSuccess = Super::Initialize();
25 if (!ensure(AllReplaysScrollBox != nullptr)) return false;
26 if (!ensure(BrowseReplaysButton != nullptr)) return false;
27 if (!ensure(BackButton != nullptr)) return false;
28 if(!bSuccess) return false;
29
30
31 BrowseReplaysButton->OnClicked.AddUniqueDynamic(this, &UReplayMenu::OnBrowseReplaysClicked);
32 BackButton->OnClicked.AddUniqueDynamic(this, &UReplayMenu::OnBackButtonClicked);
33 return true;
34}
UScrollBox * AllReplaysScrollBox
Definition ReplayMenu.h:46
UButton * BrowseReplaysButton
Definition ReplayMenu.h:48
void OnBrowseReplaysClicked()
Definition ReplayMenu.cpp:42
void OnBackButtonClicked()
Definition ReplayMenu.cpp:51
UButton * BackButton
Definition ReplayMenu.h:50

◆ NativeConstruct()

void UReplayMenu::NativeConstruct ( )
overridevirtual
38{
39 Super::NativeConstruct();
40}

◆ OnBackButtonClicked()

void UReplayMenu::OnBackButtonClicked ( )
protected
52{
53 RemoveFromParent();
54}

◆ OnBrowseReplaysClicked()

void UReplayMenu::OnBrowseReplaysClicked ( )
protected
43{
44 IReplayClipInterface* ReplayClipInterface = Cast<IReplayClipInterface>(GetGameInstance());
45 if(ReplayClipInterface != nullptr)
46 {
47 ReplayClipInterface->FindReplays();
48 }
49}
Definition ReplayClipInterface.h:20
virtual void FindReplays()=0

◆ OnFindReplays()

void UReplayMenu::OnFindReplays ( const TArray< FReplayInfo > & Replays)
virtual
58{
59 if(AllReplaysScrollBox != nullptr && ReplaySlotClass != nullptr)
60 {
61 AllReplaysScrollBox->ClearChildren();
62 for(const FReplayInfo& Replay : Replays)
63 {
64 if(Replay.IsValid())
65 {
66 // UE_LOG(LogMenuSystem, Warning, TEXT("MENU: Friendly Name: %s Name: %s"), *Replay.FriendlyName, *Replay.ReplayName);
67 UReplaySlot* ReplaySlot = CreateWidget<UReplaySlot>(GetOwningPlayer(), ReplaySlotClass);
68 if(ReplaySlot != nullptr)
69 {
70 ReplaySlot->SetReplayInfo(Replay);
71 AllReplaysScrollBox->AddChild(ReplaySlot);
72 }
73 }
74 }
75 }
76}
A slot for displaying the Player Replay Clip.
Definition ReplaySlot.h:23
virtual void SetReplayInfo(const FReplayInfo &Replay)
Definition ReplaySlot.cpp:46
Definition MenuData.h:317

Member Data Documentation

◆ AllReplaysScrollBox

UScrollBox* UReplayMenu::AllReplaysScrollBox = nullptr
protected

◆ BackButton

UButton* UReplayMenu::BackButton = nullptr
protected

◆ BrowseReplaysButton

UButton* UReplayMenu::BrowseReplaysButton = nullptr
protected

◆ ReplaySlotClass

TSubclassOf<UReplaySlot> UReplayMenu::ReplaySlotClass
protected

The documentation for this class was generated from the following files: