A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
AInteractionButton Class ReferenceBlueprintable

Represents an interaction button actor. More...

#include <InteractionButton.h>

Inheritance diagram for AInteractionButton:
[legend]

Public Member Functions

 AInteractionButton ()
 
EButtonState GetButtonState () const
 Gets the current state of the button.
 
virtual void GetLifetimeReplicatedProps (TArray< FLifetimeProperty > &OutLifetimeProps) const override
 
FButtonPressedDelegate & OnButtonPressed ()
 Retrieves the button pressed delegate.
 
FButtonReleasedDelegate & OnButtonReleased ()
 Retrieves the button released delegate.
 
void SetButtonName (const FName &InButtonName)
 Sets the name of the button (will be displayed on TextRenderComp).
 
void SetButtonState (EButtonState InButtonState)
 Sets the state of the button.
 
void SetButtonVisibility (bool bVisible)
 Sets the visibility of the button.
 
virtual void Tick (float DeltaTime) override
 

Public Attributes

FButtonPressedDelegate ButtonPressedDelegate
 UPROPERTY(BlueprintAssignable)
 
FButtonReleasedDelegate ButtonReleasedDelegate
 UPROPERTY(BlueprintAssignable)
 

Protected Member Functions

virtual void BeginPlay () override
 
void ButtonPress ()
 Event called when button was pressed. Overload it when you want to add functionality.
 
void ButtonRelease ()
 Event called when button was released. Overload it when you want to add functionality.
 

Protected Attributes

bool bIsButtonHaveText = false
 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)
 
UBoxComponentBoxCollisionComp
 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)
 
UStaticMeshComponentButtonMovingComp
 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)
 
USoundBase * ButtonPressSound
 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)
 
UStaticMeshComponentButtonSupportComp
 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)
 
FName ButtonText = "Button Text"
 UPROPERTY(Replicated, EditAnywhere, BlueprintReadOnly, Category = Setup, meta = (EditCondition = "bIsButtonHaveText = true", EditConditionHides))
 
UForceFeedbackEffect * LeftHandFeedbackEffect
 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)
 
UCurveFloat * MovingButtonCurve
 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)
 
UPointLightComponent * PointLightComp
 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)
 
UForceFeedbackEffect * RightHandFeedbackEffect
 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)
 
UTextRenderComponent * TextRenderComp
 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)
 

Private Member Functions

 GENERATED_BODY ()
 
void MovingButtonTimelineFinished ()
 Event handler for the finished state of the moving button timeline.
 
void MovingButtonTimelineProgress (float Value)
 Event handler for the progress of the moving button timeline.
 
void OnBeginOverlapButton (UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
 UFUNCTION()
 

Private Attributes

bool bIsPressed = false
 Indicates whether the button is currently pressed.
 
EButtonState CurrentButtonState = EButtonState::BS_Default
 The current state of the button.
 
FTimeline MovingButtonTimeLine
 Timeline for the movement of the button.
 
APlayerControllerPlayerController
 UPROPERTY()
 
TEnumAsByte< ETimelineDirection::Type > TimelineDirection
 UPROPERTY()
 

Detailed Description

Represents an interaction button actor.

UCLASS(Blueprintable)

Definition at line 38 of file InteractionButton.h.

Constructor & Destructor Documentation

◆ AInteractionButton()

AInteractionButton::AInteractionButton ( )

Definition at line 9 of file InteractionButton.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ BeginPlay()

void AInteractionButton::BeginPlay ( )
overrideprotectedvirtual

Definition at line 117 of file InteractionButton.cpp.

◆ ButtonPress()

void AInteractionButton::ButtonPress ( )
protectedBlueprintNativeEvent

Event called when button was pressed. Overload it when you want to add functionality.

UFUNCTION(BlueprintNativeEvent)

Here is the caller graph for this function:

◆ ButtonRelease()

void AInteractionButton::ButtonRelease ( )
protectedBlueprintNativeEvent

Event called when button was released. Overload it when you want to add functionality.

UFUNCTION(BlueprintNativeEvent)

Here is the caller graph for this function:

◆ GENERATED_BODY()

AInteractionButton::GENERATED_BODY ( )
private

◆ GetButtonState()

EButtonState AInteractionButton::GetButtonState ( ) const
inlineBlueprintPureBlueprintCallable

Gets the current state of the button.

Returns
The current button state.

UFUNCTION(BlueprintCallable, BlueprintPure)

Definition at line 72 of file InteractionButton.h.

Here is the caller graph for this function:

◆ GetLifetimeReplicatedProps()

void AInteractionButton::GetLifetimeReplicatedProps ( TArray< FLifetimeProperty > & OutLifetimeProps) const
overridevirtual

Definition at line 110 of file InteractionButton.cpp.

◆ MovingButtonTimelineFinished()

void AInteractionButton::MovingButtonTimelineFinished ( )
private

Event handler for the finished state of the moving button timeline.

UFUNCTION()

Definition at line 195 of file InteractionButton.cpp.

Here is the call graph for this function:

◆ MovingButtonTimelineProgress()

void AInteractionButton::MovingButtonTimelineProgress ( float Value)
private

Event handler for the progress of the moving button timeline.

Parameters
ValueThe current value of the timeline.

UFUNCTION()

Definition at line 189 of file InteractionButton.cpp.

◆ OnBeginOverlapButton()

void AInteractionButton::OnBeginOverlapButton ( UPrimitiveComponent * OverlappedComponent,
AActor * OtherActor,
UPrimitiveComponent * OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult & SweepResult )
private

UFUNCTION()

Definition at line 157 of file InteractionButton.cpp.

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

◆ OnButtonPressed()

FButtonPressedDelegate & AInteractionButton::OnButtonPressed ( )
inline

Retrieves the button pressed delegate.

Returns
Reference to the button pressed delegate.

Definition at line 56 of file InteractionButton.h.

◆ OnButtonReleased()

FButtonReleasedDelegate & AInteractionButton::OnButtonReleased ( )
inline

Retrieves the button released delegate.

Returns
Reference to the button released delegate.

Definition at line 61 of file InteractionButton.h.

◆ SetButtonName()

void AInteractionButton::SetButtonName ( const FName & InButtonName)
BlueprintCallable

Sets the name of the button (will be displayed on TextRenderComp).

Parameters
InButtonNameThe name of the button.

UFUNCTION(BlueprintCallable)

Definition at line 102 of file InteractionButton.cpp.

◆ SetButtonState()

void AInteractionButton::SetButtonState ( EButtonState InButtonState)
BlueprintCallable

Sets the state of the button.

Parameters
InButtonStateThe button state to set.

UFUNCTION(BlueprintCallable)

Definition at line 77 of file InteractionButton.cpp.

Here is the caller graph for this function:

◆ SetButtonVisibility()

void AInteractionButton::SetButtonVisibility ( bool bVisible)

Sets the visibility of the button.

Parameters
bVisibleThe visibility state of the button.

Definition at line 66 of file InteractionButton.cpp.

◆ Tick()

void AInteractionButton::Tick ( float DeltaTime)
overridevirtual

Definition at line 59 of file InteractionButton.cpp.

Member Data Documentation

◆ bIsButtonHaveText

bool AInteractionButton::bIsButtonHaveText = false
protectedBlueprintReadOnlyEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)

