From 33e3ba9ff25f117f31d95a2e701ffa8aa9a3fad9 Mon Sep 17 00:00:00 2001 From: Vova Date: Sat, 1 Mar 2025 23:44:05 +1000 Subject: [PATCH] Fixed profiles on the input page: - profiles are unlinked from controllers - sometimes a new profile after saving changed to the previous one, had to select it again (fixed) - when deleting, the profile now resets the name to "default" --- .../UI/ViewModels/Input/InputViewModel.cs | 22 ++++++++++++++++++- src/Ryujinx/UI/Views/Input/InputView.axaml | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs b/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs index cbfa36774..d84567919 100644 --- a/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs @@ -106,6 +106,21 @@ namespace Ryujinx.Ava.UI.ViewModels.Input public event Action NotifyChangesEvent; + public int _profileChoose; + public int ProfileChoose + { + get => _profileChoose; + set + { + if (value >= 0) + { + _profileChoose = value; + } + + OnPropertyChanged(); + } + } + public PlayerIndex PlayerIdChoose { get => _playerIdChoose; @@ -821,7 +836,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input LoadConfiguration(config); - LoadDevice(); + // This line of code hard-links profiles to controllers, the commented line allows profiles to be applied to all controllers + // LoadDevice(); _isLoaded = true; @@ -873,6 +889,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input await File.WriteAllTextAsync(path, jsonString); LoadProfiles(); + + ProfileChoose = ProfilesList.IndexOf(ProfileName); // Show new profile } else { @@ -905,6 +923,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input } LoadProfiles(); + + ProfileChoose = 0; // Show default profile } } diff --git a/src/Ryujinx/UI/Views/Input/InputView.axaml b/src/Ryujinx/UI/Views/Input/InputView.axaml index fd0ade663..7504a8c70 100644 --- a/src/Ryujinx/UI/Views/Input/InputView.axaml +++ b/src/Ryujinx/UI/Views/Input/InputView.axaml @@ -117,7 +117,7 @@ Name="ProfileBox" HorizontalAlignment="Stretch" VerticalAlignment="Center" - SelectedIndex="0" + SelectedIndex="{Binding ProfileChoose}" ItemsSource="{Binding ProfilesList}" Text="{Binding ProfileName, Mode=TwoWay}" />