A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
UButtonListWidget Class Reference

Custom widget class representing a list of buttons. More...

#include <ButtonListWidget.h>

Inheritance diagram for UButtonListWidget:
[legend]

Public Member Functions

const FGuid & GetGuid () const
 
const FString & GetWidgetInfoName ()
 UFUNCTION(BlueprintCallable)
 
virtual void Init (UBasicWidgetInfo *WidgetInfo) override
 Initializes the widget with the provided widget information.
 
virtual void NativeOnInitialized () override
 
virtual void OnClickExitMenuEvent (FText ButtonName)
 Event handler for the "ExitMenu" button click event.
 
virtual void PlayerWentAwayHandler (const float SquaredDistanceToPlayerCm)
 Handler for when the player goes away.
 
void ProcessSquaredDistanceToPlayer (const float SquaredDistanceToPlayerCm, const float DeltaSec)
 Processes the squared distance to the player.
 
virtual void SelectButtonEvent (FText SelectedButtonName)
 Selects a button by its name and deselects other buttons.
 
void SetCustomGuid (const FGuid &NewGuid)
 
virtual void SpawnButtons (const UDataTable *DTButtonsList)
 Spawns buttons based on the provided data table.
 

Public Attributes

FConfirmEventDelegate OnConfirmEventDelegate
 
FExitMenuEventDelegate OnExitMenuEventDelegate
 Event delegate for the "ExitMenu" event.
 
FOnPlayerWentAway OnPlayerWentAway
 Event for when the player goes away.
 

Protected Member Functions

virtual void OnClickConfirmEvent (FText ButtonName)
 Event called when the confirm button is clicked.
 
void PlayerWentAway ()
 UFUNCTION(BlueprintNativeEvent, meta=(DisplayName="PlayerWentAwayHandler"))
 
virtual void SpawnButtonInstance (FText ButtonName, bool Checked)
 Spawns an instance of a button with the specified name.
 

Protected Attributes

FMargin ButtonPadding = {0.0, 10.0, 0.0, 10.0}
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Buttons")
 
TArray< UButtonWidget * > ButtonsArray
 Holds all buttons which were spawned from Data Table.
 
TSubclassOf< class UButtonWidgetButtonWidgetClass
 The class that will be used to spawning the buttons.
 
TSubclassOf< class UButtonWidgetCheckButtonWidgetClass
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Buttons")
 
UButtonWidgetConfirmButton
 UPROPERTY(BlueprintReadOnly, Category = "Buttons", meta = (BindWidget))
 
FText Heading = FText::FromString(TEXT("Heading"))
 UPROPERTY(BlueprintReadWrite)
 
float MaxDistanceCalculationDelaySec = 5.0f
 UPROPERTY(BlueprintReadWrite)
 
UButtonWidgetSelectedButton
 Holds the last selected button.
 
TSet< FString > SelectedButtonsLabels
 
UVerticalBox * VerticalBoxButtons
 UPROPERTY(BlueprintReadOnly, meta = (BindWidget))
 

Private Member Functions

 GENERATED_BODY ()
 

Private Attributes

bool bConfirmSelection
 Should we check for any selected option before accept confirmation.
 
bool bIsClosingByDistance = false
 Flag indicating if the widget should be closed by distance.
 
float DistanceCalculationDelay = 0.0f
 
int32 MaxSquaredClosingDistance = -1
 
FGuid WidgetGuid
 
FString WidgetInfoName
 Name of widget info used for creating this widget.
 

Detailed Description

Custom widget class representing a list of buttons.

UCLASS()

Definition at line 18 of file ButtonListWidget.h.

Member Function Documentation

◆ GENERATED_BODY()

UButtonListWidget::GENERATED_BODY ( )
private

◆ GetGuid()

const FGuid & UBasicWidget::GetGuid ( ) const
inlineinherited

Definition at line 47 of file BasicWidget.h.

Here is the caller graph for this function:

◆ GetWidgetInfoName()

const FString & UBasicWidget::GetWidgetInfoName ( )
inlineinheritedBlueprintCallable

UFUNCTION(BlueprintCallable)

