Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Category Specifiers and 5.4 related includes #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "Core/OUUDataTableLibrary.h"

#include "Blueprint/BlueprintExceptionInfo.h"

bool UOUUDataTableLibrary::AddRowToDataTable(UDataTable* DataTable, FName RowName, FTableRowBase RowStruct)
{
// We must never hit this! The real implementation is in Generic_AddRowToDataTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class UOUUCoreBlueprintLibrary : public UBlueprintFunctionLibrary
/** @returns the mutable class default object of the specified class. Proceed with caution! */
UFUNCTION(BlueprintPure, Category = "Open Unreal Utilities|Class", Meta = (DeterminesOutputType = Class))
static UObject* GetClassDefaultObject(TSubclassOf<UObject> Class);

/** @returns the mutable class default object of the objects class. Proceed with caution! */
UFUNCTION(BlueprintPure, Category = "Open Unreal Utilities|Class")
static UObject* GetClassDefaultObjectFromObject(const UObject* Object);
Expand Down Expand Up @@ -50,7 +50,7 @@ class UOUUCoreBlueprintLibrary : public UBlueprintFunctionLibrary
* If we are currently recording into the transaction buffer (undo/redo),
* save a copy of this object into the buffer and mark the package as needing to be saved.
*/
UFUNCTION(BlueprintCallable)
UFUNCTION(BlueprintCallable,Category="OUU|Utilities|Core")
static void ModifyObject(UObject* Object);

/** Converts a TopLevelAssetPath to a string */
Expand Down
16 changes: 6 additions & 10 deletions Source/OUUDeveloper/Public/OUUMapsToCookSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ struct OUUDEVELOPER_API FOUUMapsToCookList
GENERATED_BODY()
public:
// Name of the config section that these properties reside in
UPROPERTY(Transient, VisibleAnywhere)
UPROPERTY(Transient, VisibleAnywhere,Category="OUU|Maps|Settings")
FString OwningConfigSection;

UPROPERTY(EditAnywhere, meta = (RelativeToGameContentDir, LongPackageName))
UPROPERTY(EditAnywhere,Category="OUU|Maps|Settings", meta = (RelativeToGameContentDir, LongPackageName))
TArray<FFilePath> MapsToCook;

void ReloadConfig(const FString& ConfigPath);
Expand All @@ -39,25 +39,21 @@ class OUUDEVELOPER_API UOUUMapsToCookSettings : public UDeveloperSettings

// Request the package on default cooks.
// Not used if commandline, AlwaysCookMaps, or MapsToCook are present.
UPROPERTY(Transient, EditAnywhere, meta = (EditCondition = bEnableAllMaps))
UPROPERTY(Transient, EditAnywhere, meta = (EditCondition = bEnableAllMaps),Category="OUU|Maps|Settings")
FOUUMapsToCookList AllMaps;

// Request the package on every cook.
// Using this prevents AllMaps.
UPROPERTY(Transient, EditAnywhere)
UPROPERTY(Transient, EditAnywhere,Category="OUU|Maps|Settings")
FOUUMapsToCookList AlwaysCookMaps;

// Names of all custom config sections that contain map lists.
UPROPERTY(Config, EditAnywhere, meta = (EditFixedOrder), DisplayName = "Custom Config Sections")
UPROPERTY(Config, EditAnywhere,Category="OUU|Maps|Settings", meta = (EditFixedOrder), DisplayName = "Custom Config Sections")
TArray<FString> ConfigSections;

// Map lists from ConfigSections that can be referenced used -MAPINISECTION parameter in command-line cooks
UPROPERTY(
Transient,
EditAnywhere,
EditFixedSize,
meta = (EditFixedOrder),
DisplayName = "Custom Config Sections Map Lists")
Transient,Category="OUU|Maps|Settings",EditAnywhere,EditFixedSize,meta = (EditFixedOrder),DisplayName = "Custom Config Sections Map Lists")
TArray<FOUUMapsToCookList> MapLists;

// - UObject
Expand Down
3 changes: 2 additions & 1 deletion Source/OUUEditor/Private/OUUEditorModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "Modules/ModuleManager.h"
#include "OUUContentBrowserExtensions.h"
#include "PropertyEditorUtils.h"
#include "OUUEditor/Public/PropertyEditorUtils.h"

