UE 5.2 fixes

This commit is contained in:
Steve Streeting 2023-07-11 15:08:14 +01:00
parent 097719426a
commit 8f6180969e
3 changed files with 7 additions and 4 deletions

View File

@ -62,6 +62,7 @@ public class ImGui : ModuleRules
new string[]
{
"CoreUObject",
"EnhancedInput",
"Engine",
"InputCore",
"Slate",

View File

@ -7,6 +7,8 @@
#include <GameFramework/PlayerInput.h>
#include <UObject/UObjectIterator.h>
#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<UPlayerInput>())
if (UEnhancedPlayerInput* DefaultPlayerInput = GetMutableDefault<UEnhancedPlayerInput>())
{
UpdatePlayerInput(DefaultPlayerInput, KeyBind);
}
// Update all existing player inputs to see changes in running PIE session.
for (TObjectIterator<UPlayerInput> It; It; ++It)
for (TObjectIterator<UEnhancedPlayerInput> It; It; ++It)
{
UpdatePlayerInput(*It, KeyBind);
}

View File

@ -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)
{