diff --git a/Docs/GAS.md b/Docs/GAS.md index 8f819468..013d96fb 100644 --- a/Docs/GAS.md +++ b/Docs/GAS.md @@ -20,8 +20,12 @@ abilities using a C++ coroutine. Instead of overriding ActivateAbility, override the new ExecuteAbility instead. **Overriding ExecuteAbility with a subroutine is undefined behavior.** -Every instancing policy is supported, including it dynamically changing at -runtime. +Every instancing policy is supported on Unreal Engine 5.3 and 5.4, including it +dynamically changing at runtime. + +Starting with 5.5, NonInstanced is not supported. +Using the `AbilitySystem.Fix.AllowNonInstancedAbilities` CVar to get it back is +possible, but not recommended due to engine issues. The following events are turned into interactions with the ExecuteAbility coroutine: diff --git a/Plugins/UE5Coro/Source/UE5Coro/Public/UE5Coro/CoroutinePrivate.inl b/Plugins/UE5Coro/Source/UE5Coro/Public/UE5Coro/CoroutinePrivate.inl index 08867f52..00fe34de 100644 --- a/Plugins/UE5Coro/Source/UE5Coro/Public/UE5Coro/CoroutinePrivate.inl +++ b/Plugins/UE5Coro/Source/UE5Coro/Public/UE5Coro/CoroutinePrivate.inl @@ -31,6 +31,7 @@ #pragma once +#include "Misc/EngineVersionComparison.h" #include "UObject/GCObjectScopeGuard.h" namespace UE5Coro::Private @@ -45,14 +46,22 @@ struct TWeak : std::false_type { }; template struct TWeak : std::bool_constant> { - using strong = TGCObjectScopeGuard; +#if UE_VERSION_OLDER_THAN(5, 5, 0) + using strong = TGCObjectScopeGuard>; +#else + using strong = TStrongObjectPtr>; +#endif using weak = TWeakObjectPtr; using ptr = std::enable_if_t; static strong Strengthen(const weak& Weak) { +#if UE_VERSION_OLDER_THAN(5, 5, 0) FGCScopeGuard _; // There's no API to convert a weak ptr to a strong one... - return strong(Weak.Get()); // relying on C++17 mandatory RVO + return strong(Weak.Get()); +#else + return Weak.Pin(); +#endif } static ptr Get(const strong& Strong) { return Strong.Get(); } }; diff --git a/Plugins/UE5Coro/Source/UE5CoroK2/Private/K2Node_UE5CoroCallCoroutine.cpp b/Plugins/UE5Coro/Source/UE5CoroK2/Private/K2Node_UE5CoroCallCoroutine.cpp index c8eee369..a86145c7 100644 --- a/Plugins/UE5Coro/Source/UE5CoroK2/Private/K2Node_UE5CoroCallCoroutine.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroK2/Private/K2Node_UE5CoroCallCoroutine.cpp @@ -33,6 +33,7 @@ #include "BlueprintActionDatabaseRegistrar.h" #include "BlueprintNodeSpawner.h" #include "EdGraphSchema_K2.h" +#include "Misc/EngineVersionComparison.h" #include "UE5Coro/AsyncCoroutine.h" #include "UObject/Class.h" #include "UObject/Field.h" @@ -41,6 +42,12 @@ #define LOCTEXT_NAMESPACE "UE5Coro" +#if UE_VERSION_OLDER_THAN(5, 5, 0) +using ObjectTools = UK2Node_CallFunction; +#else +#include "ObjectTools.h" +#endif + void UK2Node_UE5CoroCallCoroutine::CustomizeNode(UEdGraphNode* NewNode, bool, UFunction* Function) { @@ -74,7 +81,8 @@ void UK2Node_UE5CoroCallCoroutine::GetMenuActions( Menu.Category = GetDefaultCategoryForFunction(Fn, FText::GetEmpty()); if (Menu.Category.IsEmpty()) Menu.Category = LOCTEXT("CallCoroutine", "Call Coroutine"); - Menu.Tooltip = FText::FromString(GetDefaultTooltipForFunction(Fn)); + Menu.Tooltip = FText::FromString( + ObjectTools::GetDefaultTooltipForFunction(Fn)); Menu.Keywords = GetKeywordsForFunction(Fn); Menu.Icon = GetIconAndTint(Menu.IconTint); Menu.DocLink = GetDocumentationLink(); diff --git a/Plugins/UE5Coro/Source/UE5CoroK2/UE5CoroK2.Build.cs b/Plugins/UE5Coro/Source/UE5CoroK2/UE5CoroK2.Build.cs index aaa999df..fecc94f4 100644 --- a/Plugins/UE5Coro/Source/UE5CoroK2/UE5CoroK2.Build.cs +++ b/Plugins/UE5Coro/Source/UE5CoroK2/UE5CoroK2.Build.cs @@ -40,6 +40,7 @@ public UE5CoroK2(ReadOnlyTargetRules Target) { "BlueprintGraph", "UE5Coro", + "UnrealEd", }); } } diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/AggregateAwaiterTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/AggregateAwaiterTest.cpp index 6cd876da..f2f7d0c9 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/AggregateAwaiterTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/AggregateAwaiterTest.cpp @@ -40,12 +40,12 @@ using namespace UE5Coro; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAggregateAsyncTest, "UE5Coro.Aggregate.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAggregateLatentTest, "UE5Coro.Aggregate.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/AsyncAwaiterTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/AsyncAwaiterTest.cpp index 0966c5aa..824e8398 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/AsyncAwaiterTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/AsyncAwaiterTest.cpp @@ -39,17 +39,17 @@ using namespace UE5Coro::Private; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAsyncAwaiterTest, "UE5Coro.Async.TrueAsync", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAsyncInLatentTest, "UE5Coro.Async.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAsyncStressTest, "UE5Coro.Async.Stress", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::MediumPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/AsyncLoadTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/AsyncLoadTest.cpp index 701cd187..a67dd4d3 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/AsyncLoadTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/AsyncLoadTest.cpp @@ -39,12 +39,12 @@ using namespace UE5Coro; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAsyncLoadTestLatent, "UE5Coro.AsyncLoad.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAsyncLoadTestAsync, "UE5Coro.AsyncLoad.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/AsyncQueryTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/AsyncQueryTest.cpp index d408f4dd..e7df765f 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/AsyncQueryTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/AsyncQueryTest.cpp @@ -38,12 +38,12 @@ using namespace UE5Coro::Private; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAsyncQueryTestAsync, "UE5Coro.AsyncQuery.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAsyncQueryTestLatent, "UE5Coro.AsyncQuery.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/AwaitableEventTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/AwaitableEventTest.cpp index 4b35fd1f..bd93abd0 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/AwaitableEventTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/AwaitableEventTest.cpp @@ -37,12 +37,12 @@ using namespace UE5Coro; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FEventAsyncTest, "UE5Coro.Threading.Event.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::CriticalPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FEventLatentTest, "UE5Coro.Threading.Event.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::CriticalPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/AwaitableSemaphoreTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/AwaitableSemaphoreTest.cpp index 2f0d50a4..d76821e4 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/AwaitableSemaphoreTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/AwaitableSemaphoreTest.cpp @@ -37,12 +37,12 @@ using namespace UE5Coro; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FSemaAsyncTest, "UE5Coro.Threading.Semaphore.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::CriticalPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FSemaLatentTest, "UE5Coro.Threading.Semaphore.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::CriticalPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/CancellationTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/CancellationTest.cpp index 5cd788fc..c9dbc15e 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/CancellationTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/CancellationTest.cpp @@ -41,12 +41,12 @@ using namespace UE5Coro::Private; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FCancelTestAsync, "UE5Coro.Cancel.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FCancelTestLatent, "UE5Coro.Cancel.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/CoroutineHandleTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/CoroutineHandleTest.cpp index ce4221d6..6cf9e052 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/CoroutineHandleTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/CoroutineHandleTest.cpp @@ -42,12 +42,12 @@ using namespace UE5Coro::Private; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FHandleTestAsync, "UE5Coro.Handle.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FHandleTestLatent, "UE5Coro.Handle.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/DelegateAwaiterTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/DelegateAwaiterTest.cpp index e4b5dd9f..ed520403 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/DelegateAwaiterTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/DelegateAwaiterTest.cpp @@ -41,17 +41,17 @@ using namespace UE5Coro::Private; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FDelegateTestCore, "UE5Coro.Delegate.Core", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::CriticalPriority | EAutomationTestFlags::SmokeFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FDelegateTestAsync, "UE5Coro.Delegate.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FDelegateTestLatent, "UE5Coro.Delegate.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/ExceptionTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/ExceptionTest.cpp index 664b0bc6..63a4ba6a 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/ExceptionTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/ExceptionTest.cpp @@ -44,7 +44,7 @@ using namespace UE5Coro::Private::Test; #if !PLATFORM_EXCEPTIONS_DISABLED IMPLEMENT_SIMPLE_AUTOMATION_TEST(FExceptionTest, "UE5Coro.Exceptions", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/FutureTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/FutureTest.cpp index e7d067d7..babe39e5 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/FutureTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/FutureTest.cpp @@ -39,12 +39,12 @@ using namespace UE5Coro::Private; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FFutureAsync, "UE5Coro.Future.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FFutureLatent, "UE5Coro.Future.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/GeneratorTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/GeneratorTest.cpp index 99f53a03..91b6a588 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/GeneratorTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/GeneratorTest.cpp @@ -29,13 +29,14 @@ // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#include "TestWorld.h" #include "Misc/AutomationTest.h" #include "UE5Coro/Generator.h" using namespace UE5Coro; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FGeneratorTest, "UE5Coro.Generator", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::CriticalPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/HttpAwaiterTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/HttpAwaiterTest.cpp index 1638b9be..9335155a 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/HttpAwaiterTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/HttpAwaiterTest.cpp @@ -41,12 +41,12 @@ using namespace UE5Coro; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FHttpAsyncTest, "UE5Coro.Http.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FHttpLatentTest, "UE5Coro.Http.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentAwaiterTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentAwaiterTest.cpp index 072b2992..27022893 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentAwaiterTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentAwaiterTest.cpp @@ -38,12 +38,12 @@ using namespace UE5Coro; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FLatentAwaiterTest, "UE5Coro.Latent.TrueLatent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FLatentInAsyncTest, "UE5Coro.Latent.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentCallbackTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentCallbackTest.cpp index a20f5e59..7b3d71f5 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentCallbackTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentCallbackTest.cpp @@ -40,7 +40,7 @@ using namespace UE5Coro; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FLatentCallbackTest, "UE5Coro.Latent.Callbacks", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentChainCancellationTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentChainCancellationTest.cpp index 8b9a218b..cf3d7639 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentChainCancellationTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentChainCancellationTest.cpp @@ -40,12 +40,12 @@ using namespace UE5Coro::Private; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAsyncChainCancelTest, "UE5Coro.Chain.Cancel.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FLatentChainCancelTest, "UE5Coro.Chain.Cancel.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentChainTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentChainTest.cpp index 062d1b65..e12a93df 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentChainTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/LatentChainTest.cpp @@ -41,12 +41,12 @@ using namespace UE5Coro; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAsyncChainTest, "UE5Coro.Chain.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FLatentChainTest, "UE5Coro.Chain.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/ReturnValueTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/ReturnValueTest.cpp index 0880fe2d..5f542dd9 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/ReturnValueTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/ReturnValueTest.cpp @@ -38,12 +38,12 @@ using namespace UE5Coro::Private; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FLatentReturnTest, "UE5Coro.Return.Latent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAsyncReturnTest, "UE5Coro.Return.Async", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Private/TaskTest.cpp b/Plugins/UE5Coro/Source/UE5CoroTests/Private/TaskTest.cpp index 700e539b..d90c2723 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Private/TaskTest.cpp +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Private/TaskTest.cpp @@ -39,22 +39,22 @@ using namespace UE5Coro; using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FTaskCreateAsync, "UE5Coro.Tasks.CreateAsync", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FTaskCreateLatent, "UE5Coro.Tasks.CreateLatent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FTaskConsumeAsync, "UE5Coro.Tasks.ConsumeAsync", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FTaskConsumeLatent, "UE5Coro.Tasks.ConsumeLatent", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5Coro/Source/UE5CoroTests/Public/TestWorld.h b/Plugins/UE5Coro/Source/UE5CoroTests/Public/TestWorld.h index 300e1971..f250132b 100644 --- a/Plugins/UE5Coro/Source/UE5CoroTests/Public/TestWorld.h +++ b/Plugins/UE5Coro/Source/UE5CoroTests/Public/TestWorld.h @@ -32,11 +32,17 @@ #pragma once #include "CoreMinimal.h" +#include "Misc/EngineVersionComparison.h" #include "UE5Coro/Definitions.h" #include #include "UE5Coro/AsyncCoroutine.h" #include "UE5Coro/UE5CoroSubsystem.h" +#if UE_VERSION_OLDER_THAN(5, 5, 0) +constexpr EAutomationTestFlags::Type EAutomationTestFlags_ApplicationContextMask = + EAutomationTestFlags::ApplicationContextMask; +#endif + #define CORO [&](T...) -> FAsyncCoroutine #define CORO_R(Type) [&](T...) -> TCoroutine #define IF_CORO_LATENT if constexpr (sizeof...(T) == 1) diff --git a/Plugins/UE5Coro/UE5Coro.uplugin b/Plugins/UE5Coro/UE5Coro.uplugin index 14409aa8..4cdde680 100644 --- a/Plugins/UE5Coro/UE5Coro.uplugin +++ b/Plugins/UE5Coro/UE5Coro.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "1.10.3", + "VersionName": "1.10.4", "FriendlyName": "UE5Coro", "Description": "C++17/20 coroutine implementation for Unreal Engine", "Category": "Programming", diff --git a/Plugins/UE5CoroGAS/Source/UE5CoroGASTests/Private/AbilityTaskTests.cpp b/Plugins/UE5CoroGAS/Source/UE5CoroGASTests/Private/AbilityTaskTests.cpp index fb13cbbe..3062947c 100644 --- a/Plugins/UE5CoroGAS/Source/UE5CoroGASTests/Private/AbilityTaskTests.cpp +++ b/Plugins/UE5CoroGAS/Source/UE5CoroGASTests/Private/AbilityTaskTests.cpp @@ -37,7 +37,7 @@ using namespace UE5Coro::Private::Test; IMPLEMENT_SIMPLE_AUTOMATION_TEST(FAbilityTaskTest, "UE5Coro.GAS.AbilityTask", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) diff --git a/Plugins/UE5CoroGAS/Source/UE5CoroGASTests/Private/GameplayAbilityTests.cpp b/Plugins/UE5CoroGAS/Source/UE5CoroGASTests/Private/GameplayAbilityTests.cpp index 5939856f..21e50643 100644 --- a/Plugins/UE5CoroGAS/Source/UE5CoroGASTests/Private/GameplayAbilityTests.cpp +++ b/Plugins/UE5CoroGAS/Source/UE5CoroGASTests/Private/GameplayAbilityTests.cpp @@ -31,25 +31,28 @@ #include "GASTestWorld.h" #include "Misc/AutomationTest.h" +#include "Misc/EngineVersionComparison.h" #include "UE5CoroGASTestGameplayAbility.h" using namespace UE5Coro::Private::Test; +#if UE_VERSION_OLDER_THAN(5, 5, 0) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FGameplayAbilityTestNonInstanced, "UE5Coro.GAS.GameplayAbility.NonInstanced", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) +#endif IMPLEMENT_SIMPLE_AUTOMATION_TEST(FGameplayAbilityTestPerActor, "UE5Coro.GAS.GameplayAbility.PerActor", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) IMPLEMENT_SIMPLE_AUTOMATION_TEST(FGameplayAbilityTestPerExecution, "UE5Coro.GAS.GameplayAbility.PerExecution", - EAutomationTestFlags::ApplicationContextMask | + EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::HighPriority | EAutomationTestFlags::ProductFilter) @@ -58,7 +61,11 @@ namespace void DoTest(FAutomationTestBase& Test, EGameplayAbilityInstancingPolicy::Type Policy) { +#if UE_VERSION_OLDER_THAN(5, 5, 0) bool bInstanced = Policy != EGameplayAbilityInstancingPolicy::NonInstanced; +#else + constexpr bool bInstanced = true; +#endif auto* CDO = GetMutableDefault(); UUE5CoroGASTestGameplayAbility::SetInstancingPolicy(Policy); int& State = UUE5CoroGASTestGameplayAbility::State; @@ -118,11 +125,13 @@ void DoTest(FAutomationTestBase& Test, } } +#if UE_VERSION_OLDER_THAN(5, 5, 0) bool FGameplayAbilityTestNonInstanced::RunTest(const FString& Parameters) { DoTest(*this, EGameplayAbilityInstancingPolicy::NonInstanced); return true; } +#endif bool FGameplayAbilityTestPerActor::RunTest(const FString& Parameters) { diff --git a/Plugins/UE5CoroGAS/Source/UE5CoroGASTests/Private/UE5CoroGASTestGameplayAbility.cpp b/Plugins/UE5CoroGAS/Source/UE5CoroGASTests/Private/UE5CoroGASTestGameplayAbility.cpp index 8811bdd3..35b7a42e 100644 --- a/Plugins/UE5CoroGAS/Source/UE5CoroGASTests/Private/UE5CoroGASTestGameplayAbility.cpp +++ b/Plugins/UE5CoroGAS/Source/UE5CoroGASTests/Private/UE5CoroGASTestGameplayAbility.cpp @@ -30,6 +30,7 @@ // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "UE5CoroGASTestGameplayAbility.h" +#include "Misc/EngineVersionComparison.h" #include "Tasks/GameplayTask_WaitDelay.h" #include "UE5Coro/AsyncAwaiters.h" #include "UE5Coro/Cancellation.h" @@ -80,7 +81,11 @@ FAbilityCoroutine UUE5CoroGASTestGameplayAbility::ExecuteAbility( State = 4; // UGameplayTask_WaitDelay only works on instanced abilities +#if UE_VERSION_OLDER_THAN(5, 5, 0) if (GetInstancingPolicy() != EGameplayAbilityInstancingPolicy::NonInstanced) +#else + if constexpr (true) +#endif { // UGameplayTask_WaitDelay is MinimalAPI auto* Class = UGameplayTask_WaitDelay::StaticClass(); diff --git a/Plugins/UE5CoroGAS/UE5CoroGAS.uplugin b/Plugins/UE5CoroGAS/UE5CoroGAS.uplugin index 80dc55c8..b5ea31b7 100644 --- a/Plugins/UE5CoroGAS/UE5CoroGAS.uplugin +++ b/Plugins/UE5CoroGAS/UE5CoroGAS.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "1.10.3", + "VersionName": "1.10.4", "FriendlyName": "UE5Coro – Gameplay Ability System", "Description": "C++17/20 coroutines for GAS", "Category": "Programming",