From 8f6180969e50f10b181efe94230a74df53698bb8 Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Tue, 11 Jul 2023 15:08:14 +0100 Subject: [PATCH] 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) {