Definition at line 44 of file BasicWidget.h.

◆ Init()

void UButtonListWidget::Init ( UBasicWidgetInfo * WidgetInfo)
overridevirtual

Initializes the widget with the provided widget information.

Parameters
WidgetInfoThe widget information.

UFUNCTION(BlueprintCallable)

Reimplemented from UBasicWidget.

Definition at line 19 of file ButtonListWidget.cpp.

Here is the call graph for this function:

◆ NativeOnInitialized()

void UButtonListWidget::NativeOnInitialized ( )
overridevirtual

Reimplemented from UBasicWidget.

Definition at line 9 of file ButtonListWidget.cpp.

Here is the call graph for this function:

◆ OnClickConfirmEvent()

void UButtonListWidget::OnClickConfirmEvent ( FText ButtonName)
protectedvirtual

Event called when the confirm button is clicked.

Parameters
ButtonNameThe name of the button that was clicked.

UFUNCTION(Category = "Buttons")

Definition at line 34 of file ButtonListWidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnClickExitMenuEvent()

void UBasicWidget::OnClickExitMenuEvent ( FText ButtonName)
virtualinherited

Event handler for the "ExitMenu" button click event.

Parameters
ButtonNameThe name of the clicked button.

UFUNCTION(Category = "Buttons")

Definition at line 51 of file BasicWidget.cpp.

Here is the caller graph for this function:

◆ PlayerWentAway()

void UBasicWidget::PlayerWentAway ( )
protectedinheritedBlueprintNativeEvent

UFUNCTION(BlueprintNativeEvent, meta=(DisplayName="PlayerWentAwayHandler"))

◆ PlayerWentAwayHandler()

virtual void UBasicWidget::PlayerWentAwayHandler ( const float SquaredDistanceToPlayerCm)
inlinevirtualinherited

Handler for when the player goes away.

Parameters
SquaredDistanceToPlayerCmThe squared distance to the player in centimeters.

Definition at line 68 of file BasicWidget.h.

Here is the caller graph for this function:

◆ ProcessSquaredDistanceToPlayer()

void UBasicWidget::ProcessSquaredDistanceToPlayer ( const float SquaredDistanceToPlayerCm,
const float DeltaSec )
inherited

Processes the squared distance to the player.

Parameters
SquaredDistanceToPlayerCmThe squared distance to the player in centimeters.
DeltaSecThe time elapsed since the last update.

Definition at line 29 of file BasicWidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SelectButtonEvent()

void UButtonListWidget::SelectButtonEvent ( FText SelectedButtonName)
virtualBlueprintCallable

Selects a button by its name and deselects other buttons.

Parameters
SelectedButtonNameThe name of the selected button.

UFUNCTION(BlueprintCallable, Category = "Buttons")

Definition at line 52 of file ButtonListWidget.cpp.

Here is the caller graph for this function:

◆ SetCustomGuid()

void UBasicWidget::SetCustomGuid ( const FGuid & NewGuid)
inlineinherited

Definition at line 46 of file BasicWidget.h.

Here is the caller graph for this function:

◆ SpawnButtonInstance()

void UButtonListWidget::SpawnButtonInstance ( FText ButtonName,
bool Checked )
protectedvirtualBlueprintCallable

Spawns an instance of a button with the specified name.

Parameters
ButtonNameThe name of the button to spawn.
CheckedIndicates if the button should be checked.

UFUNCTION(BlueprintCallable, Category = "Buttons")

Definition at line 94 of file ButtonListWidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SpawnButtons()

void UButtonListWidget::SpawnButtons ( const UDataTable * DTButtonsList)
virtualBlueprintCallable

Spawns buttons based on the provided data table.

Parameters
DTButtonsListThe data table containing button information.

UFUNCTION(BlueprintCallable, Category = "Buttons")

Definition at line 81 of file ButtonListWidget.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ bConfirmSelection

bool UButtonListWidget::bConfirmSelection
private

Should we check for any selected option before accept confirmation.

Definition at line 125 of file ButtonListWidget.h.

◆ bIsClosingByDistance

bool UBasicWidget::bIsClosingByDistance = false
privateinherited

