mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-09 20:18:35 +00:00
0ff00bd6d3
* am: Implemnet common web applets This implement parsing of input and output of web applets while making those close directly. TODO for the future: Use and hook a web browser. * Address Ac_K's comments
36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
using Ryujinx.HLE.HOS.Applets.Browser;
|
|
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Ryujinx.HLE.HOS.Applets
|
|
{
|
|
static class AppletManager
|
|
{
|
|
private static Dictionary<AppletId, Type> _appletMapping;
|
|
|
|
static AppletManager()
|
|
{
|
|
_appletMapping = new Dictionary<AppletId, Type>
|
|
{
|
|
{ AppletId.PlayerSelect, typeof(PlayerSelectApplet) },
|
|
{ AppletId.Controller, typeof(ControllerApplet) },
|
|
{ AppletId.SoftwareKeyboard, typeof(SoftwareKeyboardApplet) },
|
|
{ AppletId.LibAppletWeb, typeof(BrowserApplet) },
|
|
{ AppletId.LibAppletShop, typeof(BrowserApplet) },
|
|
{ AppletId.LibAppletOff, typeof(BrowserApplet) }
|
|
};
|
|
}
|
|
|
|
public static IApplet Create(AppletId applet, Horizon system)
|
|
{
|
|
if (_appletMapping.TryGetValue(applet, out Type appletClass))
|
|
{
|
|
return (IApplet)Activator.CreateInstance(appletClass, system);
|
|
}
|
|
|
|
throw new NotImplementedException($"{applet} applet is not implemented.");
|
|
}
|
|
}
|
|
}
|