Merge 0ab2c80575
into ca59c3f499
This commit is contained in:
commit
87b1f1e069
4 changed files with 34 additions and 6 deletions
|
@ -37,13 +37,16 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
|||
|
||||
_accountSaveDataManager = new AccountSaveDataManager(_profiles);
|
||||
|
||||
if (!_profiles.TryGetValue(DefaultUserId.ToString(), out _))
|
||||
if (_profiles.IsEmpty)
|
||||
{
|
||||
byte[] defaultUserImage = EmbeddedResources.Read("Ryujinx.HLE/HOS/Services/Account/Acc/DefaultUserImage.jpg");
|
||||
|
||||
AddUser("RyuPlayer", defaultUserImage, DefaultUserId);
|
||||
// Use a random UserId as default to avoid issues in multiplayer per #3396.
|
||||
UserId userId = new UserId(Guid.NewGuid().ToString().Replace("-", ""));
|
||||
|
||||
OpenUser(DefaultUserId);
|
||||
AddUser("RyuPlayer", defaultUserImage, userId);
|
||||
|
||||
OpenUser(userId);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -184,7 +187,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
|||
|
||||
_profiles.Remove(userId.ToString(), out _);
|
||||
|
||||
OpenUser(DefaultUserId);
|
||||
OpenUser(new UserId(_profiles.First().Key));
|
||||
|
||||
_accountSaveDataManager.Save(_profiles);
|
||||
}
|
||||
|
|
|
@ -129,6 +129,13 @@ namespace Ryujinx.Ava
|
|||
}
|
||||
}
|
||||
|
||||
// Check if we've made any profiles yet
|
||||
if (!File.Exists(Path.Combine(AppDataManager.BaseDirPath, "system", "Profiles.json")))
|
||||
{
|
||||
MainWindow.ShowNewUserEditPrompt = true;
|
||||
}
|
||||
|
||||
|
||||
if (CommandLineState.LaunchPathArg != null)
|
||||
{
|
||||
MainWindow.DeferLoadApplication(CommandLineState.LaunchPathArg, CommandLineState.LaunchApplicationId, CommandLineState.StartFullscreenArg);
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Interactivity;
|
||||
using FluentAvalonia.Core;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using FluentAvalonia.UI.Navigation;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.UI.Controls;
|
||||
using Ryujinx.Ava.UI.Helpers;
|
||||
using Ryujinx.Ava.UI.Models;
|
||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||
using System;
|
||||
using UserProfile = Ryujinx.Ava.UI.Models.UserProfile;
|
||||
|
||||
|
@ -21,7 +21,9 @@ namespace Ryujinx.Ava.UI.Views.User
|
|||
|
||||
public TempProfile TempProfile { get; set; }
|
||||
public static uint MaxProfileNameLength => 0x20;
|
||||
public bool IsDeletable => _profile.UserId != AccountManager.DefaultUserId;
|
||||
|
||||
// Don't allow deletion if there is only one user
|
||||
public bool IsDeletable => _parent.AccountManager.GetAllUsers().Count() != 1;
|
||||
|
||||
public UserEditorView()
|
||||
{
|
||||
|
|
|
@ -58,6 +58,8 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
public SettingsWindow SettingsWindow { get; set; }
|
||||
|
||||
public static bool ShowKeyErrorOnLoad { get; set; }
|
||||
|
||||
public static bool ShowNewUserEditPrompt { get; set; }
|
||||
public ApplicationLibrary ApplicationLibrary { get; set; }
|
||||
|
||||
public readonly double StatusBarHeight;
|
||||
|
@ -361,6 +363,20 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
await Dispatcher.UIThread.InvokeAsync(async () => await UserErrorDialog.ShowUserErrorDialog(UserError.NoKeys));
|
||||
}
|
||||
|
||||
if (ShowNewUserEditPrompt)
|
||||
{
|
||||
ShowNewUserEditPrompt = false;
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
UserResult result = await ContentDialogHelper.CreateInfoDialog("The default profile has been created.", "Would you like to manage profiles now?", "Yes", "No", "First Launch");
|
||||
if (result == UserResult.Ok)
|
||||
{
|
||||
await ViewModel.ManageProfiles();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (ConfigurationState.Instance.CheckUpdatesOnStart.Value && Updater.CanUpdate(false))
|
||||
{
|
||||
await Updater.BeginParse(this, false).ContinueWith(task =>
|
||||
|
|
Loading…
Add table
Reference in a new issue