Small changes

This commit is contained in:
Jacobwasbeast 2025-01-18 18:05:45 -06:00
parent 696bc2081f
commit afed4a3ec0
3 changed files with 9 additions and 8 deletions

View File

@ -27,6 +27,7 @@ using static SDL2.SDL;
using AntiAliasing = Ryujinx.Common.Configuration.AntiAliasing; using AntiAliasing = Ryujinx.Common.Configuration.AntiAliasing;
using ScalingFilter = Ryujinx.Common.Configuration.ScalingFilter; using ScalingFilter = Ryujinx.Common.Configuration.ScalingFilter;
using Switch = Ryujinx.HLE.Switch; using Switch = Ryujinx.HLE.Switch;
using UserProfile = Ryujinx.HLE.HOS.Services.Account.Acc.UserProfile;
namespace Ryujinx.Headless namespace Ryujinx.Headless
{ {

View File

@ -270,16 +270,16 @@ namespace Ryujinx.Ava.UI.Applet
Dispatcher.UIThread.InvokeAsync(async () => Dispatcher.UIThread.InvokeAsync(async () =>
{ {
var Profiles = new ObservableCollection<BaseModel>(); ObservableCollection<BaseModel> profiles = [];
var nav = new NavigationDialogHost(); NavigationDialogHost nav = new();
_parent.AccountManager.GetAllUsers() _parent.AccountManager.GetAllUsers()
.OrderBy(x => x.Name) .OrderBy(x => x.Name)
.ForEach(profile => Profiles.Add(new Models.UserProfile(profile, nav))); .ForEach(profile => profiles.Add(new Models.UserProfile(profile, nav)));
Profiles.Add(new Models.UserProfile(guest, nav)); profiles.Add(new Models.UserProfile(guest, nav));
var content = new UserSelectorDialog(Profiles); UserSelectorDialog content = new(profiles);
(UserId id, _) = await UserSelectorDialog.ShowInputDialog(content, _parent.AccountManager.LastOpenedUser); (UserId id, _) = await UserSelectorDialog.ShowInputDialog(content, _parent.AccountManager.LastOpenedUser);
selected = id; selected = id;

View File

@ -65,7 +65,7 @@ namespace Ryujinx.Ava.UI.Applet
{ {
_selectedUserId = userProfile.UserId; _selectedUserId = userProfile.UserId;
Logger.Info?.Print(LogClass.UI, $"Selected user: {userProfile.UserId}"); Logger.Info?.Print(LogClass.UI, $"Selected user: {userProfile.UserId}");
var NewProfiles = new ObservableCollection<BaseModel>(); ObservableCollection<BaseModel> newProfiles = [];
foreach (var item in Profiles) foreach (var item in Profiles)
{ {
@ -76,10 +76,10 @@ namespace Ryujinx.Ava.UI.Applet
{ {
profile.AccountState = AccountState.Open; profile.AccountState = AccountState.Open;
} }
NewProfiles.Add(new UserProfile(profile, new NavigationDialogHost())); newProfiles.Add(new UserProfile(profile, new NavigationDialogHost()));
} }
Profiles = NewProfiles; Profiles = newProfiles;
OnPropertyChanged(nameof(Profiles)); OnPropertyChanged(nameof(Profiles));
} }
} }