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[]
|
new string[]
|
||||||
{
|
{
|
||||||
"CoreUObject",
|
"CoreUObject",
|
||||||
|
"EnhancedInput",
|
||||||
"Engine",
|
"Engine",
|
||||||
"InputCore",
|
"InputCore",
|
||||||
"Slate",
|
"Slate",
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#include <GameFramework/PlayerInput.h>
|
#include <GameFramework/PlayerInput.h>
|
||||||
#include <UObject/UObjectIterator.h>
|
#include <UObject/UObjectIterator.h>
|
||||||
|
|
||||||
|
#include "EnhancedPlayerInput.h"
|
||||||
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@ -49,7 +51,7 @@ namespace
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdatePlayerInput(UPlayerInput* PlayerInput, const FKeyBind& KeyBind)
|
void UpdatePlayerInput(UEnhancedPlayerInput* PlayerInput, const FKeyBind& KeyBind)
|
||||||
{
|
{
|
||||||
const int32 Index = PlayerInput->DebugExecBindings.IndexOfByPredicate([&](const FKeyBind& PlayerKeyBind)
|
const int32 Index = PlayerInput->DebugExecBindings.IndexOfByPredicate([&](const FKeyBind& PlayerKeyBind)
|
||||||
{
|
{
|
||||||
@ -86,13 +88,13 @@ namespace DebugExecBindings
|
|||||||
const FKeyBind KeyBind = CreateKeyBind(KeyInfo, Command);
|
const FKeyBind KeyBind = CreateKeyBind(KeyInfo, Command);
|
||||||
|
|
||||||
// Update default player input, so changes will be visible in all PIE sessions created after this point.
|
// 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);
|
UpdatePlayerInput(DefaultPlayerInput, KeyBind);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update all existing player inputs to see changes in running PIE session.
|
// 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);
|
UpdatePlayerInput(*It, KeyBind);
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ FReply SImGuiCanvasControl::OnDragOver(const FGeometry& MyGeometry, const FDragD
|
|||||||
if (Operation.IsValid())
|
if (Operation.IsValid())
|
||||||
{
|
{
|
||||||
const FSlateRenderTransform ScreenToWidget = MyGeometry.GetAccumulatedRenderTransform().Inverse();
|
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)
|
if (Operation->DragType == EDragType::Content)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user