Flag indicating if the widget should be closed by distance.

Definition at line 106 of file BasicWidget.h.

◆ ButtonPadding

FMargin UButtonListWidget::ButtonPadding = {0.0, 10.0, 0.0, 10.0}
protectedBlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Buttons")

Definition at line 112 of file ButtonListWidget.h.

◆ ButtonsArray

TArray<UButtonWidget*> UButtonListWidget::ButtonsArray
protectedBlueprintReadWrite

Holds all buttons which were spawned from Data Table.

UPROPERTY(BlueprintReadWrite, Category = "Buttons")

Definition at line 90 of file ButtonListWidget.h.

◆ ButtonWidgetClass

TSubclassOf<class UButtonWidget> UButtonListWidget::ButtonWidgetClass
protectedBlueprintReadWriteEditAnywhere

The class that will be used to spawning the buttons.

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Buttons")

Definition at line 98 of file ButtonListWidget.h.

◆ CheckButtonWidgetClass

TSubclassOf<class UButtonWidget> UButtonListWidget::CheckButtonWidgetClass
protectedBlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Buttons")

Definition at line 105 of file ButtonListWidget.h.

◆ ConfirmButton

UButtonWidget* UButtonListWidget::ConfirmButton
protectedBlueprintReadOnly

UPROPERTY(BlueprintReadOnly, Category = "Buttons", meta = (BindWidget))

Definition at line 77 of file ButtonListWidget.h.

◆ DistanceCalculationDelay

float UBasicWidget::DistanceCalculationDelay = 0.0f
privateinherited

Definition at line 108 of file BasicWidget.h.

◆ Heading

FText UBasicWidget::Heading = FText::FromString(TEXT("Heading"))
protectedinheritedBlueprintReadWrite

UPROPERTY(BlueprintReadWrite)

Heading of the widget

Definition at line 94 of file BasicWidget.h.

◆ MaxDistanceCalculationDelaySec

float UBasicWidget::MaxDistanceCalculationDelaySec = 5.0f
protectedinheritedBlueprintReadWrite

UPROPERTY(BlueprintReadWrite)

How frequently should we check closing distance.

Definition at line 99 of file BasicWidget.h.

◆ MaxSquaredClosingDistance

int32 UBasicWidget::MaxSquaredClosingDistance = -1
privateinherited

Definition at line 107 of file BasicWidget.h.

◆ OnConfirmEventDelegate

FConfirmEventDelegate UButtonListWidget::OnConfirmEventDelegate

Definition at line 70 of file ButtonListWidget.h.

◆ OnExitMenuEventDelegate

FExitMenuEventDelegate UBasicWidget::OnExitMenuEventDelegate
inherited

Event delegate for the "ExitMenu" event.

Todo
Investigate and probably remove because not all widgets have exit.

Definition at line 86 of file BasicWidget.h.

◆ OnPlayerWentAway

FOnPlayerWentAway UBasicWidget::OnPlayerWentAway
inherited

Event for when the player goes away.

Definition at line 87 of file BasicWidget.h.

◆ SelectedButton

UButtonWidget* UButtonListWidget::SelectedButton
protectedBlueprintReadWrite

Holds the last selected button.

UPROPERTY(BlueprintReadWrite, Category = "Buttons")

Definition at line 119 of file ButtonListWidget.h.

◆ SelectedButtonsLabels

TSet<FString> UButtonListWidget::SelectedButtonsLabels
protected

Definition at line 121 of file ButtonListWidget.h.

◆ VerticalBoxButtons

UVerticalBox* UButtonListWidget::VerticalBoxButtons
protectedBlueprintReadOnly

UPROPERTY(BlueprintReadOnly, meta = (BindWidget))

Definition at line 83 of file ButtonListWidget.h.

◆ WidgetGuid

FGuid UBasicWidget::WidgetGuid
privateinherited

Definition at line 103 of file BasicWidget.h.

◆ WidgetInfoName

FString UBasicWidget::WidgetInfoName
privateinherited

Name of widget info used for creating this widget.

Definition at line 102 of file BasicWidget.h.


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