diff --git a/assets/locales.json b/assets/locales.json index 80ebe2fe8..c4f47f99d 100644 --- a/assets/locales.json +++ b/assets/locales.json @@ -8370,26 +8370,26 @@ { "ID": "ControllerSettingsLedColor", "Translations": { - "ar_SA": "لون:", - "de_DE": "Farbe:", - "el_GR": "Χρώμα:", - "en_US": "Color:", + "ar_SA": "لون", + "de_DE": "Farbe", + "el_GR": "Χρώμα", + "en_US": "Color", "es_ES": null, - "fr_FR": "Couleur:", - "he_IL": "צבע:", - "it_IT": "Colore:", - "ja_JP": "色:", - "ko_KR": "색상:", - "no_NO": "Farge:", - "pl_PL": "Kolor:", - "pt_BR": "Cor:", - "ru_RU": "Цвет:", - "sv_SE": "Färg:", - "th_TH": "สี:", - "tr_TR": "Renk:", - "uk_UA": "Колір:", - "zh_CN": "颜色:", - "zh_TW": "顏色:" + "fr_FR": "Couleur", + "he_IL": "צבע", + "it_IT": "Colore", + "ja_JP": "色", + "ko_KR": "색상", + "no_NO": "Farge", + "pl_PL": "Kolor", + "pt_BR": "Cor", + "ru_RU": "Цвет", + "sv_SE": "Färg", + "th_TH": "สี", + "tr_TR": "Renk", + "uk_UA": "Колір", + "zh_CN": "颜色", + "zh_TW": "顏色" } }, { diff --git a/src/Ryujinx/UI/ViewModels/Input/LedInputViewModel.cs b/src/Ryujinx/UI/ViewModels/Input/LedInputViewModel.cs index dff112803..3dcf1a4c4 100644 --- a/src/Ryujinx/UI/ViewModels/Input/LedInputViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/Input/LedInputViewModel.cs @@ -29,7 +29,20 @@ namespace Ryujinx.Ava.UI.ViewModels.Input [ObservableProperty] public partial Color LedColor { get; set; } - public string RainbowSpeedText => RainbowSpeed.ToString("F2", CultureInfo.CurrentCulture); + public string RainbowSpeedText + { + get + { + if (RainbowSpeed == 10) + { + return RainbowSpeed.ToString("F1", CultureInfo.CurrentCulture); + } + else + { + return 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 ad9a70eaa..8813b539d 100644 --- a/src/Ryujinx/UI/ViewModels/Input/MotionInputViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/Input/MotionInputViewModel.cs @@ -1,4 +1,5 @@ using CommunityToolkit.Mvvm.ComponentModel; +using System.Globalization; namespace Ryujinx.Ava.UI.ViewModels.Input { @@ -22,8 +23,36 @@ namespace Ryujinx.Ava.UI.ViewModels.Input [ObservableProperty] public partial int Sensitivity { get; set; } - [ObservableProperty] - public partial double GyroDeadzone { 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 bool EnableCemuHookMotion { get; set; } diff --git a/src/Ryujinx/UI/ViewModels/Input/RumbleInputViewModel.cs b/src/Ryujinx/UI/ViewModels/Input/RumbleInputViewModel.cs index e2323f567..7fced3d89 100644 --- a/src/Ryujinx/UI/ViewModels/Input/RumbleInputViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/Input/RumbleInputViewModel.cs @@ -1,13 +1,68 @@ -using CommunityToolkit.Mvvm.ComponentModel; +using System.Globalization; namespace Ryujinx.Ava.UI.ViewModels.Input { public partial class RumbleInputViewModel : BaseModel { - [ObservableProperty] - public partial float StrongRumble { get; set; } + private float strongRumble; + private float weakRumble; - [ObservableProperty] - public partial float WeakRumble { 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); + } + } + } } } diff --git a/src/Ryujinx/UI/Views/Input/LedInputView.axaml b/src/Ryujinx/UI/Views/Input/LedInputView.axaml index 3ae801aa8..e27ab785b 100644 --- a/src/Ryujinx/UI/Views/Input/LedInputView.axaml +++ b/src/Ryujinx/UI/Views/Input/LedInputView.axaml @@ -9,34 +9,29 @@ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:DataType="viewModels:LedInputViewModel" x:Class="Ryujinx.UI.Views.Input.LedInputView"> - - + + - + - + + Value="{Binding RainbowSpeed}" + Width="150" + Margin="0,0,0,2.5" + TickFrequency="0.25" + IsSnapToTickEnabled="True" + LargeChange="1" + SmallChange="0.25" + Minimum="0" + Maximum="10" /> - + - + diff --git a/src/Ryujinx/UI/Views/Input/MotionInputView.axaml b/src/Ryujinx/UI/Views/Input/MotionInputView.axaml index 32189ac7f..0bd6732f6 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 GyroDeadzone, StringFormat=\{0:0.00\}}" /> + Text="{Binding GyroDeadzoneText}" /> diff --git a/src/Ryujinx/UI/Views/Input/RumbleInputView.axaml b/src/Ryujinx/UI/Views/Input/RumbleInputView.axaml index 033ea5d02..6531e700f 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 StrongRumble, StringFormat=\{0:0.00\}}" /> + Text="{Binding StrongRumbleText}" /> + Value="{Binding WeakRumble, Mode=TwoWay}" /> + Text="{Binding WeakRumbleText}" />