#include <WaypointWidget.h>
◆ ActorConstruct()
| void UWaypointWidget::ActorConstruct |
( |
| ) |
|
|
virtual |
◆ GetDistance()
| float UWaypointWidget::GetDistance |
( |
const bool | bMeters = true | ) |
const |
65{
66 if(GetOwningPlayer() == nullptr || GetOwningPlayer()->GetPawn() == nullptr)
67 {
68 if(
bDebuggingMode){UE_LOG(LogBaseHelpers,
Error, TEXT(
"Error getting Pawn for Distance, Waypoint Widget"));}
69 return -999.0f;
70 }
71
72 if(GetOwningPlayer()->GetPawn() !=
nullptr &&
WaypointActor !=
nullptr)
73 {
74 const float Distance = UKismetMathLibrary::Vector_Distance(GetOwningPlayer()->GetPawn()->GetActorLocation(),
WaypointActor->GetActorLocation());
75 if(bMeters)
76 {
77 if(Distance == 0.0f)
78 {
79 return 0.0f;
80 }
81 return (Distance / 100.0f);
82 }
83 return Distance;
84 }
86 return 0.0f;
87}
◆ Initialize()
| bool UWaypointWidget::Initialize |
( |
| ) |
|
|
overrideprotectedvirtual |
11{
12 const bool Success = Super::Initialize();
17
18 return true;
19}
◆ NativeConstruct()
| void UWaypointWidget::NativeConstruct |
( |
| ) |
|
|
overrideprotectedvirtual |
22{
23 Super::NativeConstruct();
24 SetVisibility(ESlateVisibility::Hidden);
26 {
28 }
29 else
30 {
32 }
33}
◆ NativePreConstruct()
| void UWaypointWidget::NativePreConstruct |
( |
| ) |
|
|
overrideprotectedvirtual |
36{
37 Super::NativePreConstruct();
38}
◆ SetDistanceText()
| void UWaypointWidget::SetDistanceText |
( |
| ) |
const |
|
protected |
50{
52 {
54 }
55 else
56 {
58 }
59 const FText DistanceText = FText::Format(NSLOCTEXT("YourNamespace","DistanceFormat" , "{0} m"),
62}
◆ SetWaypointActor()
| void UWaypointWidget::SetWaypointActor |
( |
AActor * | Actor | ) |
|
|
inline |
◆ bDebuggingMode
| bool UWaypointWidget::bDebuggingMode = false |
|
protected |
◆ bUseDistance
| bool UWaypointWidget::bUseDistance = true |
|
protected |
◆ ContextTextBlock
| class UTextBlock* UWaypointWidget::ContextTextBlock |
|
protected |
◆ DistanceTextBlock
| class UTextBlock* UWaypointWidget::DistanceTextBlock |
|
protected |
◆ DistanceTimerHandle
| FTimerHandle UWaypointWidget::DistanceTimerHandle |
|
private |
The player who made this waypoint
◆ DistanceUpdateSpeed
| float UWaypointWidget::DistanceUpdateSpeed = 0.5f |
|
protected |
◆ HideDistance
| float UWaypointWidget::HideDistance = 10.0f |
|
protected |
Once this close, the Distance text will hide
◆ NumberFormatOptions
| FNumberFormattingOptions UWaypointWidget::NumberFormatOptions |
|
private |
◆ WaypointActor
| AActor* UWaypointWidget::WaypointActor |
|
protected |
This is the Actor in 3D space of the Waypoint
◆ WaypointIcon
| class UImage* UWaypointWidget::WaypointIcon |
|
protected |
The documentation for this class was generated from the following files:
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/BaseHelpers/Source/BaseHelpers/Public/Widgets/WaypointWidget.h
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/BaseHelpers/Source/BaseHelpers/Private/Widgets/WaypointWidget.cpp