Space Plunder
Loading...
Searching...
No Matches
BaseHelpersBPLib.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#include "CoreMinimal.h"
6#include "GameplayTagContainer.h"
7#include "Data/BaseData.h"
8#include "Kismet/BlueprintFunctionLibrary.h"
9#include "Kismet/KismetSystemLibrary.h"
10#include "Logging/LogCategory.h"
11#include "BaseHelpersBPLib.generated.h"
12
13class UInputAction;
14
15UCLASS()
16class BASEHELPERS_API UBaseHelpersBPLib : public UBlueprintFunctionLibrary
17{
18 GENERATED_BODY()
19
20public:
22 static UWorld* FindPlayInEditorAuthorityWorld();
23 static APlayerController* FindPlayInEditorAuthorityPlayerController(const APlayerController* ClientController);
24
25 UFUNCTION(BlueprintCallable, Category = "Base Helpers", meta=(WorldContext="WorldContextObject"))
26 static void PrintToLog(const UObject* WorldContextObject, const FString& Message, const bool bWarning = false, const bool bError = false);
27 static void PrintToLogWithCategory(const UObject* WorldContextObject, const FLogCategoryBase& Category, const FString& Message, const bool bWarning = false, const bool bError = false);
28
29 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
30 static FCharacterBaseSkills RandomCharacterSkills(const int32 Min, const int32 Max);
31
32 static int32 GetPlayerTeamID(AController* Controller);
33 static int32 GetPlayerTeamID(APlayerState* PlayerState);
34 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
35 static int32 GetPlayerTeamIDFromController(AController* Controller);
36 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
37 static int32 GetPlayerTeamIDFromState(APlayerState* PlayerState);
38
40 static UClass* GetDefaultBPClass(const FString& Location);
41 static TSubclassOf<AActor> GetDefaultActorBPClass(const FString& Location);
42 static TSubclassOf<UUserWidget> GetDefaultWidgetBPClass(const FString& Location);
43 static UDataTable* GetDefaultDataTable(const FString& Location);
44
45 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
46 static void PrintVirtualBoneInfo(USkeletalMeshComponent* SkeletalMeshComponent);
47
48 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
49 static void ToggleWidgetVisibility(UUserWidget* Widget, const bool bForceSetVisible = false,const bool bForceSetCollapsed = false);
50
51 //@TODO Widget to focus
52 //- Widget To focus not currently working..
53 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
54 static void ToggleInputMode(APlayerController* InController, const bool bForceGameOnly = false, const bool bForceUI = false, class UUserWidget* WidgetToFocus = nullptr);
55
56 //@TODO Using Controller, Keyboard, Mouse, etc
57 // UFUNCTION(BlueprintPure, Category = "Base Helpers")
58 // static void GetPlayerInputType(APlayerController* InController);
59
60 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
61 static ESoundSource SoundSourceFromName(const FName& SoundName);
62 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
63 static FName SoundNameFromSource(const ESoundSource SoundSource);
64
66 UFUNCTION(BlueprintCallable, Category="Base Helpers|Gameplay Tags")
67 static FString GetGameplayTagName(const FGameplayTag& GameplayTag);
68
69 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
70 static FString DescribeColorHelper(const FColor& Color)
71 {
72 const int32 MaxColors = GColorList.GetColorsNum();
73 for (int32 Idx = 0; Idx < MaxColors; Idx++)
74 {
75 if (Color == GColorList.GetFColorByIndex(Idx))
76 {
77 return GColorList.GetColorNameByIndex(Idx);
78 }
79 }
80
81 return FString(TEXT("color"));
82 }
83
84 UFUNCTION(BlueprintCallable, Category = "Character")
85 static TArray<FGameplayTag> GetAllTagsOfCategory(const FName& Category);
86
87 // UFUNCTION(BlueprintPure, BlueprintCallable, Category = "Base Helpers", meta=(WorldContext="WorldContextObject"))
88 // static FString GetAssignedKeyName(const UObject* WorldContextObject, const UInputAction* InputAction, const int32 Num = 0);
89
90 UFUNCTION(BlueprintPure, BlueprintCallable, Category = "Base Helpers")
91 static FString GetEnumValue(const FString& BaseString);
92
94 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
95 static bool GetInteraction(FInteractionType& InteractionType, const FInteractionData& InteractionData, const int32 Value);
96 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
97 static bool GetInteractionFromType(FInteractionType& InteractionType, const FInteractionData& InteractionData, const EInteractionType Interaction);
98
99 UFUNCTION(BlueprintCallable, Category = "Base Helpers", meta=(WorldContext="WorldContextObject", AutoCreateRefTerm="ActorsToIgnore"))
100 static bool LineTraceByChannel(const UObject* WorldContextObject, FHitResult& Hit, const FVector& Start, const FVector& End,
101 const ETraceTypeQuery TraceChannel, const TArray<AActor*>& ActorsToIgnore, const bool bIgnoreSelf, const bool bReturnPhysicalMaterial = false, const bool bTraceComplex = false, const bool bDebug = false,
102 const FLinearColor TraceColor = FLinearColor::Red, const float DrawTime = 2.0f);
103
104 //- Gets Trace Start based on Camera Manager Location //
105 UFUNCTION(BlueprintPure, Category = "Character")
106 static FVector GetTraceStartLocation(const APlayerController* InController);
107 //- Gets Trace Rotation based on Camera Manager Rotation //
108 UFUNCTION(BlueprintPure, Category = "Character")
109 static FRotator GetTraceStartRotation(const APlayerController* InController);
110 //- Gets Trace Start based on NPC Eyes Location //
111 UFUNCTION(BlueprintPure, Category = "Character")
112 static FVector GetTraceStartEyeLocation(const APawn* Pawn);
113 //- Gets Trace Rotation based on NPC Eyes Rotation //
114 UFUNCTION(BlueprintPure, Category = "Character")
115 static FRotator GetTraceStartEyeRotation(const APawn* Pawn);
116
117 UFUNCTION(BlueprintPure, Category = "Math")
118 static float CalculateRatio(const int32 Kills, const int32 Deaths);
119
120
121 //- Gets Trace end based on Camera Manager //
122 UFUNCTION(BlueprintPure, Category = "Character")
123 static FVector GetTraceEndLocation(const APlayerController* InController, const float InLength);
124
125 UFUNCTION(BlueprintPure, Category = "Character")
126 static FHitResult SimpleLineTrace(const APlayerController* InController, const float InLength, const bool bDebug);
127
128 // UFUNCTION(BlueprintPure, Category = "Character")
129 // static bool GetIsWidgetVisible(class UUserWidget* Widget);
130 // UFUNCTION(BlueprintPure, Category = "Character")
131 // static bool GetIsWidgetVisibleByVisibility(ESlateVisibility Visibility);
132
140 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
141 static UTexture2D* TextureFromWidget(UUserWidget*const Widget, const FVector2D &DrawSize);
142
143
144 //- Damage Types //
145 UFUNCTION(BlueprintPure, Category = "Damage Types")
146 static EDamageType DamageTypeToEnum(const UDamageType* DamageType);
147 UFUNCTION(BlueprintPure, Category = "Damage Types")
148 static bool IsDamageTypeNonLethal(const UDamageType* DamageType);
149
150 UFUNCTION(BlueprintPure, Category = "Debug")
151 static EDrawDebugTrace::Type GetDrawDebugType(const bool bDebuggingMode);
152
153
154};
155
EInteractionType
Definition BaseData.h:149
ESoundSource
Definition BaseData.h:73
EDamageType
Definition BaseData.h:33
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition Interaction.Build.cs:6
Definition BaseHelpersBPLib.h:17
Definition BaseData.h:815
Definition BaseData.h:420
Definition BaseData.h:333