This commit is contained in:
IvonWei
2025-01-19 21:49:50 +01:00
committed by GitHub
52 changed files with 11901 additions and 493 deletions

View File

@@ -10,6 +10,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
[ObservableProperty] private GamepadInputConfig _config;
private bool _isLeft;
public bool IsLeft
{
get => _isLeft;
@@ -22,6 +23,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
}
private bool _isRight;
public bool IsRight
{
get => _isRight;
@@ -39,6 +41,10 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
public readonly InputViewModel ParentModel;
[ObservableProperty] private string _leftStickPosition;
[ObservableProperty] private string _rightStickPosition;
public ControllerInputViewModel(InputViewModel model, GamepadInputConfig config)
{
ParentModel = model;
@@ -63,5 +69,10 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
IsRight = ParentModel.IsRight;
Image = ParentModel.Image;
}
public void UpdateImageCss(string css)
{
Image = new SvgImage { Source = ParentModel.Image.Source, Css = css };
}
}
}

View File

@@ -36,8 +36,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
private const string Disabled = "disabled";
private const string ProControllerResource = "Ryujinx/Assets/Icons/Controller_ProCon.svg";
private const string JoyConPairResource = "Ryujinx/Assets/Icons/Controller_JoyConPair.svg";
private const string JoyConLeftResource = "Ryujinx/Assets/Icons/Controller_JoyConLeft.svg";
private const string JoyConRightResource = "Ryujinx/Assets/Icons/Controller_JoyConRight.svg";
private const string JoyConLeftResource = "Ryujinx/Assets/Icons/Controller_JoyConLeft_Settings.svg";
private const string JoyConRightResource = "Ryujinx/Assets/Icons/Controller_JoyConRight_Settings.svg";
private const string KeyboardString = "keyboard";
private const string ControllerString = "controller";
private readonly MainWindow _mainWindow;
@@ -183,7 +183,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
image.Source = source;
}
return image;
}
}
@@ -580,7 +579,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
config = new StandardControllerInputConfig
{
Version = InputConfig.CurrentVersion,
Backend = InputBackendType.GamepadSDL2,
Backend = InputBackendType.GamepadSDL3,
Id = id,
ControllerType = ControllerType.ProController,
DeadzoneLeft = 0.1f,

View File

@@ -5,7 +5,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
using Gommon;
using LibHac.Tools.FsSystem;
using Ryujinx.Audio.Backends.OpenAL;
using Ryujinx.Audio.Backends.SDL2;
using Ryujinx.Audio.Backends.SDL3;
using Ryujinx.Audio.Backends.SoundIo;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Helpers;
@@ -211,7 +211,7 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool EnableDebug { get; set; }
public bool IsOpenAlEnabled { get; set; }
public bool IsSoundIoEnabled { get; set; }
public bool IsSDL2Enabled { get; set; }
public bool IsSDL3Enabled { get; set; }
public bool IsCustomResolutionScaleActive => _resolutionScale == 4;
public bool IsScalingFilterActive => _scalingFilter == (int)Ryujinx.Common.Configuration.ScalingFilter.Fsr;
@@ -372,13 +372,13 @@ namespace Ryujinx.Ava.UI.ViewModels
{
IsOpenAlEnabled = OpenALHardwareDeviceDriver.IsSupported;
IsSoundIoEnabled = SoundIoHardwareDeviceDriver.IsSupported;
IsSDL2Enabled = SDL2HardwareDeviceDriver.IsSupported;
IsSDL3Enabled = SDL3HardwareDeviceDriver.IsSupported;
await Dispatcher.UIThread.InvokeAsync(() =>
{
OnPropertyChanged(nameof(IsOpenAlEnabled));
OnPropertyChanged(nameof(IsSoundIoEnabled));
OnPropertyChanged(nameof(IsSDL2Enabled));
OnPropertyChanged(nameof(IsSDL3Enabled));
});
}