mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-06-05 11:59:15 +00:00
Restore input device default reset behavior
This commit is contained in:
@@ -272,11 +272,13 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
|
||||
if (selected != DeviceType.None)
|
||||
{
|
||||
LoadControllers();
|
||||
|
||||
if (_isLoaded)
|
||||
{
|
||||
LoadConfiguration(LoadDefaultConfiguration());
|
||||
LoadSelectedDeviceDefaults();
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadSelectedDeviceControllers();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,6 +289,21 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetCurrentDeviceToDefaults()
|
||||
{
|
||||
LoadDevices();
|
||||
|
||||
if (_device <= 0 || _device >= Devices.Count || Devices[_device].Type == DeviceType.None)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MarkAsChanged();
|
||||
LoadSelectedDeviceDefaults();
|
||||
FindPairedDeviceInConfigFile();
|
||||
NotifyChanges();
|
||||
}
|
||||
|
||||
public object SelectedDeviceItem
|
||||
{
|
||||
get => _device >= 0 && _device < Devices.Count ? Devices[_device] : null;
|
||||
@@ -503,6 +520,20 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
NotifyChanges();
|
||||
}
|
||||
|
||||
private void LoadSelectedDeviceControllers()
|
||||
{
|
||||
if (_device > 0 && _device < Devices.Count && Devices[_device].Type != DeviceType.None)
|
||||
{
|
||||
LoadControllers();
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadSelectedDeviceDefaults()
|
||||
{
|
||||
LoadSelectedDeviceControllers();
|
||||
LoadConfiguration(LoadDefaultConfiguration());
|
||||
}
|
||||
|
||||
private void LoadInputDriver()
|
||||
{
|
||||
if (_device < 0)
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
MinWidth="0"
|
||||
Margin="5,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding LoadDevices}">
|
||||
Command="{Binding ResetCurrentDeviceToDefaults}">
|
||||
<ui:SymbolIcon
|
||||
Symbol="Refresh"
|
||||
FontSize="15"
|
||||
|
||||
Reference in New Issue
Block a user