UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FGameMenuPage Class Reference

#include <GameMenuPage.h>

+ Inheritance diagram for FGameMenuPage:

Public Member Functions

 FGameMenuPage ()
 
 DECLARE_DELEGATE (FOnMenuGoBack)
 
 DECLARE_DELEGATE (FOnMenuHidden)
 
 DECLARE_DELEGATE (FOnMenuOpening)
 
bool InitialiseRootMenu (APlayerController *InPCOwner, const FString &InStyleName, UGameViewportClient *InGameViewport)
 
void DestroyRootMenu ()
 
int32 NumItems () const
 
TSharedPtr< FGameMenuItemGetItem (int32 Index) const
 
bool IsValidMenuEntryIndex (int32 Index) const
 
void ShowRootMenu ()
 
TSharedRef< FGameMenuItemAddMenuItem (const FText &Text, TSharedPtr< FGameMenuPage > InSubMenu=nullptr)
 
template<class UserClass >
TSharedRef< FGameMenuItemAddMenuItem (const FText &InText, UserClass *InObj, typename FGameMenuItem::FOnConfirmMenuItem::TMethodPtr< UserClass > InMethod)
 
template<class UserClass >
TSharedRef< FGameMenuItemAddMenuItemWithOptions (const FText &Text, const TArray< FText > &OptionsList, UserClass *InObj, typename FGameMenuItem::FOnOptionChanged::TMethodPtr< UserClass > InMethod)
 
template<class UserClass >
TSharedRef< FGameMenuItemAddCustomMenuItem (const FText &Text, TSharedPtr< SGameMenuItemWidget > CustomWidget, UserClass *InObj, typename FGameMenuItem::FOnOptionChanged::TMethodPtr< UserClass > InMethod)
 
template<class UserClass >
void SetCancelHandler (UserClass *InObj, typename FGameMenuPage::FOnMenuGoBack::TMethodPtr< UserClass > InMethod)
 
template<class UserClass >
void SetOnHiddenHandler (UserClass *InObj, typename FGameMenuPage::FOnMenuHidden::TMethodPtr< UserClass > InMethod)
 
template<class UserClass >
void SetAcceptHandler (UserClass *InObj, typename FGameMenuPage::FOnMenuGoBack::TMethodPtr< UserClass > InMethod)
 
template<class UserClass >
void SetOnOpenHandler (UserClass *InObj, typename FGameMenuPage::FOnMenuHidden::TMethodPtr< UserClass > InMethod)
 
void LockControls (bool bLockState)
 
void MenuGoBack ()
 
void MenuGoBackCancel ()
 
void MenuHidden ()
 
void MenuOpening ()
 
void HideMenu ()
 
void RemoveAllItems ()
 
- Public Member Functions inherited from TSharedFromThis< FGameMenuPage >
TSharedRef< FGameMenuPage, Mode > AsShared ()
 
TSharedRef< FGameMenuPage const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< FGameMenuPage, Mode > AsWeak ()
 
TWeakPtr< FGameMenuPage const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Public Attributes

TWeakObjectPtr< APlayerControllerPCOwner
 
int32 SelectedIndex
 
FText MenuTitle
 
TSharedPtr< SGameMenuPageWidgetRootMenuPageWidget
 

Protected Types

typedef TArray< TSharedPtr< FGameMenuItem > > MenuItemList
 

Protected Attributes

FOnMenuGoBack OnGoBack
 
FOnMenuGoBack OnGoBackCancel
 
FOnMenuHidden OnMenuHidden
 
FOnMenuOpening OnMenuOpening
 
MenuItemList MenuItems
 

Additional Inherited Members

- Protected Member Functions inherited from TSharedFromThis< FGameMenuPage >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 
- Static Protected Member Functions inherited from TSharedFromThis< FGameMenuPage >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Member Typedef Documentation

◆ MenuItemList

Constructor & Destructor Documentation

◆ FGameMenuPage()

FGameMenuPage::FGameMenuPage ( )

Member Function Documentation

◆ AddCustomMenuItem()

template<class UserClass >
TSharedRef< FGameMenuItem > FGameMenuPage::AddCustomMenuItem ( const FText Text,
TSharedPtr< SGameMenuItemWidget CustomWidget,
UserClass *  InObj,
typename FGameMenuItem::FOnOptionChanged::TMethodPtr< UserClass >  InMethod 
)
inline

Add a custom menu entry

Parameters
TextLabel of the menu item
<br>
<br>
<br>
Returns
SharedRef to the MenuItem that was created.

◆ AddMenuItem() [1/2]

template<class UserClass >
TSharedRef< FGameMenuItem > FGameMenuPage::AddMenuItem ( const FText InText,
UserClass *  InObj,
typename FGameMenuItem::FOnConfirmMenuItem::TMethodPtr< UserClass >  InMethod 
)
inline

◆ AddMenuItem() [2/2]

TSharedRef< FGameMenuItem > FGameMenuPage::AddMenuItem ( const FText Text,
TSharedPtr< FGameMenuPage InSubMenu = nullptr 
)

Add a menu item.

Parameters
TextThe string for the item (EG START GAME)
InSubMenuAny submenu associated with the item
Returns
A shared reference to the created item

◆ AddMenuItemWithOptions()

template<class UserClass >
TSharedRef< FGameMenuItem > FGameMenuPage::AddMenuItemWithOptions ( const FText Text,
const TArray< FText > &  OptionsList,
UserClass *  InObj,
typename FGameMenuItem::FOnOptionChanged::TMethodPtr< UserClass >  InMethod 
)
inline

Add a menu entry with a variable number of selectable options

Parameters
TextLabel of the menu item
OptionsListList of selectable items
InObjMenu page object
InMethodMethod to call when selection changes.
Returns
SharedRef to the MenuItem that was created.

◆ DECLARE_DELEGATE() [1/3]

FGameMenuPage::DECLARE_DELEGATE ( FOnMenuGoBack  )

Delegate for when user is going back from submenu.

◆ DECLARE_DELEGATE() [2/3]

FGameMenuPage::DECLARE_DELEGATE ( FOnMenuHidden  )

Delegate for when menu is hidden.

◆ DECLARE_DELEGATE() [3/3]

FGameMenuPage::DECLARE_DELEGATE ( FOnMenuOpening  )

Delegate for when menu is about to open.

◆ DestroyRootMenu()

void FGameMenuPage::DestroyRootMenu ( )

◆ GetItem()

TSharedPtr< FGameMenuItem > FGameMenuPage::GetItem ( int32  Index) const

◆ HideMenu()

void FGameMenuPage::HideMenu ( )

◆ InitialiseRootMenu()

bool FGameMenuPage::InitialiseRootMenu ( APlayerController InPCOwner,
const FString &  InStyleName,
UGameViewportClient InGameViewport 
)

Initialize the menu page widget and set this menu as root.

Parameters
InPCOwnerPlayer controller that owns this menu.
InStyleNameName of the menu style to use.
InGameViewportGameviewport on which to place the menu.
Returns
true on success. (Will fail if viewport invalid)

◆ IsValidMenuEntryIndex()

bool FGameMenuPage::IsValidMenuEntryIndex ( int32  Index) const

◆ LockControls()

void FGameMenuPage::LockControls ( bool  bLockState)

Lock/Unlock the menu and prevent user interaction.

Parameters
bLockStatetrue to lock

◆ MenuGoBack()

void FGameMenuPage::MenuGoBack ( )
inline

Executed when user want's to go back to previous menu.

◆ MenuGoBackCancel()

void FGameMenuPage::MenuGoBackCancel ( )
inline

Called when user want's to CANCEL and go back to previous menu.

◆ MenuHidden()

void FGameMenuPage::MenuHidden ( )
inline

◆ MenuOpening()

void FGameMenuPage::MenuOpening ( )
inline

◆ NumItems()

int32 FGameMenuPage::NumItems ( ) const

◆ RemoveAllItems()

void FGameMenuPage::RemoveAllItems ( )

◆ SetAcceptHandler()

template<class UserClass >
void FGameMenuPage::SetAcceptHandler ( UserClass *  InObj,
typename FGameMenuPage::FOnMenuGoBack::TMethodPtr< UserClass >  InMethod 
)
inline

Add a handler for the menu being accepted.

Parameters
InObjMenu page object
InMethodMethod to call when selection changes.

◆ SetCancelHandler()

template<class UserClass >
void FGameMenuPage::SetCancelHandler ( UserClass *  InObj,
typename FGameMenuPage::FOnMenuGoBack::TMethodPtr< UserClass >  InMethod 
)
inline

Add a handler for the menu being canceled.

Parameters
InObjMenu page object
InMethodMethod to call when selection changes.

◆ SetOnHiddenHandler()

template<class UserClass >
void FGameMenuPage::SetOnHiddenHandler ( UserClass *  InObj,
typename FGameMenuPage::FOnMenuHidden::TMethodPtr< UserClass >  InMethod 
)
inline

Add a handler for the menu being canceled.

Parameters
InObjMenu page object
InMethodMethod to call when menu has been hidden.

◆ SetOnOpenHandler()

template<class UserClass >
void FGameMenuPage::SetOnOpenHandler ( UserClass *  InObj,
typename FGameMenuPage::FOnMenuHidden::TMethodPtr< UserClass >  InMethod 
)
inline

Add a handler for the menu being opened.

Parameters
InObjMenu page object
InMethodMethod to call when menu is about to open.

◆ ShowRootMenu()

void FGameMenuPage::ShowRootMenu ( )

Builds the menu widget and shows the menu.

Member Data Documentation

◆ MenuItems

MenuItemList FGameMenuPage::MenuItems
protected

◆ MenuTitle

FText FGameMenuPage::MenuTitle

The menu title.

◆ OnGoBack

FOnMenuGoBack FGameMenuPage::OnGoBack
protected

Executed when user want's to go back to previous menu.

◆ OnGoBackCancel

FOnMenuGoBack FGameMenuPage::OnGoBackCancel
protected

Executed when user want's to CANCEL and go back to previous menu.

◆ OnMenuHidden

FOnMenuHidden FGameMenuPage::OnMenuHidden
protected

Delegate, which is executed when menu is finished hiding.

◆ OnMenuOpening

FOnMenuOpening FGameMenuPage::OnMenuOpening
protected

Delegate, which is executed when menu is about to open.

◆ PCOwner

TWeakObjectPtr<APlayerController> FGameMenuPage::PCOwner

Weak pointer to Owning player controller.

◆ RootMenuPageWidget

TSharedPtr<SGameMenuPageWidget> FGameMenuPage::RootMenuPageWidget

The widget that is the menu.

◆ SelectedIndex

int32 FGameMenuPage::SelectedIndex

Current selection in this menu.


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