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

#include <MenuSystemWidget.h>

Inheritance diagram for UMenuSystemWidget:
UBaseActivatableWidget UAudioOptionsWidget UInGameMenuSystemWidget ULevelSelectionWidget UMainMenuSystemWidget UModalMenuSystemWidget UOptionsMenuSystemWidget USingleMenuSystemWidget USingleMenuWithTabsWidget

Public Member Functions

 UMenuSystemWidget (const FObjectInitializer &ObjectInitializer)
 
virtual bool Initialize () override
 
virtual void NativeConstruct () override
 
virtual bool NativeOnHandleBackAction () override
 
void SetMenuInterface (IMenuSystem *Interface)
 
void Setup ()
 
virtual void OpenConfirmationMessage (const FModalData &ModalData)
 
virtual void SetServerList (const TArray< FServerRow > &ServerInfo)
 
void SetOwnerWidget (UUserWidget *Owner)
 
UUserWidget * GetOwnerWidget () const
 
void WidgetVisibilityChanged (ESlateVisibility SlateVisibility)
 
bool GetIsOnlineGame () const
 
bool GetIsPublicMatch () const
 
virtual bool GetDebuggingMode () const
 
virtual FString GetPlayerUserName () const
 
virtual bool GetIsPlayerLoggedIn () const
 
virtual FString GetCurrentSessionName () const
 
virtual EOnlineSubsystem GetOnlineSubsystem () const
 

Public Attributes

FOnMenuBackButtonSelected OnMenuBackButtonSelected
 

Protected Member Functions

virtual void ModalButtonSelected (const int32 Index)
 
void OnModalButtonSelectedEvent (const int32 Index)
 
virtual void ModalClosed ()
 
void OnModalClosedEvent ()
 
class UModalMenuSystemWidgetGetCurrentModal () const
 
void SetModalSlot (UPanelWidget *PanelWidget)
 
void SetNotificationSlot (UPanelWidget *PanelWidget)
 
- Protected Member Functions inherited from UBaseActivatableWidget
void LogDebugError (const FString &Message) const
 
void LogDebugError (const FString &Message, const int32 Value) const
 
void LogDebugError (const FString &Message, const float Value) const
 
void LogDebugWarning (const FString &Message) const
 
void LogDebugWarning (const FString &Message, const int32 Value) const
 
void LogDebugWarning (const FString &Message, const float Value) const
 
void LogDebugMessage (const FString &Message, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const int32 Value, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const float Value, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const bool bValue, const bool bWarning, const bool bError) const
 
void LogOnScreenMessage (const int32 Key, const FString &Message, FColor Color=FColor::Green) const
 
void SetCategoryName (const FLogCategoryBase &Category)
 

Protected Attributes

IMenuSystemMenuInterface = nullptr
 
class IModalInterfaceModalInterface = nullptr
 
bool bIsController = false
 
bool bIsKeyboard = false
 
bool bMouse = false
 
- Protected Attributes inherited from UBaseActivatableWidget
bool bDebuggingMode = false
 

Private Attributes

UUserWidget * OwnerWidget = nullptr
 
class UPanelWidget * ModalSlot = nullptr
 
class UPanelWidget * NotificationSlot = nullptr
 
class UModalMenuSystemWidgetModal = nullptr
 

Constructor & Destructor Documentation

◆ UMenuSystemWidget()

UMenuSystemWidget::UMenuSystemWidget ( const FObjectInitializer & ObjectInitializer)
explicit
10 : Super(ObjectInitializer)
11{
12
13}

Member Function Documentation

◆ GetCurrentModal()

class UModalMenuSystemWidget * UMenuSystemWidget::GetCurrentModal ( ) const
inlineprotected
92{return Modal;};
class UModalMenuSystemWidget * Modal
Definition MenuSystemWidget.h:109

◆ GetCurrentSessionName()

FString UMenuSystemWidget::GetCurrentSessionName ( ) const
virtual
156{
157 if(MenuInterface == nullptr){UE_LOG(LogMenuSystem, Error, TEXT("Menu Interface Missing, GetCurrentSessionName"));return "Error in Session Name, Check Log";}
159}
virtual FString GetCurrentSessionName() const =0
IMenuSystem * MenuInterface
Definition MenuSystemWidget.h:69

◆ GetDebuggingMode()

bool UMenuSystemWidget::GetDebuggingMode ( ) const
virtual
138{
139 if(MenuInterface == nullptr){UE_LOG(LogMenuSystem, Error, TEXT("Menu Interface Missing, GetDebuggingMode"));return false;}
141}
virtual bool GetDebuggingMode() const =0

◆ GetIsOnlineGame()

bool UMenuSystemWidget::GetIsOnlineGame ( ) const
126{
127 if(MenuInterface == nullptr){UE_LOG(LogMenuSystem, Error, TEXT("Menu Interface Missing, GetIsOnlineGame"));return false;}
129}
virtual bool GetIsOnlineGame() const =0

◆ GetIsPlayerLoggedIn()

