mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-15 09:35:27 +00:00
Avalonia - Use loaded config when assigning controller input (#3447)
* Use loaded config when assigning controller input * Fix crash when switch player in controller window
This commit is contained in:
parent
d86a116e1e
commit
bccf5e8b5a
|
@ -8,6 +8,7 @@ using Avalonia.Threading;
|
|||
using Avalonia.VisualTree;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Ui.Controls;
|
||||
using Ryujinx.Ava.Ui.Models;
|
||||
using Ryujinx.Ava.Ui.ViewModels;
|
||||
using Ryujinx.Common.Configuration.Hid;
|
||||
using Ryujinx.Common.Configuration.Hid.Controller;
|
||||
|
@ -127,9 +128,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
|||
}
|
||||
else if (device.Type == Models.DeviceType.Controller)
|
||||
{
|
||||
InputConfig config = ConfigurationState.Instance.Hid.InputConfig.Value.Find(inputConfig => inputConfig.Id == ViewModel.SelectedGamepad.Id);
|
||||
|
||||
assigner = new GamepadButtonAssigner(ViewModel.SelectedGamepad, (config as StandardControllerInputConfig).TriggerThreshold, forStick);
|
||||
assigner = new GamepadButtonAssigner(ViewModel.SelectedGamepad, (ViewModel.Config as StandardControllerInputConfig).TriggerThreshold, forStick);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -184,8 +183,8 @@ namespace Ryujinx.Ava.Ui.Windows
|
|||
|
||||
if (e.AddedItems.Count > 0)
|
||||
{
|
||||
(PlayerIndex key, _) = (KeyValuePair<PlayerIndex, string>)e.AddedItems[0];
|
||||
ViewModel.PlayerId = key;
|
||||
var player = (PlayerModel)e.AddedItems[0];
|
||||
ViewModel.PlayerId = player.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue