diff --git a/Binaries/Win64/UnrealEditor-CustomShapeButton.dll b/Binaries/Win64/UnrealEditor-CustomShapeButton.dll index 2e65080..a7069fd 100644 Binary files a/Binaries/Win64/UnrealEditor-CustomShapeButton.dll and b/Binaries/Win64/UnrealEditor-CustomShapeButton.dll differ diff --git a/Binaries/Win64/UnrealEditor-CustomShapeButton.pdb b/Binaries/Win64/UnrealEditor-CustomShapeButton.pdb index dc4e4e2..15bfb8e 100644 Binary files a/Binaries/Win64/UnrealEditor-CustomShapeButton.pdb and b/Binaries/Win64/UnrealEditor-CustomShapeButton.pdb differ diff --git a/Binaries/Win64/UnrealEditor.modules b/Binaries/Win64/UnrealEditor.modules index fd0b52a..0d4c32a 100644 --- a/Binaries/Win64/UnrealEditor.modules +++ b/Binaries/Win64/UnrealEditor.modules @@ -1,5 +1,5 @@ { - "BuildId": "37670630", + "BuildId": "43139311", "Modules": { "CustomShapeButton": "UnrealEditor-CustomShapeButton.dll" diff --git a/CustomShapeButton.uplugin b/CustomShapeButton.uplugin index 27a0335..d38adf6 100644 --- a/CustomShapeButton.uplugin +++ b/CustomShapeButton.uplugin @@ -10,7 +10,7 @@ "DocsURL": "", "MarketplaceURL": "", "SupportURL": "mailto:janseliw@gmail.com", - "EngineVersion": "5.5.0", + "EngineVersion": "5.6.0", "EnabledByDefault": true, "CanContainContent": false, "IsBetaVersion": false, diff --git a/README.md b/README.md index c999be0..f29a97e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ![License](https://img.shields.io/badge/license-MIT-brightgreen.svg) -![Unreal Engine](https://img.shields.io/badge/Unreal-5.5-dea309?style=flat&logo=unrealengine) +![Unreal Engine](https://img.shields.io/badge/Unreal-5.6-dea309?style=flat&logo=unrealengine)

@@ -35,6 +35,8 @@ Detailed documentation about the Custom Shape Button can be found [here](https:/ Check out our [Release](https://github.com/JanSeliv/CustomShapeButton/releases) page for a sample project showcasing the Custom Shape Button plugin. ## 📅 Changelog +#### 2025-11-17 +- Updated to **Unreal Engine 5.6** #### 2025-06-27 - Updated to **Unreal Engine 5.5** - [Bug] Fixed overlapping don't work on covered areas when stacked on top of each other: added `Overlap Order` setting for proper handing underlying buttons diff --git a/Source/CustomShapeButton/CustomShapeButton.Build.cs b/Source/CustomShapeButton/CustomShapeButton.Build.cs index 003d690..899d5b5 100644 --- a/Source/CustomShapeButton/CustomShapeButton.Build.cs +++ b/Source/CustomShapeButton/CustomShapeButton.Build.cs @@ -8,7 +8,7 @@ public CustomShapeButton(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; CppStandard = CppStandardVersion.Latest; - bEnableNonInlinedGenCppWarnings = true; + CppCompileWarningSettings.NonInlinedGenCppWarningLevel = WarningLevel.Error; PublicDependencyModuleNames.AddRange(new[] { diff --git a/Source/CustomShapeButton/Private/SCustomShapeButton.cpp b/Source/CustomShapeButton/Private/SCustomShapeButton.cpp index ae11a0a..72d14ac 100644 --- a/Source/CustomShapeButton/Private/SCustomShapeButton.cpp +++ b/Source/CustomShapeButton/Private/SCustomShapeButton.cpp @@ -215,25 +215,34 @@ void SCustomShapeButton::UpdateRawColors_Texture(const UTexture2D& Texture) // Get Raw Colors data on Render thread TWeakPtr WeakThisPtr = StaticCastWeakPtr(AsWeak()); - checkf(WeakThisPtr.IsValid(), TEXT("ERROR: [%i] %hs:\n'WeakThis' is not valid!"), __LINE__, __FUNCTION__); - const TWeakObjectPtr WeakTexture = &Texture; + const TWeakObjectPtr WeakTexture(&Texture); const FIntRect TextureSize(0, 0, TextureRes.X, TextureRes.Y); ENQUEUE_RENDER_COMMAND(TryUpdateRawColorsOnce)([WeakThisPtr, WeakTexture, TextureSize](FRHICommandListImmediate& RHICmdList) { - SCustomShapeButton* This = WeakThisPtr.Pin().Get(); - if (!ensureMsgf(This, TEXT("ASSERT: [%i] %hs:\n'This' is not valid!"), __LINE__, __FUNCTION__)) + const UTexture2D* Texture2D = WeakTexture.Get(); + const FTextureResource* TextureResource = Texture2D ? Texture2D->GetResource() : nullptr; + FRHITexture* RHITexture = TextureResource ? TextureResource->GetTexture2DRHI() : nullptr; + if (!ensureMsgf(RHITexture, TEXT("%hs: 'RHITexture' is not valid"), __FUNCTION__)) { return; } - const UTexture2D* Texture2D = WeakTexture.Get(); - const FTextureResource* TextureResource = Texture2D ? Texture2D->GetResource() : nullptr; - FRHITexture* RHITexture = TextureResource ? TextureResource->GetTexture2DRHI() : nullptr; - if (ensureMsgf(RHITexture, TEXT("%hs: 'RHITexture' is not valid"), __FUNCTION__)) + // Obtain data + TArray OutColors; + RHICmdList.ReadSurfaceData(RHITexture, TextureSize, OutColors, FReadSurfaceDataFlags()); + if (!ensureMsgf(!OutColors.IsEmpty(), TEXT("ASSERT: [%i] %hs:\n'OutColors' is empty, failed to read texture data!"), __LINE__, __FUNCTION__)) { - // Copy data to cache - RHICmdList.ReadSurfaceData(RHITexture, TextureSize, /*out*/This->RawColors, FReadSurfaceDataFlags()); + return; } + + // Set the data on Game thread + AsyncTask(ENamedThreads::GameThread, [WeakThisPtr, TempColors = MoveTemp(OutColors)]() mutable -> void + { + if (SCustomShapeButton* This = WeakThisPtr.Pin().Get()) + { + This->RawColors = MoveTemp(TempColors); + } + }); }); }