Compare commits

...

5 Commits

Author SHA1 Message Date
Vladimir Sokolov 86a2bc5c6a Merge 3e69afd110 into 52b0b45d34 2025-02-18 09:34:16 +00:00
Vova 3e69afd110 Fix: Input page is saved only when input is changed
This is an attempt to decouple "saving gamepad settings" from the rest of the emulator settings. Should fix the issue where the gamepad was not detected when starting the emulator and the game (usually after saving settings with the gamepad turned off)
2025-02-18 19:28:13 +10:00
Evan Husted 52b0b45d34 misc: chore: null-coalesce led rainbow checking in headless 2025-02-17 16:29:57 -06:00
Evan Husted 12f0dbcc70 metal: Commented Bayonetta & New Pokemon Snap for Metal for more testing, removed Astral Chain 2025-02-17 13:43:28 -06:00
Evan Husted 719be560ec UI: RPC: Hogwarts Legacy asset image 2025-02-17 02:04:18 -06:00
6 changed files with 42 additions and 9 deletions
+4 -4
View File
@@ -53,10 +53,9 @@ namespace Ryujinx.Common
"0100000000010000", // Super Mario Odyssey "0100000000010000", // Super Mario Odyssey
// Further testing is appreciated, I did not test the entire game: // Further testing is appreciated, I did not test the entire game:
"01007300020fa000", // Astral Chain //"010076f0049a2000", // Bayonetta
"010076f0049a2000", // Bayonetta //"0100cf5010fec000", // Bayonetta Origins: Cereza and the Lost Demon
"0100cf5010fec000", // Bayonetta Origins: Cereza and the Lost Demon //"0100f4300bf2c000", // New Pokemon Snap
"0100f4300bf2c000", // New Pokemon Snap
]; ];
public static string GetDiscordGameAsset(string titleId) public static string GetDiscordGameAsset(string titleId)
@@ -230,6 +229,7 @@ namespace Ryujinx.Common
"01008c8012920000", // Dying Light Platinum Edition "01008c8012920000", // Dying Light Platinum Edition
"01001cc01b2d4000", // Goat Simulator 3 "01001cc01b2d4000", // Goat Simulator 3
"01003620068ea000", // Hand of Fate 2 "01003620068ea000", // Hand of Fate 2
"0100f7e00c70e000", // Hogwarts Legacy
"010085500130a000", // Lego City: Undercover "010085500130a000", // Lego City: Undercover
"010073c01af34000", // LEGO Horizon Adventures "010073c01af34000", // LEGO Horizon Adventures
"0100d71004694000", // Minecraft "0100d71004694000", // Minecraft
+2 -1
View File
@@ -289,7 +289,8 @@ namespace Ryujinx.Headless
DriverUtilities.InitDriverConfig(option.BackendThreading == BackendThreading.Off); DriverUtilities.InitDriverConfig(option.BackendThreading == BackendThreading.Off);
if (_inputConfiguration.OfType<StandardControllerInputConfig>().Any(ic => ic.Led.UseRainbow)) if (_inputConfiguration.OfType<StandardControllerInputConfig>()
.Any(ic => ic?.Led?.UseRainbow ?? false))
Rainbow.Enable(); Rainbow.Enable();
while (true) while (true)
@@ -52,6 +52,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
[ObservableProperty] private object _configViewModel; [ObservableProperty] private object _configViewModel;
[ObservableProperty] private string _profileName; [ObservableProperty] private string _profileName;
private bool _isLoaded; private bool _isLoaded;
public bool InitInputPage { get; set; }
private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions()); private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
@@ -92,6 +93,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
public bool CanClearLed => SelectedGamepad.Name.ContainsIgnoreCase("DualSense"); public bool CanClearLed => SelectedGamepad.Name.ContainsIgnoreCase("DualSense");
public bool IsModified { get; set; } public bool IsModified { get; set; }
public bool IsInputConfigChanged { get; set; }
public event Action NotifyChangesEvent; public event Action NotifyChangesEvent;
public PlayerIndex PlayerIdChoose public PlayerIndex PlayerIdChoose
@@ -121,13 +124,12 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
} }
_isLoaded = false; _isLoaded = false;
LoadConfiguration(); LoadConfiguration();
LoadDevice(); LoadDevice();
LoadProfiles(); LoadProfiles();
_isLoaded = true; _isLoaded = true;
OnPropertyChanged(); OnPropertyChanged();
} }
} }
@@ -296,7 +298,10 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
{ {
ConfigViewModel = new ControllerInputViewModel(this, new GamepadInputConfig(controllerInputConfig)); ConfigViewModel = new ControllerInputViewModel(this, new GamepadInputConfig(controllerInputConfig));
} }
}
IsInputConfigChanged |= InitInputPage; // If the field has been changed, the control settings will be overwritten
InitInputPage = true; // initialization variable
}
public void LoadDevice() public void LoadDevice()
{ {
@@ -817,6 +822,13 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
{ {
IsModified = false; IsModified = false;
if (!IsInputConfigChanged)
{
return; //If the input settings were not touched, then do nothing
}
IsInputConfigChanged = false; // Input settings have been changed
List<InputConfig> newConfig = []; List<InputConfig> newConfig = [];
newConfig.AddRange(ConfigurationState.Instance.Hid.InputConfig.Value); newConfig.AddRange(ConfigurationState.Instance.Hid.InputConfig.Value);
@@ -65,6 +65,9 @@ namespace Ryujinx.Ava.UI.Views.Input
if (!float.IsNaN(_changeSlider) && _changeSlider != (float)check.Value) if (!float.IsNaN(_changeSlider) && _changeSlider != (float)check.Value)
{ {
(DataContext as ControllerInputViewModel)!.ParentModel.IsModified = true; (DataContext as ControllerInputViewModel)!.ParentModel.IsModified = true;
FlagInputConfigChanged();
_changeSlider = (float)check.Value; _changeSlider = (float)check.Value;
} }
} }
@@ -75,6 +78,9 @@ namespace Ryujinx.Ava.UI.Views.Input
if (sender is CheckBox { IsPointerOver: true }) if (sender is CheckBox { IsPointerOver: true })
{ {
(DataContext as ControllerInputViewModel)!.ParentModel.IsModified = true; (DataContext as ControllerInputViewModel)!.ParentModel.IsModified = true;
FlagInputConfigChanged();
_currentAssigner?.Cancel(); _currentAssigner?.Cancel();
_currentAssigner = null; _currentAssigner = null;
} }
@@ -102,6 +108,8 @@ namespace Ryujinx.Ava.UI.Views.Input
PointerPressed += MouseClick; PointerPressed += MouseClick;
FlagInputConfigChanged();
ControllerInputViewModel viewModel = (DataContext as ControllerInputViewModel); ControllerInputViewModel viewModel = (DataContext as ControllerInputViewModel);
IKeyboard keyboard = IKeyboard keyboard =
@@ -208,6 +216,11 @@ namespace Ryujinx.Ava.UI.Views.Input
} }
} }
private void FlagInputConfigChanged()
{
(DataContext as ControllerInputViewModel)!.ParentModel.IsInputConfigChanged = true;
}
private void MouseClick(object sender, PointerPressedEventArgs e) private void MouseClick(object sender, PointerPressedEventArgs e)
{ {
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed; bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;
@@ -239,7 +252,6 @@ namespace Ryujinx.Ava.UI.Views.Input
{ {
gamepad?.ClearLed(); gamepad?.ClearLed();
} }
_currentAssigner?.Cancel(); _currentAssigner?.Cancel();
_currentAssigner = null; _currentAssigner = null;
} }
@@ -48,6 +48,7 @@ namespace Ryujinx.Ava.UI.Views.Input
if (result == UserResult.Yes) if (result == UserResult.Yes)
{ {
ViewModel.InitInputPage = false;
ViewModel.Save(); ViewModel.Save();
} }
@@ -60,6 +60,8 @@ namespace Ryujinx.Ava.UI.Views.Input
PointerPressed += MouseClick; PointerPressed += MouseClick;
FlagInputConfigChanged();
if (DataContext is not KeyboardInputViewModel viewModel) if (DataContext is not KeyboardInputViewModel viewModel)
return; return;
@@ -184,6 +186,11 @@ namespace Ryujinx.Ava.UI.Views.Input
} }
} }
private void FlagInputConfigChanged()
{
(DataContext as KeyboardInputViewModel)!.ParentModel.IsInputConfigChanged = true;
}
private void MouseClick(object sender, PointerPressedEventArgs e) private void MouseClick(object sender, PointerPressedEventArgs e)
{ {
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed; bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;