Improve Motion/Rumble/LED Windows

Due to resizing issues.
This commit is contained in:
_Neo_ 2025-11-20 19:43:09 +02:00
parent 359af1d310
commit cdbe4921e6
7 changed files with 144 additions and 52 deletions

View file

@ -8370,26 +8370,26 @@
{ {
"ID": "ControllerSettingsLedColor", "ID": "ControllerSettingsLedColor",
"Translations": { "Translations": {
"ar_SA": "لون:", "ar_SA": "لون",
"de_DE": "Farbe:", "de_DE": "Farbe",
"el_GR": "Χρώμα:", "el_GR": "Χρώμα",
"en_US": "Color:", "en_US": "Color",
"es_ES": null, "es_ES": null,
"fr_FR": "Couleur:", "fr_FR": "Couleur",
"he_IL": "צבע:", "he_IL": "צבע",
"it_IT": "Colore:", "it_IT": "Colore",
"ja_JP": "色:", "ja_JP": "色",
"ko_KR": "색상:", "ko_KR": "색상",
"no_NO": "Farge:", "no_NO": "Farge",
"pl_PL": "Kolor:", "pl_PL": "Kolor",
"pt_BR": "Cor:", "pt_BR": "Cor",
"ru_RU": "Цвет:", "ru_RU": "Цвет",
"sv_SE": "Färg:", "sv_SE": "Färg",
"th_TH": "สี:", "th_TH": "สี",
"tr_TR": "Renk:", "tr_TR": "Renk",
"uk_UA": "Колір:", "uk_UA": "Колір",
"zh_CN": "颜色:", "zh_CN": "颜色",
"zh_TW": "顏色:" "zh_TW": "顏色"
} }
}, },
{ {

View file

@ -29,7 +29,20 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
[ObservableProperty] [ObservableProperty]
public partial Color LedColor { get; set; } 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 public float RainbowSpeed
{ {

View file

@ -1,4 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using System.Globalization;
namespace Ryujinx.Ava.UI.ViewModels.Input namespace Ryujinx.Ava.UI.ViewModels.Input
{ {
@ -22,8 +23,36 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
[ObservableProperty] [ObservableProperty]
public partial int Sensitivity { get; set; } public partial int Sensitivity { get; set; }
[ObservableProperty] private double _gyroDeadzone;
public partial double GyroDeadzone { get; set; }
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] [ObservableProperty]
public partial bool EnableCemuHookMotion { get; set; } public partial bool EnableCemuHookMotion { get; set; }

View file

@ -1,13 +1,68 @@
using CommunityToolkit.Mvvm.ComponentModel; using System.Globalization;
namespace Ryujinx.Ava.UI.ViewModels.Input namespace Ryujinx.Ava.UI.ViewModels.Input
{ {
public partial class RumbleInputViewModel : BaseModel public partial class RumbleInputViewModel : BaseModel
{ {
[ObservableProperty] private float strongRumble;
public partial float StrongRumble { get; set; } private float weakRumble;
[ObservableProperty] public float StrongRumble
public partial float WeakRumble { get; set; } {
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);
}
}
}
} }
} }

View file

@ -9,20 +9,15 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="viewModels:LedInputViewModel" x:DataType="viewModels:LedInputViewModel"
x:Class="Ryujinx.UI.Views.Input.LedInputView"> x:Class="Ryujinx.UI.Views.Input.LedInputView">
<StackPanel Margin="10" Orientation="Vertical" HorizontalAlignment="Center"> <Grid Margin="10" HorizontalAlignment="Center" RowDefinitions="Auto,Auto,Auto,Auto" ColumnDefinitions="Auto,Auto">
<CheckBox <CheckBox Grid.Row="0" Margin="0,0,0,2.5" IsChecked="{Binding TurnOffLed, Mode=TwoWay}"
Margin="0,0,0,2.5" Command="{Binding LedDisabledChanged}" IsVisible="{Binding ParentModel.CanClearLed}">
IsChecked="{Binding TurnOffLed, Mode=TwoWay}"
Command="{Binding LedDisabledChanged}"
IsVisible="{Binding ParentModel.CanClearLed}">
<TextBlock Text="{ext:Locale ControllerSettingsLedColorDisable}" /> <TextBlock Text="{ext:Locale ControllerSettingsLedColorDisable}" />
</CheckBox> </CheckBox>
<CheckBox <CheckBox Grid.Row="1" Margin="0,0,0,2.5" IsChecked="{Binding UseRainbowLed, Mode=TwoWay}">
Margin="0,0,0,2.5"
IsChecked="{Binding UseRainbowLed, Mode=TwoWay}">
<TextBlock Text="{ext:Locale ControllerSettingsLedColorRainbow}" /> <TextBlock Text="{ext:Locale ControllerSettingsLedColorRainbow}" />
</CheckBox> </CheckBox>
<StackPanel Orientation="Horizontal" IsEnabled="{Binding !TurnOffLed}"> <StackPanel Grid.Row="2" Orientation="Horizontal" IsEnabled="{Binding !TurnOffLed}">
<TextBlock Margin="0,0,10,2.5" Text="{ext:Locale ControllerSettingsLedColorRainbowSpeed}" /> <TextBlock Margin="0,0,10,2.5" Text="{ext:Locale ControllerSettingsLedColorRainbowSpeed}" />
<controls:SliderScroll <controls:SliderScroll
Value="{Binding RainbowSpeed}" Value="{Binding RainbowSpeed}"
@ -36,7 +31,7 @@
Maximum="10" /> Maximum="10" />
<TextBlock Margin="5,0,0,2.5" Text="{Binding RainbowSpeedText}" /> <TextBlock Margin="5,0,0,2.5" Text="{Binding RainbowSpeedText}" />
</StackPanel> </StackPanel>
<StackPanel Margin="0,2.5,0,0" Orientation="Horizontal" IsEnabled="{Binding ShowLedColorPicker}"> <StackPanel Grid.Row="3" Orientation="Horizontal" IsEnabled="{Binding ShowLedColorPicker}">
<TextBlock Text="{ext:Locale ControllerSettingsLedColor}" /> <TextBlock Text="{ext:Locale ControllerSettingsLedColor}" />
<ui:ColorPickerButton <ui:ColorPickerButton
Margin="20,0,0,0" Margin="20,0,0,0"
@ -51,5 +46,5 @@
Color="{Binding LedColor, Mode=TwoWay}"> Color="{Binding LedColor, Mode=TwoWay}">
</ui:ColorPickerButton> </ui:ColorPickerButton>
</StackPanel> </StackPanel>
</StackPanel> </Grid>
</UserControl> </UserControl>

View file

@ -65,7 +65,7 @@
VerticalAlignment="Center" VerticalAlignment="Center"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Margin="5,0,5,1" Margin="5,0,5,1"
Text="{Binding GyroDeadzone, StringFormat=\{0:0.00\}}" /> Text="{Binding GyroDeadzoneText}" />
</Grid> </Grid>
<Separator Height="1" Margin="0,0,0,5" /> <Separator Height="1" Margin="0,0,0,5" />
<CheckBox Margin="0,5,0,5" HorizontalAlignment="Center" IsChecked="{Binding EnableCemuHookMotion}"> <CheckBox Margin="0,5,0,5" HorizontalAlignment="Center" IsChecked="{Binding EnableCemuHookMotion}">

View file

@ -30,7 +30,7 @@
Grid.Row="0" Grid.Row="0"
Grid.Column="2" Grid.Column="2"
Margin="5,0,5,1" Margin="5,0,5,1"
Text="{Binding StrongRumble, StringFormat=\{0:0.00\}}" /> Text="{Binding StrongRumbleText}" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
@ -50,6 +50,6 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="2" Grid.Column="2"
Margin="5,0,5,1" Margin="5,0,5,1"
Text="{Binding WeakRumble, StringFormat=\{0:0.00\}}" /> Text="{Binding WeakRumbleText}" />
</Grid> </Grid>
</UserControl> </UserControl>