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

#include <InteractionTypeWidget.h>

Inheritance diagram for UInteractionTypeWidget:

Public Member Functions

virtual bool Initialize () override
 
virtual void NativeConstruct () override
 
void SetInteractionText (const FString &Key="[E]", const FString &InteractionType="Open", const FString &Name="Door") const
 
void ClearInteractionText () const
 
void SetSelected (const bool bValue)
 
void OnSelected (const bool bValue)
 
void SetHasProgress (const bool bValue) const
 
void SetAvailable (const bool bValue)
 
virtual void StartSelection (const float Time)
 
virtual void StopSelection ()
 
void OnStartSelection (const float Time)
 
void OnStopSelection ()
 

Protected Member Functions

void OnHovered ()
 
void OnUnhovered ()
 
void OnClicked ()
 

Protected Attributes

FName InteractInputName = "Interact"
 
bool bIsSelected = false
 
class UButton * ButtonOverlay
 
class UButtonPromptWidgetButtonPromptWidget = nullptr
 
class UTextBlock * ContextTextBlock
 
bool bAvailable = true
 

Member Function Documentation

◆ ClearInteractionText()

void UInteractionTypeWidget::ClearInteractionText ( ) const
44{
45 SetInteractionText("","","");
46}
void SetInteractionText(const FString &Key="[E]", const FString &InteractionType="Open", const FString &Name="Door") const
Definition InteractionTypeWidget.cpp:37

◆ Initialize()

bool UInteractionTypeWidget::Initialize ( )
overridevirtual
11{
12 const bool Success = Super::Initialize();
13 if(!Success) return false;
14 if (!ensure(ContextTextBlock != nullptr)) return false;
15 if (!ensure(ButtonOverlay != nullptr)) return false;
16 if (!ensure(ButtonPromptWidget != nullptr)) return false;
17
19 ButtonOverlay->OnHovered.AddUniqueDynamic(this, &UInteractionTypeWidget::OnHovered);
20 ButtonOverlay->OnClicked.AddUniqueDynamic(this, &UInteractionTypeWidget::OnClicked);
21 ButtonOverlay->OnUnhovered.AddUniqueDynamic(this, &UInteractionTypeWidget::OnUnhovered);
22 return true;
23}
bool bKeepProgressSize
Definition ButtonPromptWidget.h:89
class UButtonPromptWidget * ButtonPromptWidget
Definition InteractionTypeWidget.h:58
void OnHovered()
Definition InteractionTypeWidget.cpp:85
class UTextBlock * ContextTextBlock
Definition InteractionTypeWidget.h:60
void OnClicked()
Definition InteractionTypeWidget.cpp:95
class UButton * ButtonOverlay
Definition InteractionTypeWidget.h:55
void OnUnhovered()
Definition InteractionTypeWidget.cpp:90

◆ NativeConstruct()

void UInteractionTypeWidget::NativeConstruct ( )
overridevirtual
26{
27 Super::NativeConstruct();
28 if(ButtonPromptWidget != nullptr)
29 {
33 ButtonPromptWidget->SetVisibility(ESlateVisibility::Hidden);
34 }
35}
bool bUseDataTable
Definition ButtonPromptWidget.h:85
void SetInputActionFromTable(const FName &Name)
Definition ButtonPromptWidget.cpp:118
FName InteractInputName
Definition InteractionTypeWidget.h:50

◆ OnClicked()

void UInteractionTypeWidget::OnClicked ( )
protected
96{
97 bIsSelected = true;
98}
bool bIsSelected
Definition InteractionTypeWidget.h:52

◆ OnHovered()

void UInteractionTypeWidget::OnHovered ( )
protected
86{
87 bIsSelected = true;
88}

◆ OnSelected()

void UInteractionTypeWidget::OnSelected ( const bool bValue)

◆ OnStartSelection()

void UInteractionTypeWidget::OnStartSelection ( const float Time)

◆ OnStopSelection()

void UInteractionTypeWidget::OnStopSelection ( )

◆ OnUnhovered()

void UInteractionTypeWidget::OnUnhovered ( )
protected
91{
92 bIsSelected = false;
93}

◆ SetAvailable()

void UInteractionTypeWidget::SetAvailable ( const bool bValue)
68{
69 bAvailable = bValue;
71}
void SetAvailable(const bool bValue=true)
Definition ButtonPromptWidget.cpp:93
bool bAvailable
Definition InteractionTypeWidget.h:63

◆ SetHasProgress()

void UInteractionTypeWidget::SetHasProgress ( const bool bValue) const
63{
65}
void SetHasProgress(const bool bValue)
Definition ButtonPromptWidget.cpp:98

◆ SetInteractionText()

void UInteractionTypeWidget::SetInteractionText ( const FString & Key = "[E]",
const FString & InteractionType = "Open",
const FString & Name = "Door" ) const
39{
40 ContextTextBlock->SetText(FText::FromString(Key + " " + InteractionType + " " + Name));
41}

◆ SetSelected()

void UInteractionTypeWidget::SetSelected ( const bool bValue)
49{
50 bIsSelected = bValue;
51 if(bIsSelected)
52 {
53 ButtonPromptWidget->SetVisibility(ESlateVisibility::Visible);
54 }
55 else
56 {
57 ButtonPromptWidget->SetVisibility(ESlateVisibility::Hidden);
58 }
60}
void OnSelected(const bool bValue)

◆ StartSelection()

void UInteractionTypeWidget::StartSelection ( const float Time)
virtual
74{
76 OnStartSelection(Time);
77}
void StartButtonProgress(const float Time)
void OnStartSelection(const float Time)

◆ StopSelection()

void UInteractionTypeWidget::StopSelection ( )
virtual

Member Data Documentation

◆ bAvailable

bool UInteractionTypeWidget::bAvailable = true
protected

◆ bIsSelected

bool UInteractionTypeWidget::bIsSelected = false
protected

◆ ButtonOverlay

class UButton* UInteractionTypeWidget::ButtonOverlay
protected

◆ ButtonPromptWidget

class UButtonPromptWidget* UInteractionTypeWidget::ButtonPromptWidget = nullptr
protected

◆ ContextTextBlock

class UTextBlock* UInteractionTypeWidget::ContextTextBlock
protected

◆ InteractInputName

FName UInteractionTypeWidget::InteractInputName = "Interact"
protected

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