mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-06-05 20:09: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)
|
if (selected != DeviceType.None)
|
||||||
{
|
{
|
||||||
LoadControllers();
|
|
||||||
|
|
||||||
if (_isLoaded)
|
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
|
public object SelectedDeviceItem
|
||||||
{
|
{
|
||||||
get => _device >= 0 && _device < Devices.Count ? Devices[_device] : null;
|
get => _device >= 0 && _device < Devices.Count ? Devices[_device] : null;
|
||||||
@@ -503,6 +520,20 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
NotifyChanges();
|
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()
|
private void LoadInputDriver()
|
||||||
{
|
{
|
||||||
if (_device < 0)
|
if (_device < 0)
|
||||||
|
|||||||
@@ -175,7 +175,7 @@
|
|||||||
MinWidth="0"
|
MinWidth="0"
|
||||||
Margin="5,0,0,0"
|
Margin="5,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Command="{Binding LoadDevices}">
|
Command="{Binding ResetCurrentDeviceToDefaults}">
|
||||||
<ui:SymbolIcon
|
<ui:SymbolIcon
|
||||||
Symbol="Refresh"
|
Symbol="Refresh"
|
||||||
FontSize="15"
|
FontSize="15"
|
||||||
|
|||||||
Reference in New Issue
Block a user