5#include "CoreMinimal.h"
6#include "Components/ActorComponent.h"
8#include "CommonActorComponent.generated.h"
16UCLASS(ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent), Abstract)
17class BASEHELPERS_API UCommonActorComponent :
public UActorComponent,
public ISaveLoad
22 UCommonActorComponent();
25 virtual
bool SaveGame() override;
26 virtual
bool LoadGame() override;
30 UPROPERTY(BlueprintAssignable)
31 FOnComponentSetupComplete ComponentSetupCompleteDelegate;
36 T* GetGameInstance()
const
38 static_assert(TPointerIsConvertibleFromTo<T, UGameInstance>::Value,
"'T' template parameter to GetGameInstance must be derived from UGameInstance");
39 AActor*
Owner = GetOwner();
40 return Owner ?
Owner->GetGameInstance<T>() : nullptr;
43 T* GetGameInstanceChecked()
const
45 static_assert(TPointerIsConvertibleFromTo<T, UGameInstance>::Value,
"'T' template parameter to GetGameInstance must be derived from UGameInstance");
46 const AActor*
Owner = GetOwner();
48 T* GameInstance =
Owner->GetGameInstance<T>();
54 class FTimerManager& GetWorldTimerManager()
const;
57 bool HasAuthority()
const;
60 void SetupComponent();
63 virtual void CharacterModeChanged(
const FGameplayTag& NewMode);
66#if WITH_GAMEPLAY_DEBUGGER
67 bool GetDebuggingMode()
const{
return bDebuggingMode;};
69 void SetDebuggingMode(
const bool bValue){bDebuggingMode = bValue;};
73 virtual void BeginPlay()
override;
75 virtual void AutoDetect();
76 UFUNCTION(
Server, Reliable)
77 virtual void Server_AutoDetect();
81 virtual
void ComponentActivated(UActorComponent* Component, const
bool bReset);
84 virtual
void ComponentDeactivated(UActorComponent* Component);
86 void SetComponentSetup();
87 UFUNCTION(
Server, Reliable)
88 void Server_SetComponentSetup();
90 void OnRep_ComponentSetup();
91 virtual
void ComponentSetupComplete();
94 void LogDebugError(const FString& Message) const;
95 void LogDebugError(const FString& Message, const int32 Value) const;
96 void LogDebugError(const FString& Message, const
float Value) const;
97 void LogDebugWarning(const FString& Message) const;
98 void LogDebugWarning(const FString& Message, const int32 Value) const;
99 void LogDebugWarning(const FString& Message, const
float Value) const;
101 void LogDebugMessage(const FString& Message, const
bool bWarning = false, const
bool bError = false) const;
102 void LogDebugMessage(const FString& Message, const int32 Value, const
bool bWarning = false, const
bool bError = false) const;
103 void LogDebugMessage(const FString& Message, const
float Value, const
bool bWarning = false, const
bool bError = false) const;
104 void LogDebugMessage(const FString& Message, const
bool bValue, const
bool bWarning, const
bool bError) const;
105 void LogOnScreenMessage(const int32 Key, const FString& Message, FColor Color = FColor::Green) const;
107 void SetCategoryName(const FLogCategoryBase& Category){
CategoryName = Category.GetCategoryName();};
109 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Common|Debugging")
110 bool bDebuggingMode = false;
111 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Common|Debugging")
112 bool bCheatsEnabled = false;
114 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Common|Setup")
115 bool bAutoDetect = false;
116 UPROPERTY(ReplicatedUsing=OnRep_ComponentSetup, VisibleAnywhere, BlueprintReadOnly, Category = "Common|Setup")
117 bool bComponentSetup = false;
121 FLogCategoryName CategoryName = LogCommonActorComp.GetCategoryName();
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnComponentSetupComplete)
DECLARE_LOG_CATEGORY_CLASS(LogCommonActorComp, Display, All)