namespace OUU::Editor
{
Expand Down Expand Up @@ -43,7 +44,7 @@ namespace OUU::Editor
FTypedGameplayTagContainer_PropertyTypeCustomization>();
}

void ShutdownModule() override
void ShutdownModule()
{
if (OnUtilityWidgetsLoadedHandle.IsValid())
{
Expand Down
26 changes: 13 additions & 13 deletions Source/OUUEditor/Public/GameplayTagValidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ struct FGameplayTagValidationSettingsEntry
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere)
UPROPERTY(EditAnywhere,Category="OUU|Validation")
bool bCanHaveContentChildren = true;

UPROPERTY(EditAnywhere)
UPROPERTY(EditAnywhere,Category="OUU|Validation")
int32 AllowedChildDepth = 1;
};

Expand All @@ -33,36 +33,36 @@ class UGameplayTagValidationSettings : public UDeveloperSettings
public:
// Maximum nesting depth of tags including the root tags.
// e.g. 'Foo' has a nesting level of 1, 'Foo.Bar' has 2, 'Foo.Bar.Baz' has 3, etc.
UPROPERTY(Config, EditAnywhere, meta = (UIMin = 1, UIMax = 20))
UPROPERTY(Config, EditAnywhere, Category="OUU|Gameplay Tag", meta = (UIMin = 1, UIMax = 20))
int32 MaxGlobalTagDepth = 10;

// Default depth allowed for native tags that are marked as "allow child tags" from C++ code.
// You can always create tag overrides that supercede this setting for individual tags.
UPROPERTY(Config, EditAnywhere)
UPROPERTY(Config, EditAnywhere, Category="OUU|Gameplay Tag")
int32 NativeTagAllowedChildDepth = 3;

UPROPERTY(Config, EditAnywhere)
UPROPERTY(Config, EditAnywhere, Category="OUU|Gameplay Tag")
bool bAllowContentRootTags = false;

// If true, allow content tags as children anywhere they are not explicitly prohibited via TagOverrides.
UPROPERTY(Config, EditAnywhere)
UPROPERTY(Config, EditAnywhere, Category="OUU|Gameplay Tag")
bool bDefaultAllowContentTagChildren = false;

// If true, run gameplay tag validation after every change of the gameplay tags tree.
// This means both after editor start and every edit of the tags list.
UPROPERTY(Config, EditAnywhere)
UPROPERTY(Config, EditAnywhere, Category="OUU|Gameplay Tag")
bool bValidateTagsAfterTagTreeChange = true;

UPROPERTY(Config, EditAnywhere)
UPROPERTY(Config, EditAnywhere, Category="OUU|Gameplay Tag")
bool bValidateTagsDuringCook = true;

// If true, run gameplay tag validation after every change of settings in this settings class.
UPROPERTY(Config, EditAnywhere)
UPROPERTY(Config, EditAnywhere, Category="OUU|Gameplay Tag")
bool bValidateTagsAfterSettingsChange = true;

// Issues underneath these gameplay tags will always only cause warnings instead of errors.
// Only affects issues from UOUUGameplayTagValidator. Other validator classes may ignore this setting.
UPROPERTY(Config, EditAnywhere)
UPROPERTY(Config, EditAnywhere, Category="OUU|Gameplay Tag")
FGameplayTagContainer WarnOnlyGameplayTags;

void RefreshNativeTagOverrides();
Expand All @@ -79,11 +79,11 @@ class UGameplayTagValidationSettings : public UDeveloperSettings
// --

private:
UPROPERTY(Config, EditAnywhere, meta = (ForceInlineRow))
UPROPERTY(Config, EditAnywhere, meta = (ForceInlineRow), Category="OUU|Gameplay Tag")
TMap<FGameplayTag, FGameplayTagValidationSettingsEntry> TagOverrides;

// Settings declared in code from literal gameplay tags
UPROPERTY(VisibleAnywhere, meta = (ForceInlineRow))
UPROPERTY(VisibleAnywhere, meta = (ForceInlineRow), Category="OUU|Gameplay Tag")
TMap<FGameplayTag, FGameplayTagValidationSettingsEntry> NativeTagOverrides;
};

