mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-03-11 09:01:08 +00:00
feature: .NET 10 (ryubing/ryujinx!214)
See merge request ryubing/ryujinx!214
This commit is contained in:
@@ -48,36 +48,41 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
private int _controller;
|
||||
private string _controllerImage;
|
||||
private int _device;
|
||||
private object _configViewModel;
|
||||
private bool _isChangeTrackingActive;
|
||||
private string _chosenProfile;
|
||||
[ObservableProperty] private bool _isModified;
|
||||
[ObservableProperty] private string _profileName;
|
||||
[ObservableProperty] private bool _notificationIsVisible; // Automatically call the NotificationView property with OnPropertyChanged()
|
||||
[ObservableProperty] private string _notificationText; // Automatically call the NotificationText property with OnPropertyChanged()
|
||||
[ObservableProperty]
|
||||
public partial bool IsModified { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
public partial string ProfileName { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
public partial bool NotificationIsVisible { get; set; } // Automatically call the NotificationView property with OnPropertyChanged()
|
||||
|
||||
[ObservableProperty]
|
||||
public partial string NotificationText { get; set; } // Automatically call the NotificationText property with OnPropertyChanged()
|
||||
|
||||
private bool _isLoaded;
|
||||
|
||||
private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
||||
|
||||
public IGamepadDriver AvaloniaKeyboardDriver { get; }
|
||||
|
||||
private IGamepad _selectedGamepad;
|
||||
|
||||
public IGamepad SelectedGamepad
|
||||
{
|
||||
get => _selectedGamepad;
|
||||
get;
|
||||
private set
|
||||
{
|
||||
Rainbow.Reset();
|
||||
|
||||
_selectedGamepad = value;
|
||||
field = value;
|
||||
|
||||
if (ConfigViewModel is ControllerInputViewModel { Config.UseRainbowLed: true })
|
||||
Rainbow.Updated += (ref Color color) => _selectedGamepad.SetLed((uint)color.ToArgb());
|
||||
Rainbow.Updated += (ref Color color) => field.SetLed((uint)color.ToArgb());
|
||||
|
||||
OnPropertiesChanged(nameof(HasLed), nameof(CanClearLed));
|
||||
}
|
||||
}
|
||||
|
||||
public StickVisualizer VisualStick { get; private set; }
|
||||
|
||||
public ObservableCollection<PlayerModel> PlayerIndexes { get; set; }
|
||||
@@ -99,15 +104,15 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
public bool CanClearLed => SelectedGamepad.Name.ContainsIgnoreCase("DualSense");
|
||||
|
||||
public event Action NotifyChangesEvent;
|
||||
|
||||
|
||||
public string ChosenProfile
|
||||
{
|
||||
get => _chosenProfile;
|
||||
get;
|
||||
set
|
||||
{
|
||||
// When you select a profile, the settings from the profile will be applied.
|
||||
// To save the settings, you still need to click the apply button
|
||||
_chosenProfile = value;
|
||||
field = value;
|
||||
LoadProfile();
|
||||
OnPropertyChanged();
|
||||
}
|
||||
@@ -115,10 +120,10 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
|
||||
public object ConfigViewModel
|
||||
{
|
||||
get => _configViewModel;
|
||||
get;
|
||||
set
|
||||
{
|
||||
_configViewModel = value;
|
||||
field = value;
|
||||
|
||||
VisualStick.UpdateConfig(value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user