Skip to content

Commit 4e192da

Browse files
committed
- updated for unreal version 5.5
1 parent beadcb2 commit 4e192da

8 files changed

Lines changed: 45 additions & 2 deletions

RyHelpfulHelpers.uplugin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"FileVersion": 3,
33
"Version": 1,
4-
"VersionName": "1.3",
4+
"VersionName": "1.4",
55
"FriendlyName": "Ryan's Helpful Helpers",
66
"Description": "Extremely helpful helper functions for developing Blueprint and C++ projects in Unreal Engine.",
77
"Category": "Utilities",

Source/RyRuntime/Private/RyRuntimeComponentHelpers.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
#include "Runtime/Engine/Classes/PhysicsEngine/BodySetup.h"
1111
#include "Runtime/CoreUObject/Public/UObject/UObjectIterator.h"
1212
#include "Runtime/Engine/Classes/Components/PoseableMeshComponent.h"
13+
#include "Engine/SkeletalMesh.h"
14+
15+
#if ENGINE_MAJOR_VERSION > 5 || (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 5)
16+
#include "PhysicsEngine/SkeletalBodySetup.h"
17+
#endif
1318

1419
//---------------------------------------------------------------------------------------------------------------------
1520
/**

Source/RyRuntime/Private/RyRuntimeLevelHelpers.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ TSoftObjectPtr<UWorld> URyRuntimeLevelHelpers::GetWorldSoftReferenceFromPath(con
3939
{
4040
fileName = fileName.Left(levelInstStart);
4141
}
42-
42+
#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 5) || ENGINE_MAJOR_VERSION > 5
43+
return TSoftObjectPtr<UWorld>(FSoftObjectPath(FString::Printf(TEXT("%s/%s.%s"), *fullFilePath, *fileName, *fileName)));
44+
#else
4345
return TSoftObjectPtr<UWorld>(FString::Printf(TEXT("%s/%s.%s"), *fullFilePath, *fileName, *fileName));
46+
#endif
4447
}
4548

4649
//---------------------------------------------------------------------------------------------------------------------
@@ -133,7 +136,11 @@ TSoftObjectPtr<UWorld> URyRuntimeLevelHelpers::GetCleanWorldSoftReference(const
133136
}
134137
}
135138

139+
#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 5) || ENGINE_MAJOR_VERSION > 5
140+
return TSoftObjectPtr<UWorld>(FSoftObjectPath(worldRefPath));
141+
#else
136142
return TSoftObjectPtr<UWorld>(worldRefPath);
143+
#endif
137144
}
138145

139146
//---------------------------------------------------------------------------------------------------------------------
@@ -738,7 +745,11 @@ ULevelStreamingDynamic* URyRuntimeLevelHelpers::LoadLevelInstance_Internal(UWorl
738745

739746
if (ShortPackageName.StartsWith(World->StreamingLevelsPrefix))
740747
{
748+
#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 5) || ENGINE_MAJOR_VERSION > 5
749+
ShortPackageName.RightChopInline(World->StreamingLevelsPrefix.Len(), EAllowShrinking::No);
750+
#else
741751
ShortPackageName.RightChopInline(World->StreamingLevelsPrefix.Len(), false);
752+
#endif
742753
}
743754

744755
// Remove PIE prefix if it's there before we actually load the level

Source/RyRuntime/Private/RyRuntimeLogHelpers.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "Misc/FileHelper.h"
1515
#include "GenericPlatform/GenericPlatformOutputDevices.h"
1616
#include "Runtime/Engine/Classes/Engine/GameViewportClient.h"
17+
#include "Runtime/Launch/Resources/Version.h"
1718

1819
//---------------------------------------------------------------------------------------------------------------------
1920
/**
@@ -31,7 +32,11 @@ void URyRuntimeLogHelpers::PrintLogString(UObject* WorldContextObject, const FSt
3132
switch(World->GetNetMode())
3233
{
3334
case NM_Client:
35+
#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 5) || ENGINE_MAJOR_VERSION > 5
36+
Prefix = FString::Printf(TEXT("Client %d: "), UE::GetPlayInEditorID() - 1);
37+
#else
3438
Prefix = FString::Printf(TEXT("Client %d: "), GPlayInEditorID - 1);
39+
#endif
3540
break;
3641
case NM_DedicatedServer:
3742
case NM_ListenServer:

Source/RyRuntime/Private/RyRuntimePlatformHelpers.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#include "HAL/PlatformApplicationMisc.h"
99
#include "GameFramework/WorldSettings.h"
1010

11+
#include "Misc/App.h"
12+
#include "Engine/Engine.h"
13+
1114
#if PLATFORM_ANDROID && USE_ANDROID_JNI
1215
#include "Android/AndroidJNI.h"
1316
#include "Android/AndroidApplication.h"

Source/RyRuntime/Private/RyRuntimeStringHelpers.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "Internationalization/StringTableCore.h"
77
#include "Internationalization/StringTableRegistry.h"
88
#include "Misc/Paths.h"
9+
#include "Runtime/Launch/Resources/Version.h"
910

1011
//---------------------------------------------------------------------------------------------------------------------
1112
/**
@@ -62,7 +63,11 @@ void URyRuntimeStringHelpers::PopChar(FString& sourceString)
6263
{
6364
return;
6465
}
66+
#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 5) || ENGINE_MAJOR_VERSION > 5
67+
sourceString.RemoveAt(sourceString.Len() - 1, 1, EAllowShrinking::No);
68+
#else
6569
sourceString.RemoveAt(sourceString.Len() - 1, 1, false);
70+
#endif
6671
}
6772

6873
//---------------------------------------------------------------------------------------------------------------------

Source/RyRuntime/Public/RyRuntimeArrayHelpers.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "CoreMinimal.h"
66
#include "Kismet/BlueprintFunctionLibrary.h"
7+
#include "Runtime/Launch/Resources/Version.h"
8+
79
#include "RyRuntimeArrayHelpers.generated.h"
810

911
//DECLARE_DYNAMIC_DELEGATE_RetVal_TwoParams(bool, FRyGenericArraySort, const int32&, A, const int32&, B);
@@ -43,7 +45,11 @@ class RYRUNTIME_API URyRuntimeArrayHelpers : public UBlueprintFunctionLibrary
4345
// Since 'Item' isn't really an int, step the stack manually
4446
// We use the array inner type to understand what we are returning (the size)
4547
const FProperty* InnerProp = ArrayProperty->Inner;
48+
#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 5) || ENGINE_MAJOR_VERSION > 5
49+
const int32 PropertySize = InnerProp->GetElementSize() * InnerProp->ArrayDim;
50+
#else
4651
const int32 PropertySize = InnerProp->ElementSize * InnerProp->ArrayDim;
52+
#endif
4753
void* StorageSpace = FMemory_Alloca(PropertySize);
4854
InnerProp->InitializeValue(StorageSpace);
4955

@@ -84,7 +90,11 @@ class RYRUNTIME_API URyRuntimeArrayHelpers : public UBlueprintFunctionLibrary
8490
// Since 'Item' isn't really an int, step the stack manually
8591
// We use the array inner type to understand what we are returning (the size)
8692
const FProperty* InnerProp = ArrayProperty->Inner;
93+
#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 5) || ENGINE_MAJOR_VERSION > 5
94+
const int32 PropertySize = InnerProp->GetElementSize() * InnerProp->ArrayDim;
95+
#else
8796
const int32 PropertySize = InnerProp->ElementSize * InnerProp->ArrayDim;
97+
#endif
8898
void* StorageSpace = FMemory_Alloca(PropertySize);
8999
InnerProp->InitializeValue(StorageSpace);
90100

Source/RyRuntime/Public/RyRuntimePlatformHelpers.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,15 +613,19 @@ FORCEINLINE void URyRuntimePlatformHelpers::CustomNamedStat(const FString& Text,
613613
*/
614614
FORCEINLINE void URyRuntimePlatformHelpers::BeginProfilerColor(const FColor& Color)
615615
{
616+
#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) || ENGINE_MAJOR_VERSION < 5
616617
FPlatformMisc::BeginProfilerColor(Color);
618+
#endif
617619
}
618620

619621
//---------------------------------------------------------------------------------------------------------------------
620622
/**
621623
*/
622624
FORCEINLINE void URyRuntimePlatformHelpers::EndProfilerColor()
623625
{
626+
#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) || ENGINE_MAJOR_VERSION < 5
624627
FPlatformMisc::EndProfilerColor();
628+
#endif
625629
}
626630

627631
//---------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)