Determines whether the button should show text.

Definition at line 186 of file InteractionButton.h.

◆ bIsPressed

bool AInteractionButton::bIsPressed = false
private

Indicates whether the button is currently pressed.

Definition at line 220 of file InteractionButton.h.

◆ BoxCollisionComp

UBoxComponent* AInteractionButton::BoxCollisionComp
protectedVisibleAnywhereBlueprintReadWrite

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)

Component for collision detection of the button.

Definition at line 167 of file InteractionButton.h.

◆ ButtonMovingComp

UStaticMeshComponent* AInteractionButton::ButtonMovingComp
protectedVisibleAnywhereBlueprintReadWrite

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)

Button itself. It will be moving when pressed.

Definition at line 161 of file InteractionButton.h.

◆ ButtonPressedDelegate

FButtonPressedDelegate AInteractionButton::ButtonPressedDelegate
BlueprintAssignable

UPROPERTY(BlueprintAssignable)

Delegate for button pressed event.

Definition at line 99 of file InteractionButton.h.

◆ ButtonPressSound

USoundBase* AInteractionButton::ButtonPressSound
protectedBlueprintReadOnlyEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)

Sound played when the button is pressed.

Definition at line 199 of file InteractionButton.h.

◆ ButtonReleasedDelegate

FButtonReleasedDelegate AInteractionButton::ButtonReleasedDelegate
BlueprintAssignable

UPROPERTY(BlueprintAssignable)

Delegate for button released event.

Definition at line 104 of file InteractionButton.h.

◆ ButtonSupportComp

UStaticMeshComponent* AInteractionButton::ButtonSupportComp
protectedVisibleAnywhereBlueprintReadWrite

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)

Button base mesh.

Definition at line 155 of file InteractionButton.h.

◆ ButtonText

FName AInteractionButton::ButtonText = "Button Text"
protectedBlueprintReadOnlyReplicatedEditAnywhere

UPROPERTY(Replicated, EditAnywhere, BlueprintReadOnly, Category = Setup, meta = (EditCondition = "bIsButtonHaveText = true", EditConditionHides))

The text displayed on the TextRenderComp.

Definition at line 193 of file InteractionButton.h.

◆ CurrentButtonState

EButtonState AInteractionButton::CurrentButtonState = EButtonState::BS_Default
private

The current state of the button.

Definition at line 221 of file InteractionButton.h.

◆ LeftHandFeedbackEffect

UForceFeedbackEffect* AInteractionButton::LeftHandFeedbackEffect
protectedBlueprintReadOnlyEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)

Feedback effect played in the left hand when interacting with the button.

Definition at line 211 of file InteractionButton.h.

◆ MovingButtonCurve

UCurveFloat* AInteractionButton::MovingButtonCurve
protectedBlueprintReadOnlyEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)

Curve defining the movement of the button.

Definition at line 205 of file InteractionButton.h.

◆ MovingButtonTimeLine

FTimeline AInteractionButton::MovingButtonTimeLine
private

Timeline for the movement of the button.

Definition at line 223 of file InteractionButton.h.

◆ PlayerController

APlayerController* AInteractionButton::PlayerController
private

UPROPERTY()

The player controller associated with the button.

Definition at line 232 of file InteractionButton.h.

◆ PointLightComp

UPointLightComponent* AInteractionButton::PointLightComp
protectedVisibleAnywhereBlueprintReadWrite

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)

Component for the point light of the button.

Definition at line 173 of file InteractionButton.h.

◆ RightHandFeedbackEffect

UForceFeedbackEffect* AInteractionButton::RightHandFeedbackEffect
protectedBlueprintReadOnlyEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)

Feedback effect played in the right hand when interacting with the button.

Definition at line 217 of file InteractionButton.h.

◆ TextRenderComp

UTextRenderComponent* AInteractionButton::TextRenderComp
protectedVisibleAnywhereBlueprintReadWrite

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)

Component for rendering the text for the button.

Definition at line 179 of file InteractionButton.h.

◆ TimelineDirection

TEnumAsByte<ETimelineDirection::Type> AInteractionButton::TimelineDirection
private

UPROPERTY()

The direction of the timeline.

Definition at line 227 of file InteractionButton.h.


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