#include <InteractionPingWidget.h>
◆ ActorConstruct()
| void UInteractionPingWidget::ActorConstruct |
( |
| ) |
|
◆ GetDistance()
| float UInteractionPingWidget::GetDistance |
( |
const bool | bMeters = true | ) |
const |
69{
71 {
72 const float Distance = UKismetMathLibrary::Vector_Distance(
OwnerActor->GetActorLocation(),
PingActor->GetActorLocation());
73 if(bMeters)
74 {
75 if(Distance == 0.0f)
76 {
77 return 0.0f;
78 }
79 return (Distance / 100.0f);
80 }
81 return Distance;
82 }
83 UE_LOG(LogTemp,
Warning, TEXT(
"Get Distance Failed"));
84 return 0.0f;
85}
◆ GetOwnerActor()
| void UInteractionPingWidget::GetOwnerActor |
( |
| ) |
|
|
private |
88{
90 if(GetOwningPlayer() != nullptr && GetOwningPlayer()->GetPawn() != nullptr)
91 {
93 }
94}
◆ Initialize()
| bool UInteractionPingWidget::Initialize |
( |
| ) |
|
|
overridevirtual |
10{
11 const bool Success = Super::Initialize();
14 if (!ensure(
PingIcon !=
nullptr))
return false;
16
17 return true;
18}
◆ NativeConstruct()
| void UInteractionPingWidget::NativeConstruct |
( |
| ) |
|
|
overridevirtual |
21{
22 Super::NativeConstruct();
23}
◆ NativeDestruct()
| void UInteractionPingWidget::NativeDestruct |
( |
| ) |
|
|
overridevirtual |
35{
36 if(GetWorld() != nullptr)
37 {
39 }
40 Super::NativeDestruct();
41}
◆ OnReceivePingData()
| void UInteractionPingWidget::OnReceivePingData |
( |
const FPingData & | Ping, |
|
|
const AActor * | Sender ) |
◆ SetDistanceText()
| void UInteractionPingWidget::SetDistanceText |
( |
| ) |
|
54{
56 {
57 if(GetWorld() != nullptr)
58 {
60 }
61 return;
62 }
63 const FText DistanceText = FText::Format(NSLOCTEXT("YourNamespace","DistanceFormat" , "{0} m"),
66}
◆ SetPingActor()
| void UInteractionPingWidget::SetPingActor |
( |
AActor * | Actor | ) |
|
|
inline |
◆ SetPingData()
| void UInteractionPingWidget::SetPingData |
( |
const FPingData & | Ping, |
|
|
AActor * | Sender ) |
◆ bUseDistance
| bool UInteractionPingWidget::bUseDistance = true |
|
protected |
◆ ContextTextBlock
| class UTextBlock* UInteractionPingWidget::ContextTextBlock |
|
protected |
◆ DistanceTextBlock
| class UTextBlock* UInteractionPingWidget::DistanceTextBlock |
|
protected |
◆ DistanceTimerHandle
| FTimerHandle UInteractionPingWidget::DistanceTimerHandle |
|
private |
◆ DistanceUpdateSpeed
| float UInteractionPingWidget::DistanceUpdateSpeed = 0.5f |
|
protected |
◆ NumberFormatOptions
| FNumberFormattingOptions UInteractionPingWidget::NumberFormatOptions |
|
private |
◆ OwnerActor
| AActor* UInteractionPingWidget::OwnerActor |
|
protected |
◆ PingActor
| AActor* UInteractionPingWidget::PingActor |
|
protected |
◆ PingIcon
| class UImage* UInteractionPingWidget::PingIcon |
|
protected |
The documentation for this class was generated from the following files:
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/Interaction/Source/Interaction/Public/Widgets/InteractionPingWidget.h
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/Interaction/Source/Interaction/Private/Widgets/InteractionPingWidget.cpp