diff options
| author | Mary <me@thog.eu> | 2021-05-16 17:12:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-16 17:12:14 +0200 |
| commit | bec67dbef7a505fb5c4a1734be1517f67474fb4d (patch) | |
| tree | 3a0353d8e0fce1c8e02544b465eb1d3aacadf125 /Ryujinx.Input/Motion | |
| parent | f48828351c759ef63e015ca9806406fab278c458 (diff) | |
misc: Move configuration management to the Ryujinx project (#2269)
* Decouple configuration from Ryujinx.HLE and Ryujinx.Input
* Move Configuration to the Ryujinx project
Diffstat (limited to 'Ryujinx.Input/Motion')
| -rw-r--r-- | Ryujinx.Input/Motion/CemuHook/Client.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Ryujinx.Input/Motion/CemuHook/Client.cs b/Ryujinx.Input/Motion/CemuHook/Client.cs index 395bd0b3..214e23f0 100644 --- a/Ryujinx.Input/Motion/CemuHook/Client.cs +++ b/Ryujinx.Input/Motion/CemuHook/Client.cs @@ -4,7 +4,7 @@ using Ryujinx.Common.Configuration.Hid; using Ryujinx.Common.Configuration.Hid.Controller; using Ryujinx.Common.Configuration.Hid.Controller.Motion; using Ryujinx.Common.Logging; -using Ryujinx.Configuration; +using Ryujinx.Input.HLE; using Ryujinx.Input.Motion.CemuHook.Protocol; using System; using System.Collections.Generic; @@ -29,12 +29,14 @@ namespace Ryujinx.Input.Motion.CemuHook private readonly bool[] _clientErrorStatus = new bool[Enum.GetValues(typeof(PlayerIndex)).Length]; private readonly long[] _clientRetryTimer = new long[Enum.GetValues(typeof(PlayerIndex)).Length]; + private NpadManager _npadManager; - public Client() + public Client(NpadManager npadManager) { - _hosts = new Dictionary<int, IPEndPoint>(); - _motionData = new Dictionary<int, Dictionary<int, MotionInput>>(); - _clients = new Dictionary<int, UdpClient>(); + _npadManager = npadManager; + _hosts = new Dictionary<int, IPEndPoint>(); + _motionData = new Dictionary<int, Dictionary<int, MotionInput>>(); + _clients = new Dictionary<int, UdpClient>(); CloseClients(); } @@ -323,7 +325,7 @@ namespace Ryujinx.Input.Motion.CemuHook ulong timestamp = inputData.MotionTimestamp; - InputConfig config = ConfigurationState.Instance.Hid.InputConfig.Value.Find(x => x.PlayerIndex == (PlayerIndex)clientId); + InputConfig config = _npadManager.GetPlayerInputConfigByIndex(clientId); lock (_motionData) { |
