aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml.cs
diff options
context:
space:
mode:
authorIsaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com>2023-05-22 00:16:20 +0100
committerGitHub <noreply@github.com>2023-05-22 01:16:20 +0200
commitb53e7ffd46b5c4ac5c4ac3dcc24385b2c9dc4fa4 (patch)
treee2579164c7c81ab47413d30663224fbbd75e024b /src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml.cs
parentac66643346df76561ff85be741e2998290d43646 (diff)
Ava UI: Input Menu Redesign (#4990)1.1.815
* 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 <Acoustik666@gmail.com> --------- Co-authored-by: Ac_K <Acoustik666@gmail.com>
Diffstat (limited to 'src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml.cs')
-rw-r--r--src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml.cs68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml.cs b/src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml.cs
new file mode 100644
index 00000000..88bbcd93
--- /dev/null
+++ b/src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml.cs
@@ -0,0 +1,68 @@
+using Avalonia.Controls;
+using FluentAvalonia.UI.Controls;
+using Ryujinx.Ava.Common.Locale;
+using Ryujinx.Ava.UI.Models;
+using Ryujinx.Ava.UI.ViewModels;
+using Ryujinx.Common.Configuration.Hid.Controller;
+using System.Threading.Tasks;
+
+namespace Ryujinx.Ava.UI.Views.Input
+{
+ public partial class MotionInputView : UserControl
+ {
+ private MotionInputViewModel _viewModel;
+
+ public MotionInputView()
+ {
+ InitializeComponent();
+ }
+
+ public MotionInputView(ControllerInputViewModel viewModel)
+ {
+ var config = viewModel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
+
+ _viewModel = new MotionInputViewModel
+ {
+ Slot = config.Slot,
+ AltSlot = config.AltSlot,
+ DsuServerHost = config.DsuServerHost,
+ DsuServerPort = config.DsuServerPort,
+ MirrorInput = config.MirrorInput,
+ Sensitivity = config.Sensitivity,
+ GyroDeadzone = config.GyroDeadzone,
+ EnableCemuHookMotion = config.EnableCemuHookMotion
+ };
+
+ InitializeComponent();
+ DataContext = _viewModel;
+ }
+
+ public static async Task Show(ControllerInputViewModel viewModel)
+ {
+ MotionInputView content = new(viewModel);
+
+ ContentDialog contentDialog = new()
+ {
+ Title = LocaleManager.Instance[LocaleKeys.ControllerMotionTitle],
+ PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave],
+ SecondaryButtonText = "",
+ CloseButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsClose],
+ Content = content
+ };
+ contentDialog.PrimaryButtonClick += (sender, args) =>
+ {
+ var config = viewModel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
+ 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();
+ }
+ }
+} \ No newline at end of file