|
@@ -1,9 +1,8 @@
|
|
|
-using Avalonia;
|
|
|
|
|
using Avalonia.Collections;
|
|
using Avalonia.Collections;
|
|
|
using Avalonia.Controls;
|
|
using Avalonia.Controls;
|
|
|
-using Avalonia.Controls.ApplicationLifetimes;
|
|
|
|
|
using Avalonia.Svg.Skia;
|
|
using Avalonia.Svg.Skia;
|
|
|
using Avalonia.Threading;
|
|
using Avalonia.Threading;
|
|
|
|
|
+using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
using Ryujinx.Ava.Common.Locale;
|
|
using Ryujinx.Ava.Common.Locale;
|
|
|
using Ryujinx.Ava.Input;
|
|
using Ryujinx.Ava.Input;
|
|
|
using Ryujinx.Ava.UI.Helpers;
|
|
using Ryujinx.Ava.UI.Helpers;
|
|
@@ -32,7 +31,7 @@ using Key = Ryujinx.Common.Configuration.Hid.Key;
|
|
|
|
|
|
|
|
namespace Ryujinx.Ava.UI.ViewModels.Input
|
|
namespace Ryujinx.Ava.UI.ViewModels.Input
|
|
|
{
|
|
{
|
|
|
- public class InputViewModel : BaseModel, IDisposable
|
|
|
|
|
|
|
+ public partial class InputViewModel : BaseModel, IDisposable
|
|
|
{
|
|
{
|
|
|
private const string Disabled = "disabled";
|
|
private const string Disabled = "disabled";
|
|
|
private const string ProControllerResource = "Ryujinx/Assets/Icons/Controller_ProCon.svg";
|
|
private const string ProControllerResource = "Ryujinx/Assets/Icons/Controller_ProCon.svg";
|
|
@@ -48,8 +47,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|
|
private int _controller;
|
|
private int _controller;
|
|
|
private string _controllerImage;
|
|
private string _controllerImage;
|
|
|
private int _device;
|
|
private int _device;
|
|
|
- private object _configViewModel;
|
|
|
|
|
- private string _profileName;
|
|
|
|
|
|
|
+ [ObservableProperty] private object _configViewModel;
|
|
|
|
|
+ [ObservableProperty] private string _profileName;
|
|
|
private bool _isLoaded;
|
|
private bool _isLoaded;
|
|
|
|
|
|
|
|
private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
|
private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
|
@@ -73,17 +72,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|
|
public bool IsModified { get; set; }
|
|
public bool IsModified { get; set; }
|
|
|
public event Action NotifyChangesEvent;
|
|
public event Action NotifyChangesEvent;
|
|
|
|
|
|
|
|
- public object ConfigViewModel
|
|
|
|
|
- {
|
|
|
|
|
- get => _configViewModel;
|
|
|
|
|
- set
|
|
|
|
|
- {
|
|
|
|
|
- _configViewModel = value;
|
|
|
|
|
-
|
|
|
|
|
- OnPropertyChanged();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public PlayerIndex PlayerIdChoose
|
|
public PlayerIndex PlayerIdChoose
|
|
|
{
|
|
{
|
|
|
get => _playerIdChoose;
|
|
get => _playerIdChoose;
|
|
@@ -200,16 +188,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public string ProfileName
|
|
|
|
|
- {
|
|
|
|
|
- get => _profileName; set
|
|
|
|
|
- {
|
|
|
|
|
- _profileName = value;
|
|
|
|
|
-
|
|
|
|
|
- OnPropertyChanged();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public int Device
|
|
public int Device
|
|
|
{
|
|
{
|
|
|
get => _device;
|
|
get => _device;
|