hia: Fix last used profile loading, (hopefully) fixed logo loading

This commit is contained in:
Evan Husted 2024-12-11 16:21:13 -06:00 committed by Evan Husted
parent a0daea75d6
commit 2637a445c7
4 changed files with 21 additions and 14 deletions

View File

@ -142,7 +142,11 @@ namespace Ryujinx.Headless
string configurationPath = null;
// Now load the configuration as the other subsystems are now registered
if (File.Exists(localConfigurationPath))
if (customConfigPath != null && File.Exists(customConfigPath))
{
configurationPath = customConfigPath;
}
else if (File.Exists(localConfigurationPath))
{
configurationPath = localConfigurationPath;
}
@ -150,10 +154,6 @@ namespace Ryujinx.Headless
{
configurationPath = appDataConfigurationPath;
}
else if (customConfigPath != null && File.Exists(customConfigPath))
{
configurationPath = customConfigPath;
}
if (configurationPath == null)
{
@ -413,11 +413,19 @@ namespace Ryujinx.Headless
{
Initialize();
bool useLastUsedProfile = false;
if (option.InheritConfig)
option.InheritMainConfig(originalArgs, ConfigurationState.Instance, out _inputConfiguration);
{
option.InheritMainConfig(originalArgs, ConfigurationState.Instance, out _inputConfiguration,
out useLastUsedProfile);
}
AppDataManager.Initialize(option.BaseDataDir);
if (useLastUsedProfile && AccountSaveDataManager.GetLastUsedUser().TryGet(out var profile))
option.UserProfile = profile.Name;
// Check if keys exists.
if (!File.Exists(Path.Combine(AppDataManager.KeysDirPath, "prod.keys")))
{

View File

@ -17,10 +17,9 @@ namespace Ryujinx.Headless
{
// General
public void InheritMainConfig(string[] originalArgs, ConfigurationState configurationState, out List<InputConfig> inputConfigs)
public void InheritMainConfig(string[] originalArgs, ConfigurationState configurationState, out List<InputConfig> inputConfigs, out bool needsProfileSet)
{
if (NeedsOverride(nameof(UserProfile)) && AccountSaveDataManager.GetLastUsedUser().TryGet(out var profile))
UserProfile = profile.Name;
needsProfileSet = NeedsOverride(nameof(UserProfile));
if (NeedsOverride(nameof(IsFullscreen)))
IsFullscreen = configurationState.UI.StartFullscreen;

View File

@ -137,7 +137,7 @@ namespace Ryujinx.Headless
private void SetWindowIcon()
{
Stream iconStream = typeof(WindowBase).Assembly.GetManifestResourceStream("Ryujinx.Ryujinx.bmp");
Stream iconStream = typeof(Program).Assembly.GetManifestResourceStream("HeadlessLogo");
byte[] iconBytes = new byte[iconStream!.Length];
if (iconStream.Read(iconBytes, 0, iconBytes.Length) != iconBytes.Length)

View File

@ -134,7 +134,7 @@
<EmbeddedResource Include="Assets\Icons\Controller_JoyConPair.svg" />
<EmbeddedResource Include="Assets\Icons\Controller_JoyConRight.svg" />
<EmbeddedResource Include="Assets\Icons\Controller_ProCon.svg" />
<EmbeddedResource Include="Headless\Ryujinx.bmp" />
<EmbeddedResource Include="Headless\Ryujinx.bmp" LogicalName="HeadlessLogo" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="Assets\locales.json" />