#include <ReplaySpectatorController.h>
◆ AReplaySpectatorController()
| AReplaySpectatorController::AReplaySpectatorController |
( |
const FObjectInitializer & | ObjectInitializer | ) |
|
13 : APlayerController(ObjectInitializer)
14{
15 bShowMouseCursor = true;
16 PrimaryActorTick.bTickEvenWhenPaused = true;
17 bShouldPerformFullTickWhenPaused = true;
19
20 const ConstructorHelpers::FClassFinder<UReplayViewer> ReplayViewerWidgetBP(TEXT("/MenuSystem/Widgets/Replays/WBP_ReplayViewer"));
21 if (!ensure(ReplayViewerWidgetBP.Class != nullptr)) return;
23
24}
class UReplayViewer * ReplayViewerWidget
Definition ReplaySpectatorController.h:31
TSubclassOf< class UReplayViewer > ReplayViewerWidgetClass
Definition ReplaySpectatorController.h:34
◆ BeginPlay()
| void AReplaySpectatorController::BeginPlay |
( |
| ) |
|
|
overrideprotectedvirtual |
27{
28 Super::BeginPlay();
29
30 if(IsLocalController())
31 {
33 if(
ReplayViewerWidget ==
nullptr){UE_LOG(LogMenuSystem,
Error, TEXT(
"Replay Viewer Failed to Create in Replay Spectator"));}
35 {
38 }
39 }
40}
void SetReplayController(AReplaySpectatorController *Controller)
Definition ReplayViewer.h:59
◆ GetCurrentReplayCurrentTimeInSeconds()
| int32 AReplaySpectatorController::GetCurrentReplayCurrentTimeInSeconds |
( |
| ) |
const |
** Gets the Second we are currently watching in the Replay */
107{
108 if(GetWorld() != nullptr && GetWorld()->GetDemoNetDriver() != nullptr)
109 {
110 return GetWorld()->GetDemoNetDriver()->GetDemoCurrentTime();
111 }
112 return 0;
113}
◆ GetCurrentReplayTotalTimeInSeconds()
| int32 AReplaySpectatorController::GetCurrentReplayTotalTimeInSeconds |
( |
| ) |
const |
** Gets the Max Number of Seconds that were recorded in the current Replay */
98{
99 if(GetWorld() != nullptr && GetWorld()->GetDemoNetDriver() != nullptr)
100 {
101 return GetWorld()->GetDemoNetDriver()->GetDemoTotalTime();
102 }
103 return 0;
104}
◆ OpenReplayMenu()
| void AReplaySpectatorController::OpenReplayMenu |
( |
| ) |
|
141{
142 if(GetGameInstance() != nullptr)
143 {
145 if(ReplayClipInterface != nullptr)
146 {
148 }
149 }
150}
bool bReplayMenuOpen
Definition ReplaySpectatorController.h:71
Definition ReplayClipInterface.h:20
virtual bool OpenReplayMenu(APlayerController *Player, const bool bOpen=true)=0
◆ RestartReplay()
| void AReplaySpectatorController::RestartReplay |
( |
| ) |
|
81{
82 if(GetWorld() != nullptr && GetWorld()->GetDemoNetDriver() != nullptr)
83 {
84 GetWorld()->GetDemoNetDriver()->GotoTimeInSeconds(0);
85 }
86}
◆ RewindReplay()
| void AReplaySpectatorController::RewindReplay |
( |
| ) |
|
89{
90 if(GetWorld() != nullptr && GetWorld()->GetWorldSettings() != nullptr)
91 {
92 GetWorld()->GetWorldSettings()->RewindForReplay();
93
94 }
95}
◆ SetCurrentReplayPausedState()
| bool AReplaySpectatorController::SetCurrentReplayPausedState |
( |
const bool | bPause | ) |
|
43{
44 AWorldSettings* WorldSettings = GetWorldSettings();
45 if (!WorldSettings)
46 {
47 UE_LOG(LogMenuSystem,
Error, TEXT(
"World Setting Invalid"));
48
49 return false;
50 }
51
52
53
54
55
56
57
58
59
60 if(bPause)
61 {
62
63
64
65
66
67
68
69 WorldSettings->SetPauserPlayerState(PlayerState);
70 return true;
71 }
72
73
74
75
76 WorldSettings->SetPauserPlayerState(nullptr);
77 return false;
78}
◆ SetCurrentReplayPlayRate()
| void AReplaySpectatorController::SetCurrentReplayPlayRate |
( |
const float | PlayRate = 1.f | ) |
const |
** Changes the PlayRate of the Replay we are watching, enabling FastForward or SlowMotion */
124{
125 if(GetWorld() != nullptr && GetWorld()->GetWorldSettings() != nullptr)
126 {
127 GetWorld()->GetWorldSettings()->DemoPlayTimeDilation = PlayRate;
128 }
129
130}
◆ SetCurrentReplayTimeToSeconds()
| void AReplaySpectatorController::SetCurrentReplayTimeToSeconds |
( |
const int32 | Seconds | ) |
const |
** Jumps to the specified Second in the Replay we are watching */
116{
117 if(GetWorld() != nullptr && GetWorld()->GetDemoNetDriver() != nullptr)
118 {
119 GetWorld()->GetDemoNetDriver()->GotoTimeInSeconds(Seconds);
120 }
121}
◆ SetReplayCheckpoint()
| void AReplaySpectatorController::SetReplayCheckpoint |
( |
| ) |
const |
133{
134 if(GetWorld() != nullptr && GetWorld()->GetDemoNetDriver() != nullptr)
135 {
136 GetWorld()->GetDemoNetDriver()->RequestCheckpoint();
137 }
138}
◆ bReplayMenuOpen
| bool AReplaySpectatorController::bReplayMenuOpen = false |
|
private |
◆ PreviousAASetting
| int32 AReplaySpectatorController::PreviousAASetting = 0 |
|
protected |
◆ PreviousMBSetting
| int32 AReplaySpectatorController::PreviousMBSetting = 0 |
|
protected |
◆ ReplayViewerWidget
| class UReplayViewer* AReplaySpectatorController::ReplayViewerWidget |
|
protected |
◆ ReplayViewerWidgetClass
| TSubclassOf<class UReplayViewer> AReplaySpectatorController::ReplayViewerWidgetClass |
|
protected |
The documentation for this class was generated from the following files:
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/MenuSystem/Source/MenuSystem/Public/Character/ReplaySpectatorController.h
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/MenuSystem/Source/MenuSystem/Private/Character/ReplaySpectatorController.cpp