Add the player select applet. #537

Merged
Jacobwasbeast merged 10 commits from feature-playerSelect into master 2025-01-19 02:40:33 +00:00
3 changed files with 30 additions and 23 deletions
Showing only changes of commit ec50f29733 - Show all commits

View File

@ -1,5 +1,3 @@
using Ryujinx.Common;
using Ryujinx.Common.Logging;
using Ryujinx.Common.Memory;
using Ryujinx.HLE.HOS.Services.Account.Acc;
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
@ -30,10 +28,13 @@ namespace Ryujinx.HLE.HOS.Applets
_interactiveSession = interactiveSession;
UserProfile selected = _system.Device.UIHandler.ShowPlayerSelectDialog();
if (selected.UserId == new UserId("00000000000000000000000000000080"))
if (selected == null)
{
_normalSession.Push(BuildResponse());
}
else if (selected.UserId == new UserId("00000000000000000000000000000080"))
{
_normalSession.Push(BuildGuestResponse());
Logger.Info?.Print(LogClass.Service,$"[Player Select] Guest Selected");
}
else
{
@ -67,5 +68,15 @@ namespace Ryujinx.HLE.HOS.Applets
return stream.ToArray();
}
private byte[] BuildResponse()
{
using MemoryStream stream = MemoryStreamManager.Shared.GetStream();
using BinaryWriter writer = new(stream);
writer.Write((ulong)PlayerSelectResult.Failure);
return stream.ToArray();
}
}
}

View File

@ -1,6 +1,4 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Media.Imaging;
using Avalonia.Threading;
using FluentAvalonia.UI.Controls;
using Gommon;
@ -282,16 +280,9 @@ namespace Ryujinx.Ava.UI.Applet
Profiles.Add(new Models.UserProfile(guest, nav));
var content = new UserSelectorDialog(Profiles);
(UserId id, _) = await UserSelectorDialog.ShowInputDialog(content);
(UserId id, _) = await UserSelectorDialog.ShowInputDialog(content, _parent.AccountManager.LastOpenedUser);
if (id != UserId.Null)
{
selected = id;
}
else
{
selected = _parent.AccountManager.LastOpenedUser.UserId;
}
dialogCloseEvent.Set();
});
@ -303,6 +294,10 @@ namespace Ryujinx.Ava.UI.Applet
{
profile = guest;
}
else if (selected == UserId.Null)
{
profile = null;
}
else
{
foreach (UserProfile p in _parent.AccountManager.GetAllUsers())

View File

@ -1,22 +1,17 @@
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
using FluentAvalonia.UI.Controls;
using FluentAvalonia.UI.Navigation;
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Controls;
using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Applets;
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
using Ryujinx.HLE.HOS.Services.Account.Acc;
using shaderc;
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Button = Avalonia.Controls.Button;
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
using UserProfile = Ryujinx.Ava.UI.Models.UserProfile;
using UserProfileSft = Ryujinx.HLE.HOS.Services.Account.Acc.UserProfile;
@ -91,14 +86,15 @@ namespace Ryujinx.Ava.UI.Applet
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
}
}
public static async Task<(UserId id, bool result)> ShowInputDialog(UserSelectorDialog content)
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
public static async Task<(UserId id, bool result)> ShowInputDialog(UserSelectorDialog content, UserProfileSft accountManagerLastOpenedUser)
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
{
content._selectedUserId = accountManagerLastOpenedUser.UserId;
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
ContentDialog contentDialog = new()
{
Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle],
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.Continue],
SecondaryButtonText = string.Empty,
CloseButtonText = string.Empty,
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
CloseButtonText = LocaleManager.Instance[LocaleKeys.Cancel],
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
Content = content,
Padding = new Thickness(0)
};
@ -114,6 +110,11 @@ namespace Ryujinx.Ava.UI.Applet
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
result = view?._selectedUserId ?? UserId.Null;
input = true;
}
else
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
{
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
result = UserId.Null;
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
input = false;
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
}
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
}
contentDialog.Closed += Handler;

GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:21:52 +00:00 (Migrated from github.com)
Review

sender is Grid { DataContext: UserProfile profile }

`sender is Grid { DataContext: UserProfile profile }`
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:22:00 +00:00 (Migrated from github.com)
Review

Identical to above

Identical to above
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`
GreemDev commented 2025-01-19 00:23:14 +00:00 (Migrated from github.com)
Review

The value names in tuples should be PascalCase; Task<(UserId Id, bool Result)>

The value names in tuples should be PascalCase; `Task<(UserId Id, bool Result)>`