feature: add the ability to skip profile select dialog when opening games that use it

the skip behavior is done by passing the user id of the profile you have selected in Options > Manage User Profiles.

See merge request ryubing/ryujinx!9
This commit is contained in:
Goodfeat 2025-03-30 22:29:57 -05:00 committed by GreemDev
parent 2ea9e945ab
commit 6602693477
9 changed files with 91 additions and 3 deletions

View file

@ -150,7 +150,10 @@ namespace Ryujinx.Headless
if (NeedsOverride(nameof(IgnoreControllerApplet)))
IgnoreControllerApplet = configurationState.System.IgnoreControllerApplet;
if (NeedsOverride(nameof(SkipUserProfilesManager)))
SkipUserProfilesManager = configurationState.System.SkipUserProfilesManager;
return;
bool NeedsOverride(string argKey) => originalArgs.None(arg => arg.TrimStart('-').EqualsIgnoreCase(OptionName(argKey)));
@ -414,6 +417,9 @@ namespace Ryujinx.Headless
[Option("ignore-controller-applet", Required = false, Default = false, HelpText = "Enable ignoring the controller applet when your game loses connection to your controller.")]
public bool IgnoreControllerApplet { get; set; }
[Option("skip-user-profiles-manager", Required = false, Default = false, HelpText = "Enable skips the Profiles Manager popup during gameplay. Select the desired profile before starting the game")]
public bool SkipUserProfilesManager { get; set; }
// Values
[Value(0, MetaName = "input", HelpText = "Input to load.", Required = true)]

View file

@ -15,7 +15,7 @@ namespace Ryujinx.Ava.Systems.Configuration
/// <summary>
/// The current version of the file format
/// </summary>
public const int CurrentVersion = 68;
public const int CurrentVersion = 69;
/// <summary>
/// Version of the configuration file format
@ -187,6 +187,11 @@ namespace Ryujinx.Ava.Systems.Configuration
/// </summary>
public bool IgnoreApplet { get; set; }
/// <summary>
/// Skip user profiles manager dialog during gameplay(the used profile in the configuration will be selected)
/// </summary>
public bool SkipUserProfiles { get; set; }
/// <summary>
/// Enables or disables save window size, position and state on close.
/// </summary>

View file

@ -103,6 +103,7 @@ namespace Ryujinx.Ava.Systems.Configuration
System.DramSize.Value = cff.DramSize;
System.IgnoreMissingServices.Value = cff.IgnoreMissingServices;
System.IgnoreControllerApplet.Value = cff.IgnoreApplet;
System.SkipUserProfilesManager.Value = cff.SkipUserProfiles;
System.UseHypervisor.Value = cff.UseHypervisor;
UI.GuiColumns.FavColumn.Value = shouldLoadFromFile ? cff.GuiColumns.FavColumn : UI.GuiColumns.FavColumn.Value;
@ -459,7 +460,8 @@ namespace Ryujinx.Ava.Systems.Configuration
TurboMode = Key.Unbound,
TurboModeWhileHeld = false
};
})
}),
(69, static cff => cff.SkipUserProfiles = false)
);
}
}

View file

@ -395,6 +395,11 @@ namespace Ryujinx.Ava.Systems.Configuration
/// </summary>
public ReactiveObject<bool> IgnoreControllerApplet { get; private set; }
/// <summary>
/// Skip User Profiles Manager
/// </summary>
public ReactiveObject<bool> SkipUserProfilesManager { get; private set; }
/// <summary>
/// Uses Hypervisor over JIT if available
/// </summary>
@ -445,6 +450,8 @@ namespace Ryujinx.Ava.Systems.Configuration
IgnoreMissingServices.LogChangesToValue(nameof(IgnoreMissingServices));
IgnoreControllerApplet = new ReactiveObject<bool>();
IgnoreControllerApplet.LogChangesToValue(nameof(IgnoreControllerApplet));
SkipUserProfilesManager = new ReactiveObject<bool>();
SkipUserProfilesManager.LogChangesToValue(nameof(SkipUserProfilesManager));
AudioVolume = new ReactiveObject<float>();
AudioVolume.LogChangesToValue(nameof(AudioVolume));
UseHypervisor = new ReactiveObject<bool>();

View file

@ -82,6 +82,7 @@ namespace Ryujinx.Ava.Systems.Configuration
DramSize = System.DramSize,
IgnoreMissingServices = System.IgnoreMissingServices,
IgnoreApplet = System.IgnoreControllerApplet,
SkipUserProfiles = System.SkipUserProfilesManager,
UseHypervisor = System.UseHypervisor,
GuiColumns = new GuiColumns
{
@ -206,6 +207,7 @@ namespace Ryujinx.Ava.Systems.Configuration
System.DramSize.Value = MemoryConfiguration.MemoryConfiguration4GiB;
System.IgnoreMissingServices.Value = false;
System.IgnoreControllerApplet.Value = false;
System.SkipUserProfilesManager.Value = false;
System.UseHypervisor.Value = true;
Multiplayer.LanInterfaceId.Value = "0";
Multiplayer.Mode.Value = MultiplayerMode.Disabled;

View file

@ -3,6 +3,7 @@ using Avalonia.Controls;
using Avalonia.Input;
using FluentAvalonia.UI.Controls;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.Systems.Configuration;
using Ryujinx.Ava.UI.Controls;
using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.ViewModels;
@ -78,6 +79,13 @@ namespace Ryujinx.Ava.UI.Applet
public static async Task<(UserId Id, bool Result)> ShowInputDialog(ProfileSelectorDialogViewModel viewModel)
{
if (ConfigurationState.Instance.System.SkipUserProfilesManager)
{
UserId defaultId = viewModel.SelectedUserId;
return (defaultId, true);
}
ContentDialog contentDialog = new()
{
Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle],

View file

@ -133,6 +133,7 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool EnableDiscordIntegration { get; set; }
public bool ShowConfirmExit { get; set; }
public bool IgnoreApplet { get; set; }
public bool SkipUserProfiles { get; set; }
public bool RememberWindowState { get; set; }
public bool ShowOldUI { get; set; }
public int HideCursor { get; set; }
@ -606,6 +607,7 @@ namespace Ryujinx.Ava.UI.ViewModels
DramSize = config.System.DramSize;
IgnoreMissingServices = config.System.IgnoreMissingServices;
IgnoreApplet = config.System.IgnoreControllerApplet;
SkipUserProfiles = config.System.SkipUserProfilesManager;
// CPU
EnablePptc = config.System.EnablePtc;
@ -709,6 +711,7 @@ namespace Ryujinx.Ava.UI.ViewModels
config.System.DramSize.Value = DramSize;
config.System.IgnoreMissingServices.Value = IgnoreMissingServices;
config.System.IgnoreControllerApplet.Value = IgnoreApplet;
config.System.SkipUserProfilesManager.Value = SkipUserProfiles;
// CPU
config.System.EnablePtc.Value = EnablePptc;

View file

@ -328,6 +328,11 @@
ToolTip.Tip="{ext:Locale SettingsTabSystemEnableCustomVSyncIntervalTooltip}">
<TextBlock Text="{ext:Locale SettingsTabSystemEnableCustomVSyncInterval}" />
</CheckBox>
<CheckBox
IsChecked="{Binding SkipUserProfiles}"
ToolTip.Tip="{ext:Locale SkipUserProfilesTooltip}">
<TextBlock Text="{ext:Locale SettingsTabSystemSkipUserProfilesManager}" />
</CheckBox>
</StackPanel>
</StackPanel>
</Border>