Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 52b0b45d34 | |||
| 12f0dbcc70 | |||
| 719be560ec | |||
| 18238736be | |||
| 5d9e4ad7a4 |
@@ -2839,6 +2839,7 @@
|
|||||||
01009B90006DC000,"Super Mario Maker™ 2",online-broken;ldn-broken,playable,2024-08-25 11:05:19
|
01009B90006DC000,"Super Mario Maker™ 2",online-broken;ldn-broken,playable,2024-08-25 11:05:19
|
||||||
0100000000010000,"Super Mario Odyssey™",nvdec;intel-vendor-bug;mac-bug,playable,2024-08-25 01:32:34
|
0100000000010000,"Super Mario Odyssey™",nvdec;intel-vendor-bug;mac-bug,playable,2024-08-25 01:32:34
|
||||||
010036B0034E4000,"Super Mario Party™",gpu;Needs Update;ldn-works,ingame,2024-06-21 05:10:16
|
010036B0034E4000,"Super Mario Party™",gpu;Needs Update;ldn-works,ingame,2024-06-21 05:10:16
|
||||||
|
0100965017338000,"Super Mario Party Jamboree",mac-bug;gpu,ingame,2025-02-17 02:09:20
|
||||||
0100BC0018138000,"Super Mario RPG™",gpu;audio;nvdec,ingame,2024-06-19 17:43:42
|
0100BC0018138000,"Super Mario RPG™",gpu;audio;nvdec,ingame,2024-06-19 17:43:42
|
||||||
,"Super Mario World",homebrew,boots,2024-06-13 01:40:31
|
,"Super Mario World",homebrew,boots,2024-06-13 01:40:31
|
||||||
010049900F546000,"Super Mario™ 3D All-Stars",services-horizon;slow;vulkan;amd-vendor-bug,ingame,2024-05-07 02:38:16
|
010049900F546000,"Super Mario™ 3D All-Stars",services-horizon;slow;vulkan;amd-vendor-bug,ingame,2024-05-07 02:38:16
|
||||||
|
|||||||
|
@@ -53,10 +53,9 @@ namespace Ryujinx.Common
|
|||||||
"0100000000010000", // Super Mario Odyssey
|
"0100000000010000", // Super Mario Odyssey
|
||||||
|
|
||||||
// Further testing is appreciated, I did not test the entire game:
|
// Further testing is appreciated, I did not test the entire game:
|
||||||
"01007300020fa000", // Astral Chain
|
//"010076f0049a2000", // Bayonetta
|
||||||
"010076f0049a2000", // Bayonetta
|
//"0100cf5010fec000", // Bayonetta Origins: Cereza and the Lost Demon
|
||||||
"0100cf5010fec000", // Bayonetta Origins: Cereza and the Lost Demon
|
//"0100f4300bf2c000", // New Pokemon Snap
|
||||||
"0100f4300bf2c000", // New Pokemon Snap
|
|
||||||
];
|
];
|
||||||
|
|
||||||
public static string GetDiscordGameAsset(string titleId)
|
public static string GetDiscordGameAsset(string titleId)
|
||||||
@@ -230,6 +229,7 @@ namespace Ryujinx.Common
|
|||||||
"01008c8012920000", // Dying Light Platinum Edition
|
"01008c8012920000", // Dying Light Platinum Edition
|
||||||
"01001cc01b2d4000", // Goat Simulator 3
|
"01001cc01b2d4000", // Goat Simulator 3
|
||||||
"01003620068ea000", // Hand of Fate 2
|
"01003620068ea000", // Hand of Fate 2
|
||||||
|
"0100f7e00c70e000", // Hogwarts Legacy
|
||||||
"010085500130a000", // Lego City: Undercover
|
"010085500130a000", // Lego City: Undercover
|
||||||
"010073c01af34000", // LEGO Horizon Adventures
|
"010073c01af34000", // LEGO Horizon Adventures
|
||||||
"0100d71004694000", // Minecraft
|
"0100d71004694000", // Minecraft
|
||||||
|
|||||||
@@ -289,7 +289,8 @@ namespace Ryujinx.Headless
|
|||||||
|
|
||||||
DriverUtilities.InitDriverConfig(option.BackendThreading == BackendThreading.Off);
|
DriverUtilities.InitDriverConfig(option.BackendThreading == BackendThreading.Off);
|
||||||
|
|
||||||
if (_inputConfiguration.OfType<StandardControllerInputConfig>().Any(ic => ic.Led.UseRainbow))
|
if (_inputConfiguration.OfType<StandardControllerInputConfig>()
|
||||||
|
.Any(ic => ic?.Led?.UseRainbow ?? false))
|
||||||
Rainbow.Enable();
|
Rainbow.Enable();
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ namespace Ryujinx.Ava
|
|||||||
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 19041))
|
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 19041))
|
||||||
{
|
{
|
||||||
_ = MessageBoxA(nint.Zero, "You are running an outdated version of Windows.\n\nRyujinx supports Windows 10 version 20H1 and newer.\n", $"Ryujinx {Version}", MbIconwarning);
|
_ = MessageBoxA(nint.Zero, "You are running an outdated version of Windows.\n\nRyujinx supports Windows 10 version 20H1 and newer.\n", $"Ryujinx {Version}", MbIconwarning);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreviewerDetached = true;
|
PreviewerDetached = true;
|
||||||
|
|||||||
@@ -1,260 +0,0 @@
|
|||||||
using Ryujinx.Ava.UI.ViewModels;
|
|
||||||
using Ryujinx.Ava.UI.ViewModels.Input;
|
|
||||||
using Ryujinx.Input;
|
|
||||||
using System;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Models.Input
|
|
||||||
{
|
|
||||||
public class StickVisualizer : BaseModel, IDisposable
|
|
||||||
{
|
|
||||||
public const int DrawStickPollRate = 50; // Milliseconds per poll.
|
|
||||||
public const int DrawStickCircumference = 5;
|
|
||||||
public const float DrawStickScaleFactor = DrawStickCanvasCenter;
|
|
||||||
public const int DrawStickCanvasSize = 100;
|
|
||||||
public const int DrawStickBorderSize = DrawStickCanvasSize + 5;
|
|
||||||
public const float DrawStickCanvasCenter = (DrawStickCanvasSize - DrawStickCircumference) / 2;
|
|
||||||
public const float MaxVectorLength = DrawStickCanvasSize / 2;
|
|
||||||
|
|
||||||
public CancellationTokenSource PollTokenSource;
|
|
||||||
public CancellationToken PollToken;
|
|
||||||
|
|
||||||
private static float _vectorLength;
|
|
||||||
private static float _vectorMultiplier;
|
|
||||||
|
|
||||||
private bool disposedValue;
|
|
||||||
|
|
||||||
private DeviceType _type;
|
|
||||||
public DeviceType Type
|
|
||||||
{
|
|
||||||
get => _type;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_type = value;
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private GamepadInputConfig _gamepadConfig;
|
|
||||||
public GamepadInputConfig GamepadConfig
|
|
||||||
{
|
|
||||||
get => _gamepadConfig;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_gamepadConfig = value;
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private KeyboardInputConfig _keyboardConfig;
|
|
||||||
public KeyboardInputConfig KeyboardConfig
|
|
||||||
{
|
|
||||||
get => _keyboardConfig;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_keyboardConfig = value;
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private (float, float) _uiStickLeft;
|
|
||||||
public (float, float) UiStickLeft
|
|
||||||
{
|
|
||||||
get => (_uiStickLeft.Item1 * DrawStickScaleFactor, _uiStickLeft.Item2 * DrawStickScaleFactor);
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_uiStickLeft = value;
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
OnPropertyChanged(nameof(UiStickRightX));
|
|
||||||
OnPropertyChanged(nameof(UiStickRightY));
|
|
||||||
OnPropertyChanged(nameof(UiDeadzoneRight));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private (float, float) _uiStickRight;
|
|
||||||
public (float, float) UiStickRight
|
|
||||||
{
|
|
||||||
get => (_uiStickRight.Item1 * DrawStickScaleFactor, _uiStickRight.Item2 * DrawStickScaleFactor);
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_uiStickRight = value;
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
OnPropertyChanged(nameof(UiStickLeftX));
|
|
||||||
OnPropertyChanged(nameof(UiStickLeftY));
|
|
||||||
OnPropertyChanged(nameof(UiDeadzoneLeft));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public float UiStickLeftX => ClampVector(UiStickLeft).Item1;
|
|
||||||
public float UiStickLeftY => ClampVector(UiStickLeft).Item2;
|
|
||||||
public float UiStickRightX => ClampVector(UiStickRight).Item1;
|
|
||||||
public float UiStickRightY => ClampVector(UiStickRight).Item2;
|
|
||||||
|
|
||||||
public int UiStickCircumference => DrawStickCircumference;
|
|
||||||
public int UiCanvasSize => DrawStickCanvasSize;
|
|
||||||
public int UiStickBorderSize => DrawStickBorderSize;
|
|
||||||
|
|
||||||
public float? UiDeadzoneLeft => _gamepadConfig?.DeadzoneLeft * DrawStickCanvasSize - DrawStickCircumference;
|
|
||||||
public float? UiDeadzoneRight => _gamepadConfig?.DeadzoneRight * DrawStickCanvasSize - DrawStickCircumference;
|
|
||||||
|
|
||||||
private InputViewModel Parent;
|
|
||||||
|
|
||||||
public StickVisualizer(InputViewModel parent)
|
|
||||||
{
|
|
||||||
Parent = parent;
|
|
||||||
|
|
||||||
PollTokenSource = new CancellationTokenSource();
|
|
||||||
PollToken = PollTokenSource.Token;
|
|
||||||
|
|
||||||
Task.Run(Initialize, PollToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UpdateConfig(object config)
|
|
||||||
{
|
|
||||||
if (config is ControllerInputViewModel padConfig)
|
|
||||||
{
|
|
||||||
GamepadConfig = padConfig.Config;
|
|
||||||
Type = DeviceType.Controller;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (config is KeyboardInputViewModel keyConfig)
|
|
||||||
{
|
|
||||||
KeyboardConfig = keyConfig.Config;
|
|
||||||
Type = DeviceType.Keyboard;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Type = DeviceType.None;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Initialize()
|
|
||||||
{
|
|
||||||
(float, float) leftBuffer;
|
|
||||||
(float, float) rightBuffer;
|
|
||||||
|
|
||||||
while (!PollToken.IsCancellationRequested)
|
|
||||||
{
|
|
||||||
leftBuffer = (0f, 0f);
|
|
||||||
rightBuffer = (0f, 0f);
|
|
||||||
|
|
||||||
switch (Type)
|
|
||||||
{
|
|
||||||
case DeviceType.Keyboard:
|
|
||||||
IKeyboard keyboard = (IKeyboard)Parent.AvaloniaKeyboardDriver.GetGamepad("0");
|
|
||||||
|
|
||||||
if (keyboard != null)
|
|
||||||
{
|
|
||||||
KeyboardStateSnapshot snapshot = keyboard.GetKeyboardStateSnapshot();
|
|
||||||
|
|
||||||
if (snapshot.IsPressed((Key)KeyboardConfig.LeftStickRight))
|
|
||||||
{
|
|
||||||
leftBuffer.Item1 += 1;
|
|
||||||
}
|
|
||||||
if (snapshot.IsPressed((Key)KeyboardConfig.LeftStickLeft))
|
|
||||||
{
|
|
||||||
leftBuffer.Item1 -= 1;
|
|
||||||
}
|
|
||||||
if (snapshot.IsPressed((Key)KeyboardConfig.LeftStickUp))
|
|
||||||
{
|
|
||||||
leftBuffer.Item2 += 1;
|
|
||||||
}
|
|
||||||
if (snapshot.IsPressed((Key)KeyboardConfig.LeftStickDown))
|
|
||||||
{
|
|
||||||
leftBuffer.Item2 -= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (snapshot.IsPressed((Key)KeyboardConfig.RightStickRight))
|
|
||||||
{
|
|
||||||
rightBuffer.Item1 += 1;
|
|
||||||
}
|
|
||||||
if (snapshot.IsPressed((Key)KeyboardConfig.RightStickLeft))
|
|
||||||
{
|
|
||||||
rightBuffer.Item1 -= 1;
|
|
||||||
}
|
|
||||||
if (snapshot.IsPressed((Key)KeyboardConfig.RightStickUp))
|
|
||||||
{
|
|
||||||
rightBuffer.Item2 += 1;
|
|
||||||
}
|
|
||||||
if (snapshot.IsPressed((Key)KeyboardConfig.RightStickDown))
|
|
||||||
{
|
|
||||||
rightBuffer.Item2 -= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
UiStickLeft = leftBuffer;
|
|
||||||
UiStickRight = rightBuffer;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DeviceType.Controller:
|
|
||||||
IGamepad controller = Parent.SelectedGamepad;
|
|
||||||
|
|
||||||
if (controller != null)
|
|
||||||
{
|
|
||||||
leftBuffer = controller.GetStick((StickInputId)GamepadConfig.LeftJoystick);
|
|
||||||
rightBuffer = controller.GetStick((StickInputId)GamepadConfig.RightJoystick);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DeviceType.None:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new ArgumentException($"Unable to poll device type \"{Type}\"");
|
|
||||||
}
|
|
||||||
|
|
||||||
UiStickLeft = leftBuffer;
|
|
||||||
UiStickRight = rightBuffer;
|
|
||||||
|
|
||||||
await Task.Delay(DrawStickPollRate, PollToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
PollTokenSource.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static (float, float) ClampVector((float, float) vect)
|
|
||||||
{
|
|
||||||
_vectorMultiplier = 1;
|
|
||||||
_vectorLength = MathF.Sqrt((vect.Item1 * vect.Item1) + (vect.Item2 * vect.Item2));
|
|
||||||
|
|
||||||
if (_vectorLength > MaxVectorLength)
|
|
||||||
{
|
|
||||||
_vectorMultiplier = MaxVectorLength / _vectorLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
vect.Item1 = vect.Item1 * _vectorMultiplier + DrawStickCanvasCenter;
|
|
||||||
vect.Item2 = vect.Item2 * _vectorMultiplier + DrawStickCanvasCenter;
|
|
||||||
|
|
||||||
return vect;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void Dispose(bool disposing)
|
|
||||||
{
|
|
||||||
if (!disposedValue)
|
|
||||||
{
|
|
||||||
if (disposing)
|
|
||||||
{
|
|
||||||
PollTokenSource.Cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyboardConfig = null;
|
|
||||||
GamepadConfig = null;
|
|
||||||
Parent = null;
|
|
||||||
|
|
||||||
disposedValue = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
Dispose(disposing: true);
|
|
||||||
GC.SuppressFinalize(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,5 @@
|
|||||||
using Avalonia.Svg.Skia;
|
using Avalonia.Svg.Skia;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using CommunityToolkit.Mvvm.Input;
|
|
||||||
using FluentAvalonia.UI.Controls;
|
|
||||||
using Ryujinx.Ava.Input;
|
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
|
||||||
using Ryujinx.Ava.UI.Models.Input;
|
using Ryujinx.Ava.UI.Models.Input;
|
||||||
using Ryujinx.Ava.UI.Views.Input;
|
using Ryujinx.Ava.UI.Views.Input;
|
||||||
using Ryujinx.Common.Utilities;
|
using Ryujinx.Common.Utilities;
|
||||||
@@ -14,30 +10,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
{
|
{
|
||||||
public partial class ControllerInputViewModel : BaseModel
|
public partial class ControllerInputViewModel : BaseModel
|
||||||
{
|
{
|
||||||
private GamepadInputConfig _config;
|
[ObservableProperty] private GamepadInputConfig _config;
|
||||||
public GamepadInputConfig Config
|
|
||||||
{
|
|
||||||
get => _config;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_config = value;
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private StickVisualizer _visualizer;
|
|
||||||
public StickVisualizer Visualizer
|
|
||||||
{
|
|
||||||
get => _visualizer;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_visualizer = value;
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool _isLeft;
|
private bool _isLeft;
|
||||||
public bool IsLeft
|
public bool IsLeft
|
||||||
{
|
{
|
||||||
@@ -63,15 +37,14 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
}
|
}
|
||||||
|
|
||||||
public bool HasSides => IsLeft ^ IsRight;
|
public bool HasSides => IsLeft ^ IsRight;
|
||||||
|
|
||||||
[ObservableProperty] private SvgImage _image;
|
[ObservableProperty] private SvgImage _image;
|
||||||
|
|
||||||
public InputViewModel ParentModel { get; }
|
public InputViewModel ParentModel { get; }
|
||||||
|
|
||||||
public ControllerInputViewModel(InputViewModel model, GamepadInputConfig config, StickVisualizer visualizer)
|
public ControllerInputViewModel(InputViewModel model, GamepadInputConfig config)
|
||||||
{
|
{
|
||||||
ParentModel = model;
|
ParentModel = model;
|
||||||
Visualizer = visualizer;
|
|
||||||
model.NotifyChangesEvent += OnParentModelChanged;
|
model.NotifyChangesEvent += OnParentModelChanged;
|
||||||
OnParentModelChanged();
|
OnParentModelChanged();
|
||||||
config.PropertyChanged += (_, args) =>
|
config.PropertyChanged += (_, args) =>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ 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;
|
[ObservableProperty] private object _configViewModel;
|
||||||
[ObservableProperty] private string _profileName;
|
[ObservableProperty] private string _profileName;
|
||||||
private bool _isLoaded;
|
private bool _isLoaded;
|
||||||
|
|
||||||
@@ -74,7 +74,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
OnPropertiesChanged(nameof(HasLed), nameof(CanClearLed));
|
OnPropertiesChanged(nameof(HasLed), nameof(CanClearLed));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public StickVisualizer VisualStick { get; private set; }
|
|
||||||
|
|
||||||
public ObservableCollection<PlayerModel> PlayerIndexes { get; set; }
|
public ObservableCollection<PlayerModel> PlayerIndexes { get; set; }
|
||||||
public ObservableCollection<(DeviceType Type, string Id, string Name)> Devices { get; set; }
|
public ObservableCollection<(DeviceType Type, string Id, string Name)> Devices { get; set; }
|
||||||
@@ -95,19 +94,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;
|
|
||||||
|
|
||||||
VisualStick.UpdateConfig(value);
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public PlayerIndex PlayerIdChoose
|
public PlayerIndex PlayerIdChoose
|
||||||
{
|
{
|
||||||
get => _playerIdChoose;
|
get => _playerIdChoose;
|
||||||
@@ -283,7 +269,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
Devices = [];
|
Devices = [];
|
||||||
ProfilesList = [];
|
ProfilesList = [];
|
||||||
DeviceList = [];
|
DeviceList = [];
|
||||||
VisualStick = new StickVisualizer(this);
|
|
||||||
|
|
||||||
ControllerImage = ProControllerResource;
|
ControllerImage = ProControllerResource;
|
||||||
|
|
||||||
@@ -304,12 +289,12 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
if (Config is StandardKeyboardInputConfig keyboardInputConfig)
|
if (Config is StandardKeyboardInputConfig keyboardInputConfig)
|
||||||
{
|
{
|
||||||
ConfigViewModel = new KeyboardInputViewModel(this, new KeyboardInputConfig(keyboardInputConfig), VisualStick);
|
ConfigViewModel = new KeyboardInputViewModel(this, new KeyboardInputConfig(keyboardInputConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config is StandardControllerInputConfig controllerInputConfig)
|
if (Config is StandardControllerInputConfig controllerInputConfig)
|
||||||
{
|
{
|
||||||
ConfigViewModel = new ControllerInputViewModel(this, new GamepadInputConfig(controllerInputConfig), VisualStick);
|
ConfigViewModel = new ControllerInputViewModel(this, new GamepadInputConfig(controllerInputConfig));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -908,8 +893,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
_mainWindow.ViewModel.AppHost?.NpadManager.UnblockInputUpdates();
|
_mainWindow.ViewModel.AppHost?.NpadManager.UnblockInputUpdates();
|
||||||
|
|
||||||
VisualStick.Dispose();
|
|
||||||
|
|
||||||
SelectedGamepad?.Dispose();
|
SelectedGamepad?.Dispose();
|
||||||
|
|
||||||
AvaloniaKeyboardDriver.Dispose();
|
AvaloniaKeyboardDriver.Dispose();
|
||||||
|
|||||||
@@ -6,29 +6,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
{
|
{
|
||||||
public partial class KeyboardInputViewModel : BaseModel
|
public partial class KeyboardInputViewModel : BaseModel
|
||||||
{
|
{
|
||||||
private KeyboardInputConfig _config;
|
[ObservableProperty] private KeyboardInputConfig _config;
|
||||||
public KeyboardInputConfig Config
|
|
||||||
{
|
|
||||||
get => _config;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_config = value;
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private StickVisualizer _visualizer;
|
|
||||||
public StickVisualizer Visualizer
|
|
||||||
{
|
|
||||||
get => _visualizer;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_visualizer = value;
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool _isLeft;
|
private bool _isLeft;
|
||||||
public bool IsLeft
|
public bool IsLeft
|
||||||
@@ -60,10 +38,9 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
public readonly InputViewModel ParentModel;
|
public readonly InputViewModel ParentModel;
|
||||||
|
|
||||||
public KeyboardInputViewModel(InputViewModel model, KeyboardInputConfig config, StickVisualizer visualizer)
|
public KeyboardInputViewModel(InputViewModel model, KeyboardInputConfig config)
|
||||||
{
|
{
|
||||||
ParentModel = model;
|
ParentModel = model;
|
||||||
Visualizer = visualizer;
|
|
||||||
model.NotifyChangesEvent += OnParentModelChanged;
|
model.NotifyChangesEvent += OnParentModelChanged;
|
||||||
OnParentModelChanged();
|
OnParentModelChanged();
|
||||||
Config = config;
|
Config = config;
|
||||||
|
|||||||
@@ -316,103 +316,17 @@
|
|||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch">
|
VerticalAlignment="Stretch">
|
||||||
<!-- Controller Picture -->
|
<!-- Controller Picture -->
|
||||||
|
<Image
|
||||||
|
Margin="0,10"
|
||||||
|
MaxHeight="300"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
Source="{Binding Image}" />
|
||||||
<Border
|
<Border
|
||||||
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
CornerRadius="5"
|
CornerRadius="5"
|
||||||
Margin="0,10"
|
|
||||||
MinHeight="90">
|
MinHeight="90">
|
||||||
<StackPanel Orientation="Vertical">
|
|
||||||
<Image
|
|
||||||
Margin="5,10"
|
|
||||||
MaxHeight="300"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Stretch"
|
|
||||||
Source="{Binding Image}" />
|
|
||||||
<StackPanel
|
|
||||||
Margin="10"
|
|
||||||
Orientation="Horizontal"
|
|
||||||
Spacing="20"
|
|
||||||
HorizontalAlignment="Center">
|
|
||||||
<Border
|
|
||||||
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="5"
|
|
||||||
Height="{Binding Visualizer.UiStickBorderSize}"
|
|
||||||
Width="{Binding Visualizer.UiStickBorderSize}"
|
|
||||||
IsVisible="{Binding IsLeft}">
|
|
||||||
<Canvas
|
|
||||||
Background="{DynamicResource ThemeBackgroundColor}"
|
|
||||||
Height="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Width="{Binding Visualizer.UiCanvasSize}">
|
|
||||||
<Grid
|
|
||||||
Height="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Width="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Background="{DynamicResource ThemeBackgroundColor}">
|
|
||||||
<Ellipse
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Stroke="Black"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Width="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Height="{Binding Visualizer.UiCanvasSize}" />
|
|
||||||
<Ellipse
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Fill="Gray"
|
|
||||||
Opacity="100"
|
|
||||||
Height="{Binding Visualizer.UiDeadzoneLeft}"
|
|
||||||
Width="{Binding Visualizer.UiDeadzoneLeft}" />
|
|
||||||
</Grid>
|
|
||||||
<Ellipse
|
|
||||||
Fill="Red"
|
|
||||||
Width="{Binding Visualizer.UiStickCircumference}"
|
|
||||||
Height="{Binding Visualizer.UiStickCircumference}"
|
|
||||||
Canvas.Bottom="{Binding Visualizer.UiStickLeftY}"
|
|
||||||
Canvas.Left="{Binding Visualizer.UiStickLeftX}" />
|
|
||||||
</Canvas>
|
|
||||||
</Border>
|
|
||||||
<Border
|
|
||||||
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="5"
|
|
||||||
Height="{Binding Visualizer.UiStickBorderSize}"
|
|
||||||
Width="{Binding Visualizer.UiStickBorderSize}"
|
|
||||||
IsVisible="{Binding IsRight}">
|
|
||||||
<Canvas
|
|
||||||
Background="{DynamicResource ThemeBackgroundColor}"
|
|
||||||
Height="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Width="{Binding Visualizer.UiCanvasSize}">
|
|
||||||
<Grid
|
|
||||||
Height="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Width="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Background="{DynamicResource ThemeBackgroundColor}">
|
|
||||||
<Ellipse
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Stroke="Black"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Width="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Height="{Binding Visualizer.UiCanvasSize}" />
|
|
||||||
<Ellipse
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Fill="Gray"
|
|
||||||
Opacity="100"
|
|
||||||
Height="{Binding Visualizer.UiDeadzoneRight}"
|
|
||||||
Width="{Binding Visualizer.UiDeadzoneRight}" />
|
|
||||||
</Grid>
|
|
||||||
<Ellipse
|
|
||||||
Fill="Red"
|
|
||||||
Width="{Binding Visualizer.UiStickCircumference}"
|
|
||||||
Height="{Binding Visualizer.UiStickCircumference}"
|
|
||||||
Canvas.Bottom="{Binding Visualizer.UiStickRightY}"
|
|
||||||
Canvas.Left="{Binding Visualizer.UiStickRightX}" />
|
|
||||||
</Canvas>
|
|
||||||
</Border>
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
<Border
|
|
||||||
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="5">
|
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Margin="8"
|
Margin="8"
|
||||||
Orientation="Vertical">
|
Orientation="Vertical">
|
||||||
@@ -431,8 +345,8 @@
|
|||||||
Minimum="0"
|
Minimum="0"
|
||||||
Value="{Binding Config.TriggerThreshold, Mode=TwoWay}" />
|
Value="{Binding Config.TriggerThreshold, Mode=TwoWay}" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Width="25"
|
Width="25"
|
||||||
Text="{Binding Config.TriggerThreshold, StringFormat=\{0:0.00\}}" />
|
Text="{Binding Config.TriggerThreshold, StringFormat=\{0:0.00\}}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
|
|||||||
@@ -309,79 +309,12 @@
|
|||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch">
|
VerticalAlignment="Stretch">
|
||||||
<!-- Controller Picture -->
|
<!-- Controller Picture -->
|
||||||
<Border
|
<Image
|
||||||
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="5"
|
|
||||||
Margin="0,10"
|
Margin="0,10"
|
||||||
MinHeight="90">
|
MaxHeight="300"
|
||||||
<StackPanel
|
HorizontalAlignment="Stretch"
|
||||||
Margin="10"
|
VerticalAlignment="Stretch"
|
||||||
Orientation="Horizontal"
|
Source="{Binding Image}" />
|
||||||
Spacing="20"
|
|
||||||
HorizontalAlignment="Center">
|
|
||||||
<Border
|
|
||||||
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="5"
|
|
||||||
Height="{Binding Visualizer.UiStickBorderSize}"
|
|
||||||
Width="{Binding Visualizer.UiStickBorderSize}"
|
|
||||||
IsVisible="{Binding IsLeft}">
|
|
||||||
<Canvas
|
|
||||||
Background="{DynamicResource ThemeBackgroundColor}"
|
|
||||||
Height="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Width="{Binding Visualizer.UiCanvasSize}">
|
|
||||||
<Grid
|
|
||||||
Height="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Width="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Background="{DynamicResource ThemeBackgroundColor}">
|
|
||||||
<Ellipse
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Stroke="Black"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Width="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Height="{Binding Visualizer.UiCanvasSize}"/>
|
|
||||||
</Grid>
|
|
||||||
<Ellipse
|
|
||||||
Fill="Red"
|
|
||||||
Width="{Binding Visualizer.UiStickCircumference}"
|
|
||||||
Height="{Binding Visualizer.UiStickCircumference}"
|
|
||||||
Canvas.Bottom="{Binding Visualizer.UiStickLeftY}"
|
|
||||||
Canvas.Left="{Binding Visualizer.UiStickLeftX}" />
|
|
||||||
</Canvas>
|
|
||||||
</Border>
|
|
||||||
<Border
|
|
||||||
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="5"
|
|
||||||
Height="{Binding Visualizer.UiStickBorderSize}"
|
|
||||||
Width="{Binding Visualizer.UiStickBorderSize}"
|
|
||||||
IsVisible="{Binding IsRight}">
|
|
||||||
<Canvas
|
|
||||||
Background="{DynamicResource ThemeBackgroundColor}"
|
|
||||||
Height="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Width="{Binding Visualizer.UiCanvasSize}">
|
|
||||||
<Grid
|
|
||||||
Height="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Width="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Background="{DynamicResource ThemeBackgroundColor}">
|
|
||||||
<Ellipse
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Stroke="Black"
|
|
||||||
StrokeThickness="1"
|
|
||||||
Width="{Binding Visualizer.UiCanvasSize}"
|
|
||||||
Height="{Binding Visualizer.UiCanvasSize}"/>
|
|
||||||
</Grid>
|
|
||||||
<Ellipse
|
|
||||||
Fill="Red"
|
|
||||||
Width="{Binding Visualizer.UiStickCircumference}"
|
|
||||||
Height="{Binding Visualizer.UiStickCircumference}"
|
|
||||||
Canvas.Bottom="{Binding Visualizer.UiStickRightY}"
|
|
||||||
Canvas.Left="{Binding Visualizer.UiStickRightX}" />
|
|
||||||
</Canvas>
|
|
||||||
</Border>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
<Border
|
<Border
|
||||||
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
||||||
xmlns:helper="clr-namespace:Ryujinx.Common.Helper;assembly=Ryujinx.Common"
|
xmlns:helper="clr-namespace:Ryujinx.Common.Helper;assembly=Ryujinx.Common"
|
||||||
Width="1100"
|
Width="1100"
|
||||||
Height="850"
|
Height="768"
|
||||||
MinWidth="800"
|
MinWidth="800"
|
||||||
MinHeight="480"
|
MinHeight="480"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
|
|||||||
Reference in New Issue
Block a user