From cff6ff6f669428c464bae8e1f304c7b927eae59f Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Thu, 16 Feb 2023 17:05:16 +0000 Subject: [PATCH 1/5] Fix compilation error on UE 5.1 --- Source/ImGui/Private/ImGuiImplementation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/ImGui/Private/ImGuiImplementation.cpp b/Source/ImGui/Private/ImGuiImplementation.cpp index 6261002..ac2d97b 100644 --- a/Source/ImGui/Private/ImGuiImplementation.cpp +++ b/Source/ImGui/Private/ImGuiImplementation.cpp @@ -6,7 +6,10 @@ // For convenience and easy access to the ImGui source code, we build it as part of this module. // We don't need to define IMGUI_API manually because it is already done for this module. - +// UE 5.1 stopped defining PLATFORM_XBOXONE, so be safe if not defined +#if !defined(PLATFORM_XBOXONE) + #define PLATFORM_XBOXONE 0 +#endif #if PLATFORM_XBOXONE // Disable Win32 functions used in ImGui and not supported on XBox. #define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS From 097719426a1dca6dc6d392656e132029d1f6d897 Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Mon, 20 Feb 2023 17:36:08 +0000 Subject: [PATCH 2/5] UE5.1 Warning fix: C++ class refs must include module --- Source/ImGui/Private/ImGuiModuleSettings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ImGui/Private/ImGuiModuleSettings.h b/Source/ImGui/Private/ImGuiModuleSettings.h index e685b2e..369f076 100644 --- a/Source/ImGui/Private/ImGuiModuleSettings.h +++ b/Source/ImGui/Private/ImGuiModuleSettings.h @@ -175,7 +175,7 @@ protected: // Path to own implementation of ImGui Input Handler allowing to customize handling of keyboard and gamepad input. // If not set then default handler is used. - UPROPERTY(EditAnywhere, config, Category = "Extensions", meta = (MetaClass = "ImGuiInputHandler")) + UPROPERTY(EditAnywhere, config, Category = "Extensions", meta = (MetaClass = "/Script/ImGui.ImGuiInputHandler")) FSoftClassPath ImGuiInputHandlerClass; // Whether ImGui should share keyboard input with game. From 8f6180969e50f10b181efe94230a74df53698bb8 Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Tue, 11 Jul 2023 15:08:14 +0100 Subject: [PATCH 3/5] UE 5.2 fixes --- Source/ImGui/ImGui.Build.cs | 1 + Source/ImGui/Private/Utilities/DebugExecBindings.cpp | 8 +++++--- Source/ImGui/Private/Widgets/SImGuiCanvasControl.cpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/ImGui/ImGui.Build.cs b/Source/ImGui/ImGui.Build.cs index ef1d029..903c231 100644 --- a/Source/ImGui/ImGui.Build.cs +++ b/Source/ImGui/ImGui.Build.cs @@ -62,6 +62,7 @@ public class ImGui : ModuleRules new string[] { "CoreUObject", + "EnhancedInput", "Engine", "InputCore", "Slate", diff --git a/Source/ImGui/Private/Utilities/DebugExecBindings.cpp b/Source/ImGui/Private/Utilities/DebugExecBindings.cpp index 49bf80f..d3c4107 100644 --- a/Source/ImGui/Private/Utilities/DebugExecBindings.cpp +++ b/Source/ImGui/Private/Utilities/DebugExecBindings.cpp @@ -7,6 +7,8 @@ #include #include +#include "EnhancedPlayerInput.h" + namespace { @@ -49,7 +51,7 @@ namespace #endif } - void UpdatePlayerInput(UPlayerInput* PlayerInput, const FKeyBind& KeyBind) + void UpdatePlayerInput(UEnhancedPlayerInput* PlayerInput, const FKeyBind& KeyBind) { const int32 Index = PlayerInput->DebugExecBindings.IndexOfByPredicate([&](const FKeyBind& PlayerKeyBind) { @@ -86,13 +88,13 @@ namespace DebugExecBindings const FKeyBind KeyBind = CreateKeyBind(KeyInfo, Command); // Update default player input, so changes will be visible in all PIE sessions created after this point. - if (UPlayerInput* DefaultPlayerInput = GetMutableDefault()) + if (UEnhancedPlayerInput* DefaultPlayerInput = GetMutableDefault()) { UpdatePlayerInput(DefaultPlayerInput, KeyBind); } // Update all existing player inputs to see changes in running PIE session. - for (TObjectIterator It; It; ++It) + for (TObjectIterator It; It; ++It) { UpdatePlayerInput(*It, KeyBind); } diff --git a/Source/ImGui/Private/Widgets/SImGuiCanvasControl.cpp b/Source/ImGui/Private/Widgets/SImGuiCanvasControl.cpp index cfdbec3..505e935 100644 --- a/Source/ImGui/Private/Widgets/SImGuiCanvasControl.cpp +++ b/Source/ImGui/Private/Widgets/SImGuiCanvasControl.cpp @@ -176,7 +176,7 @@ FReply SImGuiCanvasControl::OnDragOver(const FGeometry& MyGeometry, const FDragD if (Operation.IsValid()) { const FSlateRenderTransform ScreenToWidget = MyGeometry.GetAccumulatedRenderTransform().Inverse(); - const FVector2D DragDelta = ScreenToWidget.TransformVector(DragDropEvent.GetScreenSpacePosition() - Operation->StartPosition); + const FVector2D DragDelta = ScreenToWidget.TransformVector(FVector2D(DragDropEvent.GetScreenSpacePosition() - Operation->StartPosition)); if (Operation->DragType == EDragType::Content) { From 5dc3b1f2220290f8b8d80601acd3f7c515ade659 Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Tue, 11 Jul 2023 16:30:58 +0100 Subject: [PATCH 4/5] Remove "Handler Down" debug message --- Source/ImGui/Private/ImGuiInputHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ImGui/Private/ImGuiInputHandler.cpp b/Source/ImGui/Private/ImGuiInputHandler.cpp index 67cc667..b4288d4 100644 --- a/Source/ImGui/Private/ImGuiInputHandler.cpp +++ b/Source/ImGui/Private/ImGuiInputHandler.cpp @@ -135,7 +135,7 @@ FReply UImGuiInputHandler::OnMouseButtonDown(const FPointerEvent& MouseEvent) FImGuiContextProxy* Proxy = ModuleManager->GetContextManager().GetContextProxy(0); if (Proxy) { - GEngine->AddOnScreenDebugMessage(15, 10, Proxy->WantsMouseCapture() ? FColor::Green : FColor::Red, TEXT("Handler Down")); + //GEngine->AddOnScreenDebugMessage(15, 10, Proxy->WantsMouseCapture() ? FColor::Green : FColor::Red, TEXT("Handler Down")); return ToReply(Proxy->WantsMouseCapture()); } } From 25846675cd7dec7c53a2c42863318897dcf48cec Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Tue, 11 Jul 2023 18:14:53 +0100 Subject: [PATCH 5/5] Fix warning about plugin not referencing plugin --- ImGui.uplugin | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ImGui.uplugin b/ImGui.uplugin index 588f211..63a7f3d 100644 --- a/ImGui.uplugin +++ b/ImGui.uplugin @@ -19,5 +19,11 @@ "Type": "DeveloperTool", "LoadingPhase": "PreDefault" } + ], + "Plugins": [ + { + "Name": "EnhancedInput", + "Enabled": true + } ] } \ No newline at end of file