Add the player select applet. #537

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

View File

@ -1,3 +1,4 @@
using Ryujinx.Common;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Common.Memory; using Ryujinx.Common.Memory;
using Ryujinx.HLE.HOS.Services.Account.Acc; using Ryujinx.HLE.HOS.Services.Account.Acc;
@ -29,7 +30,15 @@ namespace Ryujinx.HLE.HOS.Applets
_interactiveSession = interactiveSession; _interactiveSession = interactiveSession;
UserProfile selected = _system.Device.UIHandler.ShowPlayerSelectDialog(); UserProfile selected = _system.Device.UIHandler.ShowPlayerSelectDialog();
_normalSession.Push(BuildResponse(selected)); if (selected.UserId == new UserId("00000000000000000000000000000080"))
{
_normalSession.Push(BuildGuestResponse());
Logger.Info?.Print(LogClass.Service,$"[Player Select] Guest Selected");
}
else
{
_normalSession.Push(BuildResponse(selected));
}
AppletStateChanged?.Invoke(this, null); AppletStateChanged?.Invoke(this, null);
_system.ReturnFocus(); _system.ReturnFocus();
@ -48,5 +57,15 @@ namespace Ryujinx.HLE.HOS.Applets
return stream.ToArray(); return stream.ToArray();
} }
private byte[] BuildGuestResponse()
{
using MemoryStream stream = MemoryStreamManager.Shared.GetStream();
using BinaryWriter writer = new(stream);
writer.Write(new byte());
return stream.ToArray();
}
} }
} }

View File

@ -576,7 +576,7 @@ namespace Ryujinx.Headless
public UserProfile ShowPlayerSelectDialog() public UserProfile ShowPlayerSelectDialog()
{ {
throw new NotImplementedException(); return AccountSaveDataManager.GetLastUsedUser();
} }
} }
} }