bool UMenuSystemWidget::GetIsPlayerLoggedIn ( ) const
virtual
150{
151 if(MenuInterface == nullptr){UE_LOG(LogMenuSystem, Error, TEXT("Menu Interface Missing, GetIsPlayerLoggedIn"));return false;}
153}
virtual bool GetIsPlayerLoggedIn() const =0

◆ GetIsPublicMatch()

bool UMenuSystemWidget::GetIsPublicMatch ( ) const
132{
133 if(MenuInterface == nullptr){UE_LOG(LogMenuSystem, Error, TEXT("Menu Interface Missing, GetIsPublicMatch"));return false;}
135}
virtual bool GetIsPublicMatch() const =0

◆ GetOnlineSubsystem()

EOnlineSubsystem UMenuSystemWidget::GetOnlineSubsystem ( ) const
virtual
162{
163 if(MenuInterface == nullptr){UE_LOG(LogMenuSystem, Error, TEXT("Menu Interface Missing, GetOnlineSubsystem"));return EOnlineSubsystem::Null;}
165}
virtual EOnlineSubsystem GetOnlineSubsystem() const =0

◆ GetOwnerWidget()

UUserWidget * UMenuSystemWidget::GetOwnerWidget ( ) const
inline
46{return OwnerWidget;};
UUserWidget * OwnerWidget
Definition MenuSystemWidget.h:101

◆ GetPlayerUserName()

FString UMenuSystemWidget::GetPlayerUserName ( ) const
virtual
144{
145 if(MenuInterface == nullptr){UE_LOG(LogMenuSystem, Error, TEXT("Menu Interface Missing, GetPlayerUserName"));return "Error in Player Name, Check Log";}
147}
virtual FString GetPlayerUserName() const =0

◆ Initialize()

bool UMenuSystemWidget::Initialize ( )
overridevirtual

Reimplemented in ULevelSelectionWidget, USingleMenuWithTabsWidget, UInGameMenuSystemWidget, UMainMenuSystemWidget, UModalMenuSystemWidget, UOptionsMenuSystemWidget, UAudioOptionsWidget, and USingleMenuSystemWidget.

16{
17 OnVisibilityChanged.AddUniqueDynamic(this, &UMenuSystemWidget::WidgetVisibilityChanged);
18 return Super::Initialize();
19}
void WidgetVisibilityChanged(ESlateVisibility SlateVisibility)

◆ ModalButtonSelected()

void UMenuSystemWidget::ModalButtonSelected ( const int32 Index)
protectedvirtual

Reimplemented in UInGameMenuSystemWidget, and UMainMenuSystemWidget.

168{
170}
void OnModalButtonSelectedEvent(const int32 Index)

◆ ModalClosed()

void UMenuSystemWidget::ModalClosed ( )
protectedvirtual

Reimplemented in UInGameMenuSystemWidget.

113{
115 Modal = nullptr;
116 ActivateWidget();
117}
void OnModalClosedEvent()

◆ NativeConstruct()

void UMenuSystemWidget::NativeConstruct ( )
overridevirtual

Reimplemented in ULevelSelectionWidget, USingleMenuWithTabsWidget, UInGameMenuSystemWidget, UMainMenuSystemWidget, UModalMenuSystemWidget, UAudioOptionsWidget, and USingleMenuSystemWidget.

22{
23 Super::NativeConstruct();
24 ModalInterface = Cast<IModalInterface>(GetGameInstance());
25 MenuInterface = Cast<IMenuSystem>(GetGameInstance());
26 if(ModalSlot != nullptr)
27 {
28 ModalSlot->ClearChildren();
29 }
30 if(NotificationSlot != nullptr)
31 {
32 NotificationSlot->ClearChildren();
33 }
34}
class IModalInterface * ModalInterface
Definition MenuSystemWidget.h:70
class UPanelWidget * NotificationSlot
Definition MenuSystemWidget.h:106
class UPanelWidget * ModalSlot
Definition MenuSystemWidget.h:104

◆ NativeOnHandleBackAction()

bool UMenuSystemWidget::NativeOnHandleBackAction ( )
overridevirtual

Reimplemented in UInGameMenuSystemWidget, UModalMenuSystemWidget, UOptionsMenuSystemWidget, and USingleMenuSystemWidget.

37{
38 // if(OwnerWidget != nullptr)
39 // {
40 // UCommonActivatableWidget* CurrentActivatable = Cast<UCommonActivatableWidget>(OwnerWidget);
41 // if(CurrentActivatable != nullptr)
42 // {
43 // CurrentActivatable->SetVisibility(ESlateVisibility::Visible);
44 // CurrentActivatable->ActivateWidget();
45 // }
46 // DeactivateWidget();
47 // SetVisibility(ESlateVisibility::Collapsed);
48 // }
49 return Super::NativeOnHandleBackAction();
50}

◆ OnModalButtonSelectedEvent()

void UMenuSystemWidget::OnModalButtonSelectedEvent ( const int32 Index)
protected

◆ OnModalClosedEvent()

void UMenuSystemWidget::OnModalClosedEvent ( )
protected

◆ OpenConfirmationMessage()

