diff --git a/src/Ryujinx/UI/ViewModels/Input/LedInputViewModel.cs b/src/Ryujinx/UI/ViewModels/Input/LedInputViewModel.cs
index 3dcf1a4c4..dff112803 100644
--- a/src/Ryujinx/UI/ViewModels/Input/LedInputViewModel.cs
+++ b/src/Ryujinx/UI/ViewModels/Input/LedInputViewModel.cs
@@ -29,20 +29,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
[ObservableProperty]
public partial Color LedColor { get; set; }
- public string RainbowSpeedText
- {
- get
- {
- if (RainbowSpeed == 10)
- {
- return RainbowSpeed.ToString("F1", CultureInfo.CurrentCulture);
- }
- else
- {
- return RainbowSpeed.ToString("F2", CultureInfo.CurrentCulture);
- }
- }
- }
+ public string RainbowSpeedText => RainbowSpeed.ToString("F2", CultureInfo.CurrentCulture);
public float RainbowSpeed
{
diff --git a/src/Ryujinx/UI/ViewModels/Input/MotionInputViewModel.cs b/src/Ryujinx/UI/ViewModels/Input/MotionInputViewModel.cs
index 8813b539d..ad9a70eaa 100644
--- a/src/Ryujinx/UI/ViewModels/Input/MotionInputViewModel.cs
+++ b/src/Ryujinx/UI/ViewModels/Input/MotionInputViewModel.cs
@@ -1,5 +1,4 @@
using CommunityToolkit.Mvvm.ComponentModel;
-using System.Globalization;
namespace Ryujinx.Ava.UI.ViewModels.Input
{
@@ -23,36 +22,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
[ObservableProperty]
public partial int Sensitivity { get; set; }
- private double _gyroDeadzone;
-
- public double GyroDeadzone
- {
- get => _gyroDeadzone;
- set
- {
- if (_gyroDeadzone != value)
- {
- _gyroDeadzone = value;
- OnPropertyChanged();
- OnPropertyChanged(nameof(GyroDeadzoneText));
- }
- }
- }
-
- public string GyroDeadzoneText
- {
- get
- {
- if (_gyroDeadzone == 100)
- {
- return _gyroDeadzone.ToString("F1", CultureInfo.CurrentCulture);
- }
- else
- {
- return _gyroDeadzone.ToString("F2", CultureInfo.CurrentCulture);
- }
- }
- }
+ [ObservableProperty]
+ public partial double GyroDeadzone { get; set; }
[ObservableProperty]
public partial bool EnableCemuHookMotion { get; set; }
diff --git a/src/Ryujinx/UI/ViewModels/Input/RumbleInputViewModel.cs b/src/Ryujinx/UI/ViewModels/Input/RumbleInputViewModel.cs
index 7fced3d89..e2323f567 100644
--- a/src/Ryujinx/UI/ViewModels/Input/RumbleInputViewModel.cs
+++ b/src/Ryujinx/UI/ViewModels/Input/RumbleInputViewModel.cs
@@ -1,68 +1,13 @@
-using System.Globalization;
+using CommunityToolkit.Mvvm.ComponentModel;
namespace Ryujinx.Ava.UI.ViewModels.Input
{
public partial class RumbleInputViewModel : BaseModel
{
- private float strongRumble;
- private float weakRumble;
+ [ObservableProperty]
+ public partial float StrongRumble { get; set; }
- public float StrongRumble
- {
- get => strongRumble;
- set
- {
- if (strongRumble != value)
- {
- strongRumble = value;
- OnPropertyChanged();
- OnPropertyChanged(nameof(StrongRumbleText));
- }
- }
- }
-
- public float WeakRumble
- {
- get => weakRumble;
- set
- {
- if (weakRumble != value)
- {
- weakRumble = value;
- OnPropertyChanged();
- OnPropertyChanged(nameof(WeakRumbleText));
- }
- }
- }
-
- public string StrongRumbleText
- {
- get
- {
- if (StrongRumble == 10)
- {
- return StrongRumble.ToString("F1", CultureInfo.CurrentCulture);
- }
- else
- {
- return StrongRumble.ToString("F2", CultureInfo.CurrentCulture);
- }
- }
- }
-
- public string WeakRumbleText
- {
- get
- {
- if (WeakRumble == 10)
- {
- return WeakRumble.ToString("F1", CultureInfo.CurrentCulture);
- }
- else
- {
- return WeakRumble.ToString("F2", CultureInfo.CurrentCulture);
- }
- }
- }
+ [ObservableProperty]
+ public partial float WeakRumble { get; set; }
}
}
diff --git a/src/Ryujinx/UI/Views/Input/MotionInputView.axaml b/src/Ryujinx/UI/Views/Input/MotionInputView.axaml
index 0bd6732f6..32189ac7f 100644
--- a/src/Ryujinx/UI/Views/Input/MotionInputView.axaml
+++ b/src/Ryujinx/UI/Views/Input/MotionInputView.axaml
@@ -65,7 +65,7 @@
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="5,0,5,1"
- Text="{Binding GyroDeadzoneText}" />
+ Text="{Binding GyroDeadzone, StringFormat=\{0:0.00\}}" />
diff --git a/src/Ryujinx/UI/Views/Input/RumbleInputView.axaml b/src/Ryujinx/UI/Views/Input/RumbleInputView.axaml
index 6531e700f..0db593bde 100644
--- a/src/Ryujinx/UI/Views/Input/RumbleInputView.axaml
+++ b/src/Ryujinx/UI/Views/Input/RumbleInputView.axaml
@@ -30,7 +30,7 @@
Grid.Row="0"
Grid.Column="2"
Margin="5,0,5,1"
- Text="{Binding StrongRumbleText}" />
+ Text="{Binding StrongRumble, StringFormat=\{0:0.00\}}" />
+ Text="{Binding WeakRumble, StringFormat=\{0:0.00\}}" />