Space Plunder
Loading...
Searching...
No Matches
GameplayDebuggerCategory_Weapons.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
5
6#if WITH_GAMEPLAY_DEBUGGER
7
8#include "CoreMinimal.h"
9#include "GameplayDebuggerCategory.h"
10
11class AActor;
12class APlayerController;
13
20class FGameplayDebuggerCategory_Weapons : public FGameplayDebuggerCategory
21{
22
23public:
24 FGameplayDebuggerCategory_Weapons();
25
26 virtual void CollectData(APlayerController* OwnerPC, AActor* DebugActor) override;
27 virtual void DrawData(APlayerController* OwnerPC, FGameplayDebuggerCanvasContext& CanvasContext) override;
28
29 static TSharedRef<FGameplayDebuggerCategory> MakeInstance();
30
31
32 struct FDebugWeaponData
33 {
34 FString WeaponID;
35 FString WeaponName;
36 FString FireMode;
37 float TriggerSpamTimeRemaining = 0.0f;
38 bool bShouldAutoReload = false;
39
40 int32 CurrentAmmo = 0;
41 int32 TotalAmmoCount = 0;
42 TArray<FString> CurrentWeaponAttachments;
43
44 FDebugWeaponData()
45 {
46
47 }
48 explicit FDebugWeaponData(const struct FWeaponData_T& WeaponData);
49 friend FArchive& operator<<(FArchive& Ar, FDebugWeaponData& WeaponData);
50 };
51
52protected:
53
54 virtual void CollectWeaponData(AActor* SelectedActor);
55 virtual void CollectServerWeaponData(APlayerController* OwnerPC);
56
57 void PrintWeaponData(FGameplayDebuggerCanvasContext& CanvasContext, const FDebugWeaponData& WeaponData);
58 void PrintWeaponData(FGameplayDebuggerCanvasContext& CanvasContext, const FDebugWeaponData& WeaponData, const FDebugWeaponData& ServerWeaponData);
59 void PrintWeaponInventory(FGameplayDebuggerCanvasContext& CanvasContext);
60
61 FWeaponStats_T GetWeaponStats() const;
62
63 FString CurrentWeaponID = "";
64 FWeaponStats_T CurrentWeaponStats;
65
66 // void DrawWeaponDistance(FGameplayDebuggerCanvasContext& CanvasContext);
67
68
69 void ToggleShowWeaponState();
70 void ToggleShowWeaponInventory();
71 // void PrintBoolValue(FGameplayDebuggerCanvasContext& CanvasContext, const FString& Name, const bool bValue, const bool bServerValue);
72
73
74 struct FRepData
75 {
76 FString WeaponName;
77 bool bHasGun;
78 bool bIsReloading;
79 bool bFiringWeapon;
80 bool bIsHolstered;
81 bool bIsAiming;
82 bool bIsCrouching;
83 float Accuracy;
84 float Recoil;
85 int32 InventoryNum;
86 bool bTriggerMustWait;
87 // float ;
88
89 TArray<FDebugWeaponData> Weapons;
90 FDebugWeaponData CurrentWeapon;
91
92 FString FireMode = "N/A";
93
94 bool bCanChangeReference = false;
95 bool bIsUsingPlayerActor = false;
96
97 bool bUnlimitedAmmo = false;
98 bool bShowWeaponTrace = false;
99 bool bBottomlessClip = false;
100
101 void Serialize(FArchive& Ar);
102 };
103 FRepData DataPack;
104 FRepData ServerDataPack;
105
106 bool bDebugActorHasController = false;
107 bool bShowServerValues = false;
108
109};
110
111
112#endif
Struct representing data of a weapon that changes.
Definition WeaponStructs.h:861
Represents statistics for a weapon.
Definition WeaponStructs.h:622