You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Enable OnController_X function deprecations for the Slate App and the Generic Message handler.
#jira UE-156743 #rb Patrick.Boutot #rnx #preflight 62d083ff7e1c26dcd7d35502 [CL 21099901 by ben hoffman in ue5-main branch]
This commit is contained in:
+56
-13
@@ -8,6 +8,7 @@
|
||||
#include "Math/Vector2D.h"
|
||||
#include "Templates/SharedPointer.h"
|
||||
#include "Misc/Optional.h"
|
||||
#include "GenericPlatform/GenericPlatformInputDeviceMapper.h"
|
||||
|
||||
class FGenericWindow;
|
||||
|
||||
@@ -305,28 +306,34 @@ public:
|
||||
|
||||
virtual bool OnControllerAnalog(FGamepadKeyNames::Type KeyName, FPlatformUserId PlatformUserId, FInputDeviceId InputDeviceId, float AnalogValue)
|
||||
{
|
||||
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||
if (!ShouldUsePlatformUserId())
|
||||
{
|
||||
return OnControllerAnalog(KeyName, PlatformUserId.GetInternalId(), AnalogValue);
|
||||
}
|
||||
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool OnControllerButtonPressed(FGamepadKeyNames::Type KeyName, FPlatformUserId PlatformUserId, FInputDeviceId InputDeviceId, bool IsRepeat)
|
||||
{
|
||||
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||
if (!ShouldUsePlatformUserId())
|
||||
{
|
||||
return OnControllerButtonPressed(KeyName, PlatformUserId.GetInternalId(), IsRepeat);
|
||||
}
|
||||
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool OnControllerButtonReleased(FGamepadKeyNames::Type KeyName, FPlatformUserId PlatformUserId, FInputDeviceId InputDeviceId, bool IsRepeat)
|
||||
{
|
||||
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||
if (!ShouldUsePlatformUserId())
|
||||
{
|
||||
return OnControllerButtonReleased(KeyName, PlatformUserId.GetInternalId(), IsRepeat);
|
||||
}
|
||||
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -513,38 +520,54 @@ public:
|
||||
}
|
||||
|
||||
// Deprecate these when engine code has been converted to handle platform user id
|
||||
//UE_DEPRECATED(5.1, "This version of OnControllerAnalog has been deprecated, please use the one that takes an FPlatformUser and FInputDeviceId instead.")
|
||||
UE_DEPRECATED(5.1, "This version of OnControllerAnalog has been deprecated, please use the one that takes an FPlatformUser and FInputDeviceId instead.")
|
||||
virtual bool OnControllerAnalog(FGamepadKeyNames::Type KeyName, int32 ControllerId, float AnalogValue)
|
||||
{
|
||||
if (ShouldUsePlatformUserId())
|
||||
{
|
||||
return OnControllerAnalog(KeyName, FPlatformUserId(ControllerId), INPUTDEVICEID_NONE, AnalogValue);
|
||||
// Remap the old int32 ControlerId to the new Platform user for backwards compat
|
||||
FPlatformUserId UserId = FGenericPlatformMisc::GetPlatformUserForUserIndex(ControllerId);
|
||||
FInputDeviceId DeviceId = INPUTDEVICEID_NONE;
|
||||
IPlatformInputDeviceMapper::Get().RemapControllerIdToPlatformUserAndDevice(ControllerId, UserId, DeviceId);
|
||||
return OnControllerAnalog(KeyName, UserId, DeviceId, AnalogValue);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//UE_DEPRECATED(5.1, "This version of OnControllerButtonPressed has been deprecated, please use the one that takes an FPlatformUser and FInputDeviceId instead.")
|
||||
UE_DEPRECATED(5.1, "This version of OnControllerButtonPressed has been deprecated, please use the one that takes an FPlatformUser and FInputDeviceId instead.")
|
||||
virtual bool OnControllerButtonPressed(FGamepadKeyNames::Type KeyName, int32 ControllerId, bool IsRepeat)
|
||||
{
|
||||
if (ShouldUsePlatformUserId())
|
||||
{
|
||||
return OnControllerButtonPressed(KeyName, FPlatformUserId(ControllerId), INPUTDEVICEID_NONE, IsRepeat);
|
||||
// Remap the old int32 ControlerId to the new Platform user for backwards compat
|
||||
FPlatformUserId UserId = FGenericPlatformMisc::GetPlatformUserForUserIndex(ControllerId);
|
||||
FInputDeviceId DeviceId = INPUTDEVICEID_NONE;
|
||||
IPlatformInputDeviceMapper::Get().RemapControllerIdToPlatformUserAndDevice(ControllerId, UserId, DeviceId);
|
||||
return OnControllerButtonPressed(KeyName, UserId, DeviceId, IsRepeat);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//UE_DEPRECATED(5.1, "This version of OnControllerButtonReleased has been deprecated, please use the one that takes an FPlatformUser and FInputDeviceId instead.")
|
||||
UE_DEPRECATED(5.1, "This version of OnControllerButtonReleased has been deprecated, please use the one that takes an FPlatformUser and FInputDeviceId instead.")
|
||||
virtual bool OnControllerButtonReleased(FGamepadKeyNames::Type KeyName, int32 ControllerId, bool IsRepeat)
|
||||
{
|
||||
if (ShouldUsePlatformUserId())
|
||||
{
|
||||
return OnControllerButtonReleased(KeyName, FPlatformUserId(ControllerId), INPUTDEVICEID_NONE, IsRepeat);
|
||||
// Remap the old int32 ControlerId to the new Platform user for backwards compat
|
||||
FPlatformUserId UserId = FGenericPlatformMisc::GetPlatformUserForUserIndex(ControllerId);
|
||||
FInputDeviceId DeviceId = INPUTDEVICEID_NONE;
|
||||
IPlatformInputDeviceMapper::Get().RemapControllerIdToPlatformUserAndDevice(ControllerId, UserId, DeviceId);
|
||||
return OnControllerButtonReleased(KeyName, UserId, DeviceId, IsRepeat);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
virtual bool OnTouchStarted(const TSharedPtr< FGenericWindow >& Window, const FVector2D& Location, float Force, int32 TouchIndex, int32 ControllerId)
|
||||
{
|
||||
{
|
||||
if (ShouldUsePlatformUserId())
|
||||
{
|
||||
return OnTouchStarted(Window, Location, Force, TouchIndex, FPlatformUserId(ControllerId), INPUTDEVICEID_NONE);
|
||||
// Remap the old int32 ControlerId to the new Platform user for backwards compat
|
||||
FPlatformUserId UserId = FGenericPlatformMisc::GetPlatformUserForUserIndex(ControllerId);
|
||||
FInputDeviceId DeviceId = INPUTDEVICEID_NONE;
|
||||
IPlatformInputDeviceMapper::Get().RemapControllerIdToPlatformUserAndDevice(ControllerId, UserId, DeviceId);
|
||||
return OnTouchStarted(Window, Location, Force, TouchIndex, UserId, DeviceId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -552,7 +575,11 @@ public:
|
||||
{
|
||||
if (ShouldUsePlatformUserId())
|
||||
{
|
||||
return OnTouchMoved(Location, Force, TouchIndex, FPlatformUserId(ControllerId), INPUTDEVICEID_NONE);
|
||||
// Remap the old int32 ControlerId to the new Platform user for backwards compat
|
||||
FPlatformUserId UserId = FGenericPlatformMisc::GetPlatformUserForUserIndex(ControllerId);
|
||||
FInputDeviceId DeviceId = INPUTDEVICEID_NONE;
|
||||
IPlatformInputDeviceMapper::Get().RemapControllerIdToPlatformUserAndDevice(ControllerId, UserId, DeviceId);
|
||||
return OnTouchMoved(Location, Force, TouchIndex, UserId, DeviceId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -560,7 +587,11 @@ public:
|
||||
{
|
||||
if (ShouldUsePlatformUserId())
|
||||
{
|
||||
return OnTouchEnded(Location, TouchIndex, FPlatformUserId(ControllerId), INPUTDEVICEID_NONE);
|
||||
// Remap the old int32 ControlerId to the new Platform user for backwards compat
|
||||
FPlatformUserId UserId = FGenericPlatformMisc::GetPlatformUserForUserIndex(ControllerId);
|
||||
FInputDeviceId DeviceId = INPUTDEVICEID_NONE;
|
||||
IPlatformInputDeviceMapper::Get().RemapControllerIdToPlatformUserAndDevice(ControllerId, UserId, DeviceId);
|
||||
return OnTouchEnded(Location, TouchIndex, UserId, DeviceId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -568,7 +599,11 @@ public:
|
||||
{
|
||||
if (ShouldUsePlatformUserId())
|
||||
{
|
||||
return OnTouchForceChanged(Location, Force, TouchIndex, FPlatformUserId(ControllerId), INPUTDEVICEID_NONE);
|
||||
// Remap the old int32 ControlerId to the new Platform user for backwards compat
|
||||
FPlatformUserId UserId = FGenericPlatformMisc::GetPlatformUserForUserIndex(ControllerId);
|
||||
FInputDeviceId DeviceId = INPUTDEVICEID_NONE;
|
||||
IPlatformInputDeviceMapper::Get().RemapControllerIdToPlatformUserAndDevice(ControllerId, UserId, DeviceId);
|
||||
return OnTouchForceChanged(Location, Force, TouchIndex, UserId, DeviceId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -576,7 +611,11 @@ public:
|
||||
{
|
||||
if (ShouldUsePlatformUserId())
|
||||
{
|
||||
return OnTouchFirstMove(Location, Force, TouchIndex, FPlatformUserId(ControllerId), INPUTDEVICEID_NONE);
|
||||
// Remap the old int32 ControlerId to the new Platform user for backwards compat
|
||||
FPlatformUserId UserId = FGenericPlatformMisc::GetPlatformUserForUserIndex(ControllerId);
|
||||
FInputDeviceId DeviceId = INPUTDEVICEID_NONE;
|
||||
IPlatformInputDeviceMapper::Get().RemapControllerIdToPlatformUserAndDevice(ControllerId, UserId, DeviceId);
|
||||
return OnTouchFirstMove(Location, Force, TouchIndex, UserId, DeviceId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -584,7 +623,11 @@ public:
|
||||
{
|
||||
if (ShouldUsePlatformUserId())
|
||||
{
|
||||
return OnMotionDetected(Tilt, RotationRate, Gravity, Acceleration, FPlatformUserId(ControllerId), INPUTDEVICEID_NONE);
|
||||
// Remap the old int32 ControlerId to the new Platform user for backwards compat
|
||||
FPlatformUserId UserId = FGenericPlatformMisc::GetPlatformUserForUserIndex(ControllerId);
|
||||
FInputDeviceId DeviceId = INPUTDEVICEID_NONE;
|
||||
IPlatformInputDeviceMapper::Get().RemapControllerIdToPlatformUserAndDevice(ControllerId, UserId, DeviceId);
|
||||
return OnMotionDetected(Tilt, RotationRate, Gravity, Acceleration, UserId, DeviceId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user