mirror of
https://github.com/kevinporetti/UnrealImGui.git
synced 2025-01-18 08:20:32 +00:00
UE 5.2 fixes
This commit is contained in:
parent
097719426a
commit
8f6180969e
@ -62,6 +62,7 @@ public class ImGui : ModuleRules
|
||||
new string[]
|
||||
{
|
||||
"CoreUObject",
|
||||
"EnhancedInput",
|
||||
"Engine",
|
||||
"InputCore",
|
||||
"Slate",
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user