Space Plunder
Loading...
Searching...
No Matches
GameplayDebuggerExtension_Selector.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#if WITH_GAMEPLAY_DEBUGGER
6
7#include "CoreMinimal.h"
8#include "GameplayDebuggerExtension.h"
9
10// UENUM()
11enum EDebugActorSelector
12{
13 Player,
14 Pawn,
15 Actor
16};
17
21class FGameplayDebuggerExtension_Selector : public FGameplayDebuggerExtension
22{
23public:
24 FGameplayDebuggerExtension_Selector();
25
26 virtual void OnActivated() override;
27 virtual void OnDeactivated() override;
28 virtual FString GetDescription() const override;
29
30 static TSharedRef<FGameplayDebuggerExtension> MakeInstance();
31
32
33protected:
34
36 void TogglePlayerActors();
38 void CyclePawnActors();
40 void CycleDebugActors();
41
42 void SetActiveActor(const EDebugActorSelector ActiveActor);
43
44 int32 TogglePlayersBindingIdx;
45 int32 CyclePawnsBindingIdx;
46 int32 CycleActorsBindingIdx;
47
48 bool bDebugPlayerActive = false;
49 bool bDebugPawnActive = false;
50 bool bDebugActorActive = false;
51
52
53 mutable uint32 bIsCachedDescriptionValid : 1;
54 mutable FString CachedDescription;
55
56 AActor* PreviousDebugActor = nullptr;
57
59 void ToggleShowServerValues();
60 void SetShowServerValues(const bool bValue);
61
62 int32 ServerBindingIdx;
63
64
65private:
66
67 AActor* LineTraceForActor(const bool bOnlyPawns) const;
68 AActor* LineTraceForActor(const bool bOnlyPawns, FVector& HitLocation) const;
69
70 AActor* SphereTraceForActor(const bool bOnlyPawns, const FVector& HitLocation) const;
71
72 void SetPlayerAsDebugActor();
73 void SetPreviousActorAsDebugActor();
74
75
76};
77
78#endif