void UMenuSystemWidget::OpenConfirmationMessage ( const FModalData & ModalData)
virtual
70{
71 if(ModalInterface == nullptr)
72 {
73 ModalInterface = Cast<IModalInterface>(GetGameInstance());
74 }
75 if(ModalInterface == nullptr || ModalInterface->GetModalWidgetClass() == nullptr){return;}
76 if(ModalData.Style == EMenuSystemModalType::Notification && NotificationSlot != nullptr)
77 {
78 UModalMenuSystemWidget* Notification = CreateWidget<UModalMenuSystemWidget>(GetOwningPlayer(), ModalInterface->GetModalWidgetClass());
79 Notification->SetValues(ModalData);
81 return;
82 }
83 if(Modal == nullptr)
84 {
85 Modal = CreateWidget<UModalMenuSystemWidget>(GetOwningPlayer(), ModalInterface->GetModalWidgetClass());
86 }
87 if(Modal != nullptr)
88 {
89 if(Modal->IsInViewport())
90 {
91 DeactivateWidget();
92 Modal->ActivateWidget();
93 return;
94 }
96 Modal->OnCloseModal.AddUniqueDynamic(this, &UMenuSystemWidget::ModalClosed);
97 Modal->SetValues(ModalData);
98 if(ModalData.Style != EMenuSystemModalType::Notification && ModalSlot != nullptr)
99 {
100 ModalSlot->ClearChildren();
101 ModalSlot->AddChild(Modal);
102 DeactivateWidget();
103 Modal->ActivateWidget();
104 return;
105 }
106 Modal->AddToViewport();
107 DeactivateWidget();
108 Modal->ActivateWidget();
109 }
110}
virtual TSubclassOf< UUserWidget > GetModalWidgetClass()
Definition ModalInterface.h:29
virtual void ModalButtonSelected(const int32 Index)
Definition MenuSystemWidget.cpp:167
virtual void ModalClosed()
Definition MenuSystemWidget.cpp:112
Definition ModalMenuSystemWidget.h:16
FOnModalButtonSelected OnModalButtonSelected
Definition ModalMenuSystemWidget.h:23
FOnCloseModal OnCloseModal
Definition ModalMenuSystemWidget.h:25
void SetValues(const EMenuSystemModalAlert Alert, const EMenuSystemModalType Style, FString Title, FString Description, FString LeftText, FString RightText)
Definition ModalMenuSystemWidget.cpp:244
EMenuSystemModalType Style
Definition MenuData.h:272

◆ SetMenuInterface()

void UMenuSystemWidget::SetMenuInterface ( IMenuSystem * Interface)
53{
54 MenuInterface = Interface;
55}

◆ SetModalSlot()

void UMenuSystemWidget::SetModalSlot ( UPanelWidget * PanelWidget)
inlineprotected
94{ModalSlot = PanelWidget;};

◆ SetNotificationSlot()

void UMenuSystemWidget::SetNotificationSlot ( UPanelWidget * PanelWidget)
inlineprotected
95{NotificationSlot = PanelWidget;};

◆ SetOwnerWidget()

void UMenuSystemWidget::SetOwnerWidget ( UUserWidget * Owner)
inline

◆ SetServerList()

void UMenuSystemWidget::SetServerList ( const TArray< FServerRow > & ServerInfo)
virtual

Reimplemented in UMainMenuSystemWidget.

121{
122
123}

◆ Setup()

void UMenuSystemWidget::Setup ( )
58{
59 AddToViewport();
60 APlayerController* PlayerControllerReference = GetOwningPlayer();
61
62 if (!ensure(PlayerControllerReference != nullptr)) return;
63 FInputModeUIOnly InputModeData;
64 InputModeData.SetLockMouseToViewportBehavior(EMouseLockMode::LockAlways);
65 PlayerControllerReference->SetInputMode(InputModeData);
66 PlayerControllerReference->bShowMouseCursor = true;
67}

◆ WidgetVisibilityChanged()

void UMenuSystemWidget::WidgetVisibilityChanged ( ESlateVisibility SlateVisibility)

Member Data Documentation

◆ bIsController

bool UMenuSystemWidget::bIsController = false
protected

◆ bIsKeyboard

bool UMenuSystemWidget::bIsKeyboard = false
protected

◆ bMouse

bool UMenuSystemWidget::bMouse = false
protected

◆ MenuInterface

IMenuSystem* UMenuSystemWidget::MenuInterface = nullptr
protected

◆ Modal

class UModalMenuSystemWidget* UMenuSystemWidget::Modal = nullptr
private

◆ ModalInterface

class IModalInterface* UMenuSystemWidget::ModalInterface = nullptr
protected

◆ ModalSlot

class UPanelWidget* UMenuSystemWidget::ModalSlot = nullptr
private

◆ NotificationSlot

class UPanelWidget* UMenuSystemWidget::NotificationSlot = nullptr
private

◆ OnMenuBackButtonSelected

FOnMenuBackButtonSelected UMenuSystemWidget::OnMenuBackButtonSelected

◆ OwnerWidget

UUserWidget* UMenuSystemWidget::OwnerWidget = nullptr
private

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