Expand All @@ -110,7 +110,7 @@ class OUUEDITOR_API UGameplayTagValidatorSubsystem : public UEditorSubsystem
public:
static UGameplayTagValidatorSubsystem& Get();

UFUNCTION(BlueprintCallable)
UFUNCTION(BlueprintCallable, Category="OUU|Gameplay Tag")
void ValidateGameplayTagTree();

// - UEngineSubsystem
Expand Down
6 changes: 3 additions & 3 deletions Source/OUUEditor/Public/OUUEditorLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ struct FOUUBlueprintEditorFocusContent
GENERATED_BODY()
public:
/* Tab on which to focus (e.g. 'My Blueprint' tab). */
UPROPERTY(EditAnywhere, BlueprintReadWrite)
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="OUU|Editor")
FString TabToFocusOrOpen;

/* The GUID of a blueprint node */
UPROPERTY(EditAnywhere, BlueprintReadWrite)
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="OUU|Editor")
FString NodeGUID;

/* Name of the outer object - should be the blueprint that 'owns' the node */
UPROPERTY(EditAnywhere, BlueprintReadWrite)
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="OUU|Editor")
FString ObjectName;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "Animation/AnimNodeBase.h"
#include "Animation/AnimNotifies/AnimNotifyState.h"
#include "Animation/AnimSequence.h"
#include "Animation/AnimTypes.h"
//#include "Animation/AnimTypes.h"
#include "Animation/Debug/DebuggableAnimInstance.h"
#include "Components/SkeletalMeshComponent.h"
#include "DisplayDebugHelpers.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Copyright (c) 2023 Jonas Reich & Contributors

#include "GameplayDebugger/GameplayDebuggerCategory_ViewModes.h"
#include "Engine.h"

#if WITH_GAMEPLAY_DEBUGGER
#include "BufferVisualizationData.h"
#include "Engine/DebugCameraControllerSettings.h"
#include "Engine/Font.h"
#include "Engine/GameViewportClient.h"
#include "GameFramework/PlayerController.h"
#include "LogOpenUnrealUtilities.h"
#include "BufferVisualizationData.h"
#include "Engine/DebugCameraControllerSettings.h"
#include "Engine/Font.h"
#include "Engine/GameViewportClient.h"
#include "GameFramework/PlayerController.h"
#include "LogOpenUnrealUtilities.h"

namespace OUU::Runtime::Private
{
Expand Down Expand Up @@ -52,7 +53,7 @@ namespace OUU::Runtime::Private
case VMI_VisualizeSubstrate: return TEXT("VisualizeSubstrate");
case VMI_VisualizeGroom: return TEXT("VisualizeGroom");
case VMI_Max: return TEXT("Max");
default:;
default: ;
}
return TEXT("");
}
Expand All @@ -70,7 +71,6 @@ namespace OUU::Runtime::Private

return TEXT("");
}

} // namespace OUU::Runtime::Private

