From b53e7ffd46b5c4ac5c4ac3dcc24385b2c9dc4fa4 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> Date: Mon, 22 May 2023 00:16:20 +0100 Subject: [PATCH] Ava UI: Input Menu Redesign (#4990) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Cleanup * Remove redundant locales * Start SVG Fixes… Better +/- buttons Fix the grips Bumpers Better directional pad More SVG stuff Grip adjustments Final stuff * Make image bigger * Border radius * More cleanup * Restructure * Restructure Rumble View * Use compiled bindings where possible * Round those pesky corners * Ack Suggestions * More suggestions * Update src/Ryujinx.Ava/UI/Views/Input/RumbleInputView.axaml.cs Co-authored-by: Ac_K --------- Co-authored-by: Ac_K --- src/Ryujinx.Ava/Assets/Locales/en_US.json | 29 +- ...ewModel.cs => ControllerInputViewModel.cs} | 11 +- .../UI/ViewModels/MotionInputViewModel.cs | 93 +++ .../UI/ViewModels/RumbleInputViewModel.cs | 27 + .../Input/ControllerInputView.axaml} | 602 +++++++++--------- .../Input/ControllerInputView.axaml.cs} | 11 +- .../Input/MotionInputView.axaml} | 104 +-- .../Input/MotionInputView.axaml.cs} | 43 +- .../Input/RumbleInputView.axaml} | 7 +- .../Input/RumbleInputView.axaml.cs} | 37 +- .../UI/Views/Settings/SettingsInputView.axaml | 70 +- .../Resources/Controller_ProCon.svg | 133 +++- 12 files changed, 731 insertions(+), 436 deletions(-) rename src/Ryujinx.Ava/UI/ViewModels/{ControllerSettingsViewModel.cs => ControllerInputViewModel.cs} (99%) create mode 100644 src/Ryujinx.Ava/UI/ViewModels/MotionInputViewModel.cs create mode 100644 src/Ryujinx.Ava/UI/ViewModels/RumbleInputViewModel.cs rename src/Ryujinx.Ava/UI/{Windows/ControllerSettingsWindow.axaml => Views/Input/ControllerInputView.axaml} (71%) rename src/Ryujinx.Ava/UI/{Windows/ControllerSettingsWindow.axaml.cs => Views/Input/ControllerInputView.axaml.cs} (94%) rename src/Ryujinx.Ava/UI/{Windows/MotionSettingsWindow.axaml => Views/Input/MotionInputView.axaml} (59%) rename src/Ryujinx.Ava/UI/{Windows/MotionSettingsWindow.axaml.cs => Views/Input/MotionInputView.axaml.cs} (51%) rename src/Ryujinx.Ava/UI/{Windows/RumbleSettingsWindow.axaml => Views/Input/RumbleInputView.axaml} (91%) rename src/Ryujinx.Ava/UI/{Windows/RumbleSettingsWindow.axaml.cs => Views/Input/RumbleInputView.axaml.cs} (50%) diff --git a/src/Ryujinx.Ava/Assets/Locales/en_US.json b/src/Ryujinx.Ava/Assets/Locales/en_US.json index c9b10f54..a7b490b9 100644 --- a/src/Ryujinx.Ava/Assets/Locales/en_US.json +++ b/src/Ryujinx.Ava/Assets/Locales/en_US.json @@ -216,26 +216,17 @@ "ControllerSettingsDPadDown": "Down", "ControllerSettingsDPadLeft": "Left", "ControllerSettingsDPadRight": "Right", + "ControllerSettingsStickButton": "Button", + "ControllerSettingsStickUp": "Up", + "ControllerSettingsStickDown": "Down", + "ControllerSettingsStickLeft": "Left", + "ControllerSettingsStickRight": "Right", + "ControllerSettingsStickStick": "Stick", + "ControllerSettingsStickInvertXAxis": "Invert Stick X", + "ControllerSettingsStickInvertYAxis": "Invert Stick Y", + "ControllerSettingsStickDeadzone": "Deadzone:", "ControllerSettingsLStick": "Left Stick", - "ControllerSettingsLStickButton": "Button", - "ControllerSettingsLStickUp": "Up", - "ControllerSettingsLStickDown": "Down", - "ControllerSettingsLStickLeft": "Left", - "ControllerSettingsLStickRight": "Right", - "ControllerSettingsLStickStick": "Stick", - "ControllerSettingsLStickInvertXAxis": "Invert Stick X", - "ControllerSettingsLStickInvertYAxis": "Invert Stick Y", - "ControllerSettingsLStickDeadzone": "Deadzone:", "ControllerSettingsRStick": "Right Stick", - "ControllerSettingsRStickButton": "Button", - "ControllerSettingsRStickUp": "Up", - "ControllerSettingsRStickDown": "Down", - "ControllerSettingsRStickLeft": "Left", - "ControllerSettingsRStickRight": "Right", - "ControllerSettingsRStickStick": "Stick", - "ControllerSettingsRStickInvertXAxis": "Invert Stick X", - "ControllerSettingsRStickInvertYAxis": "Invert Stick Y", - "ControllerSettingsRStickDeadzone": "Deadzone:", "ControllerSettingsTriggersLeft": "Triggers Left", "ControllerSettingsTriggersRight": "Triggers Right", "ControllerSettingsTriggersButtonsLeft": "Trigger Buttons Left", @@ -647,4 +638,4 @@ "NetworkInterfaceTooltip": "The network interface used for LAN features", "NetworkInterfaceDefault": "Default", "PackagingShaders": "Packaging Shaders" -} +} \ No newline at end of file diff --git a/src/Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs b/src/Ryujinx.Ava/UI/ViewModels/ControllerInputViewModel.cs similarity index 99% rename from src/Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs rename to src/Ryujinx.Ava/UI/ViewModels/ControllerInputViewModel.cs index dd261b10..fda58504 100644 --- a/src/Ryujinx.Ava/UI/ViewModels/ControllerSettingsViewModel.cs +++ b/src/Ryujinx.Ava/UI/ViewModels/ControllerInputViewModel.cs @@ -7,6 +7,7 @@ using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Input; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Models; +using Ryujinx.Ava.UI.Views.Input; using Ryujinx.Ava.UI.Windows; using Ryujinx.Common; using Ryujinx.Common.Configuration; @@ -30,7 +31,7 @@ using Key = Ryujinx.Common.Configuration.Hid.Key; namespace Ryujinx.Ava.UI.ViewModels { - public class ControllerSettingsViewModel : BaseModel, IDisposable + public class ControllerInputViewModel : BaseModel, IDisposable { private const string Disabled = "disabled"; private const string ProControllerResource = "Ryujinx.Ui.Common/Resources/Controller_ProCon.svg"; @@ -231,7 +232,7 @@ namespace Ryujinx.Ava.UI.ViewModels public InputConfig Config { get; set; } - public ControllerSettingsViewModel(UserControl owner) : this() + public ControllerInputViewModel(UserControl owner) : this() { _owner = owner; @@ -258,7 +259,7 @@ namespace Ryujinx.Ava.UI.ViewModels } } - public ControllerSettingsViewModel() + public ControllerInputViewModel() { PlayerIndexes = new ObservableCollection(); Controllers = new ObservableCollection(); @@ -328,12 +329,12 @@ namespace Ryujinx.Ava.UI.ViewModels public async void ShowMotionConfig() { - await MotionSettingsWindow.Show(this); + await MotionInputView.Show(this); } public async void ShowRumbleConfig() { - await RumbleSettingsWindow.Show(this); + await RumbleInputView.Show(this); } private void LoadInputDriver() diff --git a/src/Ryujinx.Ava/UI/ViewModels/MotionInputViewModel.cs b/src/Ryujinx.Ava/UI/ViewModels/MotionInputViewModel.cs new file mode 100644 index 00000000..d57ccc6b --- /dev/null +++ b/src/Ryujinx.Ava/UI/ViewModels/MotionInputViewModel.cs @@ -0,0 +1,93 @@ +namespace Ryujinx.Ava.UI.ViewModels +{ + public class MotionInputViewModel : BaseModel + { + private int _slot; + public int Slot + { + get => _slot; + set + { + _slot = value; + OnPropertyChanged(); + } + } + + private int _altSlot; + public int AltSlot + { + get => _altSlot; + set + { + _altSlot = value; + OnPropertyChanged(); + } + } + + private string _dsuServerHost; + public string DsuServerHost + { + get => _dsuServerHost; + set + { + _dsuServerHost = value; + OnPropertyChanged(); + } + } + + private int _dsuServerPort; + public int DsuServerPort + { + get => _dsuServerPort; + set + { + _dsuServerPort = value; + OnPropertyChanged(); + } + } + + private bool _mirrorInput; + public bool MirrorInput + { + get => _mirrorInput; + set + { + _mirrorInput = value; + OnPropertyChanged(); + } + } + + private int _sensitivity; + public int Sensitivity + { + get => _sensitivity; + set + { + _sensitivity = value; + OnPropertyChanged(); + } + } + + private double _gryoDeadzone; + public double GyroDeadzone + { + get => _gryoDeadzone; + set + { + _gryoDeadzone = value; + OnPropertyChanged(); + } + } + + private bool _enableCemuHookMotion; + public bool EnableCemuHookMotion + { + get => _enableCemuHookMotion; + set + { + _enableCemuHookMotion = value; + OnPropertyChanged(); + } + } + } +} \ No newline at end of file diff --git a/src/Ryujinx.Ava/UI/ViewModels/RumbleInputViewModel.cs b/src/Ryujinx.Ava/UI/ViewModels/RumbleInputViewModel.cs new file mode 100644 index 00000000..2d53968f --- /dev/null +++ b/src/Ryujinx.Ava/UI/ViewModels/RumbleInputViewModel.cs @@ -0,0 +1,27 @@ +namespace Ryujinx.Ava.UI.ViewModels +{ + public class RumbleInputViewModel : BaseModel + { + private float _strongRumble; + public float StrongRumble + { + get => _strongRumble; + set + { + _strongRumble = value; + OnPropertyChanged(); + } + } + + private float _weakRumble; + public float WeakRumble + { + get => _weakRumble; + set + { + _weakRumble = value; + OnPropertyChanged(); + } + } + } +} \ No newline at end of file diff --git a/src/Ryujinx.Ava/UI/Windows/ControllerSettingsWindow.axaml b/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml similarity index 71% rename from src/Ryujinx.Ava/UI/Windows/ControllerSettingsWindow.axaml rename to src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml index 1a11a8ff..2395b353 100644 --- a/src/Ryujinx.Ava/UI/Windows/ControllerSettingsWindow.axaml +++ b/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml @@ -1,22 +1,24 @@ - + @@ -28,29 +30,23 @@ - - - - - - - - - - - - - + + + + + + + + @@ -79,16 +75,9 @@ - - - + @@ -120,7 +109,7 @@ Margin="5,0,0,0" VerticalAlignment="Center" ToolTip.Tip="{locale:Locale ControllerSettingsLoadProfileToolTip}" - Command="{Binding LoadProfile}"> + Command="{ReflectionBinding LoadProfile}"> + Command="{ReflectionBinding SaveProfile}"> + Command="{ReflectionBinding RemoveProfile}"> - - - - - + + + + + + + + + + @@ -186,24 +177,16 @@ MinWidth="0" Margin="5,0,0,0" VerticalAlignment="Center" - Command="{Binding LoadDevices}"> + Command="{ReflectionBinding LoadDevices}"> - - - - + @@ -220,19 +203,18 @@ + Items="{ReflectionBinding Controllers}" + SelectedIndex="{ReflectionBinding Controller}"> - + - - - - + + + - - - + - - - - - - - + Grid.Column="0"> + - + MinHeight="90" + CornerRadius="5"> + @@ -274,7 +250,6 @@ - - + - + Margin="0,5,0,0" + CornerRadius="5"> + - - - - - - + + + + - - - + + - - - + + - - - + + - - - + + - - - - - - + + + + - - - + + - - - + + + - - + + - + - + - + + Value="{ReflectionBinding Configuration.DeadzoneLeft, Mode=TwoWay}" /> + Text="{ReflectionBinding Configuration.DeadzoneLeft, StringFormat=\{0:0.00\}}" /> - + Value="{ReflectionBinding Configuration.RangeLeft, Mode=TwoWay}" /> + Text="{ReflectionBinding Configuration.RangeLeft, StringFormat=\{0:0.00\}}" /> - - + - + Margin="0,5,0,0" + CornerRadius="5"> + - - + + - + - - - + + - + - - - + + - + - - - + + - + - - - - + + + - - - + BorderThickness="1" + CornerRadius="5" + MinHeight="90"> + + + + Value="{ReflectionBinding Configuration.TriggerThreshold, Mode=TwoWay}" /> + Text="{ReflectionBinding Configuration.TriggerThreshold, StringFormat=\{0:0.00\}}" /> @@ -640,7 +637,6 @@ HorizontalAlignment="Center" VerticalAlignment="Center" IsVisible="{Binding !IsRight}" - Background="{DynamicResource ThemeDarkColor}" Orientation="Horizontal"> @@ -659,7 +655,6 @@ HorizontalAlignment="Center" VerticalAlignment="Center" IsVisible="{Binding !IsLeft}" - Background="{DynamicResource ThemeDarkColor}" Orientation="Horizontal"> @@ -678,7 +673,6 @@ HorizontalAlignment="Center" VerticalAlignment="Center" IsVisible="{Binding !IsLeft}" - Background="{DynamicResource ThemeDarkColor}" Orientation="Horizontal"> - - + - - - + + @@ -720,10 +717,13 @@ Margin="10" MinWidth="0" Grid.Column="0" - IsChecked="{Binding Configuration.EnableMotion, Mode=TwoWay}"> + IsChecked="{ReflectionBinding Configuration.EnableMotion, Mode=TwoWay}"> - @@ -731,6 +731,7 @@ @@ -743,36 +744,34 @@ Margin="10" MinWidth="0" Grid.Column="0" - IsChecked="{Binding Configuration.EnableRumble, Mode=TwoWay}"> + IsChecked="{ReflectionBinding Configuration.EnableRumble, Mode=TwoWay}"> - - - - + - - - - - - + Grid.Column="2"> + - + MinHeight="90" + CornerRadius="5"> + @@ -784,7 +783,6 @@ @@ -803,7 +801,6 @@ Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" - Background="{DynamicResource ThemeDarkColor}" Orientation="Horizontal"> @@ -822,7 +819,6 @@ Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" - Background="{DynamicResource ThemeDarkColor}" Orientation="Horizontal"> + - + Margin="0,5,0,0" + CornerRadius="5"> + - - + + - + - + - + + @@ -937,141 +934,149 @@ Margin="0,0,0,10" HorizontalAlignment="Center" Text="{locale:Locale ControllerSettingsRStick}" /> - - - - - - + + + + - - - + + - - - + + - - - + + - - - + + - - - - - - + + + + - - - - + + - - + + - - + + - + - + + Value="{ReflectionBinding Configuration.DeadzoneRight, Mode=TwoWay}" /> + Text="{ReflectionBinding Configuration.DeadzoneRight, StringFormat=\{0:0.00\}}" /> - + Value="{ReflectionBinding Configuration.RangeRight, Mode=TwoWay}" /> + Text="{ReflectionBinding Configuration.RangeRight, StringFormat=\{0:0.00\}}" /> - - + - - \ No newline at end of file diff --git a/src/Ryujinx.Ava/UI/Windows/ControllerSettingsWindow.axaml.cs b/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml.cs similarity index 94% rename from src/Ryujinx.Ava/UI/Windows/ControllerSettingsWindow.axaml.cs rename to src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml.cs index 2864b6da..8fe7b941 100644 --- a/src/Ryujinx.Ava/UI/Windows/ControllerSettingsWindow.axaml.cs +++ b/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml.cs @@ -4,7 +4,6 @@ using Avalonia.Input; using Avalonia.Interactivity; using Avalonia.LogicalTree; using Ryujinx.Ava.Common.Locale; -using Ryujinx.Ava.UI.Controls; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Models; using Ryujinx.Ava.UI.ViewModels; @@ -13,18 +12,18 @@ using Ryujinx.Input; using Ryujinx.Input.Assigner; using System; -namespace Ryujinx.Ava.UI.Windows +namespace Ryujinx.Ava.UI.Views.Input { - public partial class ControllerSettingsWindow : UserControl + public partial class ControllerInputView : UserControl { private bool _dialogOpen; private ButtonKeyAssigner _currentAssigner; - internal ControllerSettingsViewModel ViewModel { get; set; } + internal ControllerInputViewModel ViewModel { get; set; } - public ControllerSettingsWindow() + public ControllerInputView() { - DataContext = ViewModel = new ControllerSettingsViewModel(this); + DataContext = ViewModel = new ControllerInputViewModel(this); InitializeComponent(); diff --git a/src/Ryujinx.Ava/UI/Windows/MotionSettingsWindow.axaml b/src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml similarity index 59% rename from src/Ryujinx.Ava/UI/Windows/MotionSettingsWindow.axaml rename to src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml index 862998ac..b1832437 100644 --- a/src/Ryujinx.Ava/UI/Windows/MotionSettingsWindow.axaml +++ b/src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml @@ -1,12 +1,15 @@ - @@ -14,7 +17,9 @@ - + - + - + - - - + + + - + @@ -109,30 +125,42 @@ - - - - + + + + - - + + diff --git a/src/Ryujinx.Ava/UI/Windows/MotionSettingsWindow.axaml.cs b/src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml.cs similarity index 51% rename from src/Ryujinx.Ava/UI/Windows/MotionSettingsWindow.axaml.cs rename to src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml.cs index c686e7c3..88bbcd93 100644 --- a/src/Ryujinx.Ava/UI/Windows/MotionSettingsWindow.axaml.cs +++ b/src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml.cs @@ -6,44 +6,42 @@ using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Common.Configuration.Hid.Controller; using System.Threading.Tasks; -namespace Ryujinx.Ava.UI.Windows +namespace Ryujinx.Ava.UI.Views.Input { - public partial class MotionSettingsWindow : UserControl + public partial class MotionInputView : UserControl { - private readonly InputConfiguration _viewmodel; + private MotionInputViewModel _viewModel; - public MotionSettingsWindow() + public MotionInputView() { InitializeComponent(); - DataContext = _viewmodel; } - public MotionSettingsWindow(ControllerSettingsViewModel viewmodel) + public MotionInputView(ControllerInputViewModel viewModel) { - var config = viewmodel.Configuration as InputConfiguration; + var config = viewModel.Configuration as InputConfiguration; - _viewmodel = new InputConfiguration() + _viewModel = new MotionInputViewModel { Slot = config.Slot, AltSlot = config.AltSlot, DsuServerHost = config.DsuServerHost, DsuServerPort = config.DsuServerPort, MirrorInput = config.MirrorInput, - EnableMotion = config.EnableMotion, Sensitivity = config.Sensitivity, GyroDeadzone = config.GyroDeadzone, EnableCemuHookMotion = config.EnableCemuHookMotion }; InitializeComponent(); - DataContext = _viewmodel; + DataContext = _viewModel; } - public static async Task Show(ControllerSettingsViewModel viewmodel) + public static async Task Show(ControllerInputViewModel viewModel) { - MotionSettingsWindow content = new MotionSettingsWindow(viewmodel); + MotionInputView content = new(viewModel); - ContentDialog contentDialog = new ContentDialog + ContentDialog contentDialog = new() { Title = LocaleManager.Instance[LocaleKeys.ControllerMotionTitle], PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave], @@ -53,16 +51,15 @@ namespace Ryujinx.Ava.UI.Windows }; contentDialog.PrimaryButtonClick += (sender, args) => { - var config = viewmodel.Configuration as InputConfiguration; - config.Slot = content._viewmodel.Slot; - config.EnableMotion = content._viewmodel.EnableMotion; - config.Sensitivity = content._viewmodel.Sensitivity; - config.GyroDeadzone = content._viewmodel.GyroDeadzone; - config.AltSlot = content._viewmodel.AltSlot; - config.DsuServerHost = content._viewmodel.DsuServerHost; - config.DsuServerPort = content._viewmodel.DsuServerPort; - config.EnableCemuHookMotion = content._viewmodel.EnableCemuHookMotion; - config.MirrorInput = content._viewmodel.MirrorInput; + var config = viewModel.Configuration as InputConfiguration; + config.Slot = content._viewModel.Slot; + config.Sensitivity = content._viewModel.Sensitivity; + config.GyroDeadzone = content._viewModel.GyroDeadzone; + config.AltSlot = content._viewModel.AltSlot; + config.DsuServerHost = content._viewModel.DsuServerHost; + config.DsuServerPort = content._viewModel.DsuServerPort; + config.EnableCemuHookMotion = content._viewModel.EnableCemuHookMotion; + config.MirrorInput = content._viewModel.MirrorInput; }; await contentDialog.ShowAsync(); diff --git a/src/Ryujinx.Ava/UI/Windows/RumbleSettingsWindow.axaml b/src/Ryujinx.Ava/UI/Views/Input/RumbleInputView.axaml similarity index 91% rename from src/Ryujinx.Ava/UI/Windows/RumbleSettingsWindow.axaml rename to src/Ryujinx.Ava/UI/Views/Input/RumbleInputView.axaml index e47cc5bd..3882ebe2 100644 --- a/src/Ryujinx.Ava/UI/Windows/RumbleSettingsWindow.axaml +++ b/src/Ryujinx.Ava/UI/Views/Input/RumbleInputView.axaml @@ -1,11 +1,14 @@ - diff --git a/src/Ryujinx.Ava/UI/Windows/RumbleSettingsWindow.axaml.cs b/src/Ryujinx.Ava/UI/Views/Input/RumbleInputView.axaml.cs similarity index 50% rename from src/Ryujinx.Ava/UI/Windows/RumbleSettingsWindow.axaml.cs rename to src/Ryujinx.Ava/UI/Views/Input/RumbleInputView.axaml.cs index 178109d6..dfe05b08 100644 --- a/src/Ryujinx.Ava/UI/Windows/RumbleSettingsWindow.axaml.cs +++ b/src/Ryujinx.Ava/UI/Views/Input/RumbleInputView.axaml.cs @@ -6,36 +6,37 @@ using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Common.Configuration.Hid.Controller; using System.Threading.Tasks; -namespace Ryujinx.Ava.UI.Windows +namespace Ryujinx.Ava.UI.Views.Input { - public partial class RumbleSettingsWindow : UserControl + public partial class RumbleInputView : UserControl { - private readonly InputConfiguration _viewmodel; + private RumbleInputViewModel _viewModel; - public RumbleSettingsWindow() + public RumbleInputView() { InitializeComponent(); - DataContext = _viewmodel; } - public RumbleSettingsWindow(ControllerSettingsViewModel viewmodel) + public RumbleInputView(ControllerInputViewModel viewModel) { - var config = viewmodel.Configuration as InputConfiguration; + var config = viewModel.Configuration as InputConfiguration; - _viewmodel = new InputConfiguration() + _viewModel = new RumbleInputViewModel { - StrongRumble = config.StrongRumble, WeakRumble = config.WeakRumble + StrongRumble = config.StrongRumble, + WeakRumble = config.WeakRumble }; InitializeComponent(); - DataContext = _viewmodel; + + DataContext = _viewModel; } - public static async Task Show(ControllerSettingsViewModel viewmodel) + public static async Task Show(ControllerInputViewModel viewModel) { - RumbleSettingsWindow content = new RumbleSettingsWindow(viewmodel); + RumbleInputView content = new(viewModel); - ContentDialog contentDialog = new ContentDialog + ContentDialog contentDialog = new() { Title = LocaleManager.Instance[LocaleKeys.ControllerRumbleTitle], PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave], @@ -43,14 +44,14 @@ namespace Ryujinx.Ava.UI.Windows CloseButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsClose], Content = content, }; - + contentDialog.PrimaryButtonClick += (sender, args) => { - var config = viewmodel.Configuration as InputConfiguration; - config.StrongRumble = content._viewmodel.StrongRumble; - config.WeakRumble = content._viewmodel.WeakRumble; + var config = viewModel.Configuration as InputConfiguration; + config.StrongRumble = content._viewModel.StrongRumble; + config.WeakRumble = content._viewModel.WeakRumble; }; - + await contentDialog.ShowAsync(); } } diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsInputView.axaml b/src/Ryujinx.Ava/UI/Views/Settings/SettingsInputView.axaml index 1c774bda..22ff38f5 100644 --- a/src/Ryujinx.Ava/UI/Views/Settings/SettingsInputView.axaml +++ b/src/Ryujinx.Ava/UI/Views/Settings/SettingsInputView.axaml @@ -1,11 +1,11 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ryujinx.Ui.Common/Resources/Controller_ProCon.svg b/src/Ryujinx.Ui.Common/Resources/Controller_ProCon.svg index 88216776..f5380f3a 100644 --- a/src/Ryujinx.Ui.Common/Resources/Controller_ProCon.svg +++ b/src/Ryujinx.Ui.Common/Resources/Controller_ProCon.svg @@ -1 +1,132 @@ -ZLZRLR \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A + + + + X + + + + Y + + + + B + + + + + + + + + + ZL + + + + + ZR + + + + R + + + + + L + + +