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

#include <InteractableActorWithPrompt.h>

Inheritance diagram for AInteractableActorWithPrompt:
AInteractableActor AActorBase IBaseInterface ISaveLoad AWeaponAttachmentPickup AWeaponPickup

Public Member Functions

 AInteractableActorWithPrompt ()
 
- Public Member Functions inherited from AInteractableActor
 AInteractableActor ()
 
virtual void ReceiveStartFocus (AActor *Caller)
 
virtual void ReceiveEndFocus (AActor *Caller)
 
virtual void ReceiveOnInteract (AActor *Caller, const EInteractionType InteractionType)
 
virtual void ReceiveOnEndInteract (AActor *Caller)
 
virtual void ReceiveOnOverlap (AActor *Caller)
 
virtual void ReceiveOnEndOverlap (AActor *Caller)
 
virtual void ReceiveToggleSwitch (AActor *Caller, const bool bOn)
 
- Public Member Functions inherited from AActorBase
 AActorBase ()
 
virtual bool SaveGame () override
 
virtual bool LoadGame () override
 
void SetGravityEnabledEvent (const bool bValue)
 

Protected Member Functions

virtual void BeginPlay () override
 
virtual void InteractionComplete ()
 
void OnInteractionComplete (AActor *Caller)
 
void HideButtonPrompt ()
 
- Protected Member Functions inherited from AInteractableActor
virtual void Tick (float DeltaTime) override
 
virtual void SetMeshOutline (const bool bValue)
 
- Protected Member Functions inherited from AActorBase
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

class UInteractionPromptComponent * InteractionPromptComponent
 
class USphereComponent * InteractionPromptCollision
 
class USceneComponent * SceneRootComponent
 
bool bHasProgress = true
 
float PromptHeight = 75.0f
 
AActor * CurrentInteractCaller = nullptr
 
float HidePromptTime = 2.5f
 
- Protected Attributes inherited from AInteractableActor
class UInteractableActorComponent * InteractableActorComponent
 
class UAudioReactionComponent * AudioReactionComponent
 
class UAIPerceptionStimuliSourceComponent * PerceptionStimuliComponent
 
- Protected Attributes inherited from AActorBase
FString DisplayName = "Display Name"
 
bool bDebuggingMode = false
 

Private Attributes

FTimerHandle HidePromptTimerHandle
 
class UButtonPromptWidgetButtonPromptWidget = nullptr
 

Detailed Description

The AInteractableActorWithPrompt class represents an interactable actor with a prompt for interaction. It inherits from AInteractableActor class.

Constructor & Destructor Documentation

◆ AInteractableActorWithPrompt()

AInteractableActorWithPrompt::AInteractableActorWithPrompt ( )
explicit
9{
10 SceneRootComponent = CreateOptionalDefaultSubobject<USceneComponent>("Scene Root");
11 RootComponent = SceneRootComponent;
12
13 InteractionPromptComponent = CreateOptionalDefaultSubobject<UInteractionPromptComponent>("Interaction Prompt");
14 if(InteractionPromptComponent != nullptr)
15 {
16 InteractionPromptComponent->SetupAttachment(RootComponent);
17 }
18
19 InteractionPromptCollision = CreateDefaultSubobject<USphereComponent>("Interaction Collision");
20 InteractionPromptCollision->SetupAttachment(RootComponent);
21
22
23 InteractionPromptCollision->SetCollisionResponseToAllChannels(ECR_Ignore);
24 InteractionPromptCollision->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
25
26}
class USceneComponent * SceneRootComponent
Definition InteractableActorWithPrompt.h:35
class USphereComponent * InteractionPromptCollision
Definition InteractableActorWithPrompt.h:32
class UInteractionPromptComponent * InteractionPromptComponent
Definition InteractableActorWithPrompt.h:29

Member Function Documentation

◆ BeginPlay()

void AInteractableActorWithPrompt::BeginPlay ( )
overrideprotectedvirtual

Reimplemented from AInteractableActor.

Reimplemented in AWeaponAttachmentPickup, and AWeaponPickup.

29{
30 Super::BeginPlay();
31 // if(InteractionPromptComponent != nullptr)
32 // {
33 // InteractionPromptComponent->OnInteractionComplete.AddUniqueDynamic(this, &AInteractableActorWithPrompt::InteractionComplete);
34 // InteractionPromptComponent->SetHasProgressBar(bHasProgress);
35 // InteractionPromptComponent->SetCollapsed(true);
36 // //! Remove getting if has progress bar from widget, should be decided by actor ,
37 // }
38}

◆ HideButtonPrompt()

void AInteractableActorWithPrompt::HideButtonPrompt ( )
protected
161{
162 GetWorld()->GetTimerManager().ClearTimer(HidePromptTimerHandle);
163 if(InteractionPromptComponent == nullptr){return;}
164 InteractionPromptComponent->SetCollapsed(true);
165}
FTimerHandle HidePromptTimerHandle
Definition InteractableActorWithPrompt.h:69

◆ InteractionComplete()

void AInteractableActorWithPrompt::InteractionComplete ( )
protectedvirtual

Reimplemented in AWeaponAttachmentPickup, and AWeaponPickup.

154{
155 UE_LOG(LogTemp,Warning,TEXT("Interaction Complete"));
157 CurrentInteractCaller = nullptr;
158}
void OnInteractionComplete(AActor *Caller)
AActor * CurrentInteractCaller
Definition InteractableActorWithPrompt.h:60

◆ OnInteractionComplete()

void AInteractableActorWithPrompt::OnInteractionComplete ( AActor * Caller)
protected

Member Data Documentation

◆ bHasProgress

bool AInteractableActorWithPrompt::bHasProgress = true
protected

◆ ButtonPromptWidget

class UButtonPromptWidget* AInteractableActorWithPrompt::ButtonPromptWidget = nullptr
private

◆ CurrentInteractCaller

AActor* AInteractableActorWithPrompt::CurrentInteractCaller = nullptr
protected

◆ HidePromptTime

float AInteractableActorWithPrompt::HidePromptTime = 2.5f
protected

◆ HidePromptTimerHandle

FTimerHandle AInteractableActorWithPrompt::HidePromptTimerHandle
private

◆ InteractionPromptCollision

class USphereComponent* AInteractableActorWithPrompt::InteractionPromptCollision
protected

◆ InteractionPromptComponent

class UInteractionPromptComponent* AInteractableActorWithPrompt::InteractionPromptComponent
protected

◆ PromptHeight

float AInteractableActorWithPrompt::PromptHeight = 75.0f
protected

◆ SceneRootComponent

class USceneComponent* AInteractableActorWithPrompt::SceneRootComponent
protected

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