FGameplayDebuggerCategory_ViewModes::FGameplayDebuggerCategory_ViewModes()
Expand Down Expand Up @@ -113,7 +113,10 @@ void FGameplayDebuggerCategory_ViewModes::DrawData(
FGameplayDebuggerCanvasContext& CanvasContext)
{
CanvasContext.FontRenderInfo.bEnableShadow = true;
CanvasContext.Font = GEngine->GetSmallFont();
if (GEngine)
{
CanvasContext.Font = GEngine->GetSmallFont();
}

PrintKeyBinds(CanvasContext);

Expand Down Expand Up @@ -151,7 +154,8 @@ void FGameplayDebuggerCategory_ViewModes::CycleViewMode()

if (NextViewModeIndex != CurrViewModeIndex)
{
FString NextViewModeName = OUU::Runtime::Private::GetViewModeName(StaticCast<EViewModeIndex>(NextViewModeIndex));
FString NextViewModeName = OUU::Runtime::Private::GetViewModeName(
StaticCast<EViewModeIndex>(NextViewModeIndex));

if (!NextViewModeName.IsEmpty())
{
Expand Down Expand Up @@ -305,7 +309,8 @@ void FGameplayDebuggerCategory_ViewModes::GetNextBuffer(const TArray<FString>& O
Max += Incr;
}

auto Wrap = [&](int32 Index) {
auto Wrap = [&](int32 Index)
{
if (Index < Min)
{
Index = Max;
Expand Down Expand Up @@ -390,4 +395,4 @@ void FGameplayDebuggerCategory_ViewModes::SetupBufferVisualizationOverviewInput(
bIsBufferVisualizationInputSetup = true;
}

#endif
#endif
5 changes: 4 additions & 1 deletion Source/OUURuntime/Private/Pooling/OUUActorPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ void UOUUActorPool::AddReferencedObjects(UObject* InThis, FReferenceCollector& C
{
for (auto& Entry : CastedThis->PooledActors)
{
Collector.AddReferencedObjects<AActor>(Entry.Value);
//We get a warning here saying the game will randomly crash when incremental garbage collection is enabled
//Suggestion is to pass TObjectPtr<AActor> instead of AActor* to AddReferencedObjects
//Collector.AddReferencedObjects<AActor>(Entry.Value);

}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/OUURuntime/Private/SemVer/PreReleaseIdentifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ bool FSemVerPreReleaseIdentifier::TryIncrement()
if (LastIdentifierAsNumeric != INDEX_NONE)
{
LastIdentifierAsNumeric++;
LastIdentifier = LexToString<int32>(LastIdentifierAsNumeric);
//LastIdentifier = LexToString<int32>(LastIdentifierAsNumeric);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#pragma once

#include "GameplayDebugger/GameplayDebuggerCategory_OUUBase.h"
#include "Animation/AnimTypes.h"

#include "Animation/AnimationAsset.h"

#if WITH_GAMEPLAY_DEBUGGER
#include "CoreMinimal.h"
Expand All @@ -12,7 +15,7 @@ class APlayerController;
class UCanvas;
class UOUUDebuggableAnimInstance;

struct FAnimInstanceProxy;
//struct FAnimInstanceProxy;
struct FGameplayDebugger_DisplayDebugManager;

/**
Expand All @@ -26,7 +29,7 @@ class OUURUNTIME_API FGameplayDebuggerCategory_Animation : public FOUUGameplayDe

static auto GetCategoryName() { return TEXT("Animation"); }

void DrawData(APlayerController* OwnerPC, FGameplayDebuggerCanvasContext& CanvasContext) override;
virtual void DrawData(APlayerController* OwnerPC, FGameplayDebuggerCanvasContext& CanvasContext) override;

private:
int32 DebugMeshComponentIndex = 0;
Expand Down
10 changes: 5 additions & 5 deletions Source/OUURuntime/Public/FlowControl/ExclusiveLock.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class OUURUNTIME_API UExclusiveLock : public UObject
* Calling this function again with the active object key will result in a success without any side-effects.
* @returns whether the lock was successfully locked by this key object.
*/
UFUNCTION(BlueprintCallable)
UFUNCTION(BlueprintCallable, Category = "OUU")
bool TryLock(UObject* Key);

/**
Expand All @@ -34,22 +34,22 @@ class OUURUNTIME_API UExclusiveLock : public UObject
* The lock will be automatically released after the specified time (in game time).
* @returns whether the lock was successfully locked by this key object.
*/
UFUNCTION(BlueprintCallable)
UFUNCTION(BlueprintCallable, Category = "OUU")
bool TryLockForDuration(UObject* Key, float Duration);

/**
* Release the lock with the object which was used to lock it.
* Calling unlock with an object that was not used to lock it will trigger an ensure condition.
*/
UFUNCTION(BlueprintCallable)
UFUNCTION(BlueprintCallable, Category = "OUU")
bool TryUnlock(UObject* Key);

/** Is the lock locked by a valid key object? */
UFUNCTION(BlueprintPure)
UFUNCTION(BlueprintPure, Category = "OUU")
bool IsLocked() const;

private:
/** Active key/owner of the lock. May turn stale while set. */
UPROPERTY(Transient)
UPROPERTY(Transient,Category="OUU",VisibleAnywhere)
TWeakObjectPtr<UObject> ActiveKey;
};
Loading