changes completed
This commit is contained in:
parent
4250ba84f0
commit
1696eb1197
8 changed files with 402 additions and 262 deletions
|
@ -565,18 +565,34 @@ namespace Ryujinx.HLE.HOS
|
||||||
if (nacpSize != 0)
|
if (nacpSize != 0)
|
||||||
{
|
{
|
||||||
input.Seek(obj.FileSize + (long)nacpOffset, SeekOrigin.Begin);
|
input.Seek(obj.FileSize + (long)nacpOffset, SeekOrigin.Begin);
|
||||||
using (MemoryStream stream = new MemoryStream(reader.ReadBytes((int)nacpSize))) { ControlData = new Nacp(stream); }
|
using (MemoryStream stream = new MemoryStream(reader.ReadBytes((int)nacpSize)))
|
||||||
|
{
|
||||||
|
ControlData = new Nacp(stream);
|
||||||
|
}
|
||||||
|
|
||||||
metaData.TitleName = ControlData.Descriptions[(int)State.DesiredTitleLanguage].Title;
|
metaData.TitleName = ControlData.Descriptions[(int)State.DesiredTitleLanguage].Title;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(metaData.TitleName))
|
if (string.IsNullOrWhiteSpace(metaData.TitleName))
|
||||||
{
|
{
|
||||||
metaData.TitleName = ControlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Title)).Title;
|
metaData.TitleName = ControlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Title)).Title;
|
||||||
}
|
}
|
||||||
|
|
||||||
metaData.Aci0.TitleId = ControlData.PresenceGroupId;
|
metaData.Aci0.TitleId = ControlData.PresenceGroupId;
|
||||||
if (metaData.Aci0.TitleId == 0) { metaData.Aci0.TitleId = ControlData.SaveDataOwnerId; }
|
|
||||||
if (metaData.Aci0.TitleId == 0) { metaData.Aci0.TitleId = ControlData.AddOnContentBaseId - 0x1000; }
|
if (metaData.Aci0.TitleId == 0)
|
||||||
if (metaData.Aci0.TitleId.ToString("x16") == "fffffffffffff000") { metaData.Aci0.TitleId = 0000000000000000; }
|
{
|
||||||
|
metaData.Aci0.TitleId = ControlData.SaveDataOwnerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (metaData.Aci0.TitleId == 0)
|
||||||
|
{
|
||||||
|
metaData.Aci0.TitleId = ControlData.AddOnContentBaseId - 0x1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (metaData.Aci0.TitleId.ToString("x16") == "fffffffffffff000")
|
||||||
|
{
|
||||||
|
metaData.Aci0.TitleId = 0000000000000000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -702,7 +718,9 @@ namespace Ryujinx.HLE.HOS
|
||||||
// It's only safe to release resources once all threads
|
// It's only safe to release resources once all threads
|
||||||
// have exited.
|
// have exited.
|
||||||
ThreadCounter.Signal();
|
ThreadCounter.Signal();
|
||||||
//ThreadCounter.Wait();
|
//ThreadCounter.Wait(); // FIXME: Uncomment this
|
||||||
|
// BODY: Right now, guest processes don't exit properly because the logic waits for them to exit.
|
||||||
|
// BODY: However, this doesn't happen when you close the main window so we need to find a way to make them exit gracefully
|
||||||
|
|
||||||
Scheduler.Dispose();
|
Scheduler.Dispose();
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
{
|
{
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
|
|
||||||
public int Category { get; private set; }
|
public int Category { get; private set; }
|
||||||
public ulong TitleId { get; private set; }
|
public ulong TitleId { get; private set; }
|
||||||
|
|
||||||
public ulong CodeAddress { get; private set; }
|
public ulong CodeAddress { get; private set; }
|
||||||
public int CodePagesCount { get; private set; }
|
public int CodePagesCount { get; private set; }
|
||||||
|
|
|
@ -184,8 +184,8 @@ namespace Ryujinx
|
||||||
/// <param name="path">The path to the JSON configuration file</param>
|
/// <param name="path">The path to the JSON configuration file</param>
|
||||||
public static async Task LoadAsync(string path)
|
public static async Task LoadAsync(string path)
|
||||||
{
|
{
|
||||||
var resolver = CompositeResolver.Create(
|
IJsonFormatterResolver resolver = CompositeResolver.Create(
|
||||||
new[] { new ConfigurationEnumFormatter<Key>() },
|
new[] { new ConfigurationEnumFormatter<Key>() },
|
||||||
new[] { StandardResolver.AllowPrivateSnakeCase }
|
new[] { StandardResolver.AllowPrivateSnakeCase }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -201,12 +201,12 @@ namespace Ryujinx
|
||||||
/// <param name="path">The path to the JSON configuration file</param>
|
/// <param name="path">The path to the JSON configuration file</param>
|
||||||
public static void SaveConfig(Configuration config, string path)
|
public static void SaveConfig(Configuration config, string path)
|
||||||
{
|
{
|
||||||
var resolver = CompositeResolver.Create(
|
IJsonFormatterResolver resolver = CompositeResolver.Create(
|
||||||
new[] { new ConfigurationEnumFormatter<Key>() },
|
new[] { new ConfigurationEnumFormatter<Key>() },
|
||||||
new[] { StandardResolver.AllowPrivateSnakeCase }
|
new[] { StandardResolver.AllowPrivateSnakeCase }
|
||||||
);
|
);
|
||||||
|
|
||||||
var data = JsonSerializer.Serialize(config, resolver);
|
byte[] data = JsonSerializer.Serialize(config, resolver);
|
||||||
File.WriteAllText(path, Encoding.UTF8.GetString(data, 0, data.Length).PrettyPrintJson());
|
File.WriteAllText(path, Encoding.UTF8.GetString(data, 0, data.Length).PrettyPrintJson());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,12 +245,12 @@ namespace Ryujinx
|
||||||
{
|
{
|
||||||
GraphicsConfig.ShadersDumpPath = SwitchConfig.GraphicsShadersDumpPath;
|
GraphicsConfig.ShadersDumpPath = SwitchConfig.GraphicsShadersDumpPath;
|
||||||
|
|
||||||
Logger.SetEnable(LogLevel.Debug , SwitchConfig.LoggingEnableDebug );
|
Logger.SetEnable(LogLevel.Debug, SwitchConfig.LoggingEnableDebug );
|
||||||
Logger.SetEnable(LogLevel.Stub , SwitchConfig.LoggingEnableStub );
|
Logger.SetEnable(LogLevel.Stub, SwitchConfig.LoggingEnableStub );
|
||||||
Logger.SetEnable(LogLevel.Info , SwitchConfig.LoggingEnableInfo );
|
Logger.SetEnable(LogLevel.Info, SwitchConfig.LoggingEnableInfo );
|
||||||
Logger.SetEnable(LogLevel.Warning , SwitchConfig.LoggingEnableWarn );
|
Logger.SetEnable(LogLevel.Warning, SwitchConfig.LoggingEnableWarn );
|
||||||
Logger.SetEnable(LogLevel.Error , SwitchConfig.LoggingEnableError );
|
Logger.SetEnable(LogLevel.Error, SwitchConfig.LoggingEnableError );
|
||||||
Logger.SetEnable(LogLevel.Guest , SwitchConfig.LoggingEnableGuest );
|
Logger.SetEnable(LogLevel.Guest, SwitchConfig.LoggingEnableGuest );
|
||||||
Logger.SetEnable(LogLevel.AccessLog, SwitchConfig.LoggingEnableFsAccessLog);
|
Logger.SetEnable(LogLevel.AccessLog, SwitchConfig.LoggingEnableFsAccessLog);
|
||||||
|
|
||||||
if (SwitchConfig.LoggingFilteredClasses.Length > 0)
|
if (SwitchConfig.LoggingFilteredClasses.Length > 0)
|
||||||
|
|
|
@ -23,12 +23,12 @@ namespace Ryujinx
|
||||||
|
|
||||||
Application.Init();
|
Application.Init();
|
||||||
|
|
||||||
Application gtkapp = new Application("Ryujinx.Ryujinx", GLib.ApplicationFlags.None);
|
Application gtkApplication = new Application("Ryujinx.Ryujinx", GLib.ApplicationFlags.None);
|
||||||
MainWindow win = new MainWindow(args, gtkapp);
|
MainWindow mainWindow = new MainWindow(args, gtkApplication);
|
||||||
|
|
||||||
gtkapp.Register(GLib.Cancellable.Current);
|
gtkApplication.Register(GLib.Cancellable.Current);
|
||||||
gtkapp.AddWindow(win);
|
gtkApplication.AddWindow(mainWindow);
|
||||||
win.Show();
|
mainWindow.Show();
|
||||||
|
|
||||||
Application.Run();
|
Application.Run();
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,10 @@ namespace Ryujinx.UI
|
||||||
|
|
||||||
_versionText.Text = $"Version {Information.InstallVersion} - {Information.InstallBranch} ({Information.InstallCommit})";
|
_versionText.Text = $"Version {Information.InstallVersion} - {Information.InstallBranch} ({Information.InstallCommit})";
|
||||||
}
|
}
|
||||||
catch { _versionText.Text = "Unknown Version"; }
|
catch
|
||||||
|
{
|
||||||
|
_versionText.Text = "Unknown Version";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OpenUrl(string url)
|
public void OpenUrl(string url)
|
||||||
|
|
|
@ -8,13 +8,14 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using SystemState = Ryujinx.HLE.HOS.SystemState;
|
||||||
|
|
||||||
namespace Ryujinx.UI
|
namespace Ryujinx.UI
|
||||||
{
|
{
|
||||||
public class ApplicationLibrary
|
public class ApplicationLibrary
|
||||||
{
|
{
|
||||||
private static Keyset KeySet;
|
private static Keyset KeySet;
|
||||||
private static HLE.HOS.SystemState.TitleLanguage DesiredTitleLanguage;
|
private static SystemState.TitleLanguage DesiredTitleLanguage;
|
||||||
|
|
||||||
private const double SecondsPerMinute = 60.0;
|
private const double SecondsPerMinute = 60.0;
|
||||||
private const double SecondsPerHour = SecondsPerMinute * 60;
|
private const double SecondsPerHour = SecondsPerMinute * 60;
|
||||||
|
@ -42,7 +43,7 @@ namespace Ryujinx.UI
|
||||||
public string Path;
|
public string Path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Init(List<string> AppDirs, Keyset keySet, HLE.HOS.SystemState.TitleLanguage desiredTitleLanguage)
|
public static void Init(List<string> AppDirs, Keyset keySet, SystemState.TitleLanguage desiredTitleLanguage)
|
||||||
{
|
{
|
||||||
KeySet = keySet;
|
KeySet = keySet;
|
||||||
DesiredTitleLanguage = desiredTitleLanguage;
|
DesiredTitleLanguage = desiredTitleLanguage;
|
||||||
|
@ -66,7 +67,7 @@ namespace Ryujinx.UI
|
||||||
}
|
}
|
||||||
|
|
||||||
DirectoryInfo AppDirInfo = new DirectoryInfo(appDir);
|
DirectoryInfo AppDirInfo = new DirectoryInfo(appDir);
|
||||||
foreach (var App in AppDirInfo.GetFiles())
|
foreach (FileInfo App in AppDirInfo.GetFiles())
|
||||||
{
|
{
|
||||||
if ((Path.GetExtension(App.ToString()) == ".xci") ||
|
if ((Path.GetExtension(App.ToString()) == ".xci") ||
|
||||||
(Path.GetExtension(App.ToString()) == ".nca") ||
|
(Path.GetExtension(App.ToString()) == ".nca") ||
|
||||||
|
@ -84,12 +85,12 @@ namespace Ryujinx.UI
|
||||||
ApplicationLibraryData = new List<ApplicationData>();
|
ApplicationLibraryData = new List<ApplicationData>();
|
||||||
foreach (string applicationPath in applications)
|
foreach (string applicationPath in applications)
|
||||||
{
|
{
|
||||||
double filesize = new FileInfo(applicationPath).Length * 0.000000000931;
|
double filesize = new FileInfo(applicationPath).Length * 0.000000000931;
|
||||||
string titleName = null;
|
string titleName = null;
|
||||||
string titleId = null;
|
string titleId = null;
|
||||||
string developer = null;
|
string developer = null;
|
||||||
string version = null;
|
string version = null;
|
||||||
byte[] applicationIcon = null;
|
byte[] applicationIcon = null;
|
||||||
|
|
||||||
using (FileStream file = new FileStream(applicationPath, FileMode.Open, FileAccess.Read))
|
using (FileStream file = new FileStream(applicationPath, FileMode.Open, FileAccess.Read))
|
||||||
{
|
{
|
||||||
|
@ -105,9 +106,13 @@ namespace Ryujinx.UI
|
||||||
if (Path.GetExtension(applicationPath) == ".xci")
|
if (Path.GetExtension(applicationPath) == ".xci")
|
||||||
{
|
{
|
||||||
Xci xci = new Xci(KeySet, file.AsStorage());
|
Xci xci = new Xci(KeySet, file.AsStorage());
|
||||||
|
|
||||||
controlFs = GetControlFs(xci.OpenPartition(XciPartitionType.Secure));
|
controlFs = GetControlFs(xci.OpenPartition(XciPartitionType.Secure));
|
||||||
}
|
}
|
||||||
else { controlFs = GetControlFs(new PartitionFileSystem(file.AsStorage())); }
|
else
|
||||||
|
{
|
||||||
|
controlFs = GetControlFs(new PartitionFileSystem(file.AsStorage()));
|
||||||
|
}
|
||||||
|
|
||||||
// Creates NACP class from the NACP file
|
// Creates NACP class from the NACP file
|
||||||
IFile controlNacp = controlFs.OpenFile("/control.nacp", OpenMode.Read);
|
IFile controlNacp = controlFs.OpenFile("/control.nacp", OpenMode.Read);
|
||||||
|
@ -117,16 +122,26 @@ namespace Ryujinx.UI
|
||||||
version = controlData.DisplayVersion;
|
version = controlData.DisplayVersion;
|
||||||
|
|
||||||
titleName = controlData.Descriptions[(int)DesiredTitleLanguage].Title;
|
titleName = controlData.Descriptions[(int)DesiredTitleLanguage].Title;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(titleName))
|
if (string.IsNullOrWhiteSpace(titleName))
|
||||||
{
|
{
|
||||||
titleName = controlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Title)).Title;
|
titleName = controlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Title)).Title;
|
||||||
}
|
}
|
||||||
|
|
||||||
titleId = controlData.PresenceGroupId.ToString("x16");
|
titleId = controlData.PresenceGroupId.ToString("x16");
|
||||||
if (string.IsNullOrWhiteSpace(titleId)) { titleId = controlData.SaveDataOwnerId.ToString("x16"); }
|
|
||||||
if (string.IsNullOrWhiteSpace(titleId)) { titleId = (controlData.AddOnContentBaseId - 0x1000).ToString("x16"); }
|
if (string.IsNullOrWhiteSpace(titleId))
|
||||||
|
{
|
||||||
|
titleId = controlData.SaveDataOwnerId.ToString("x16");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(titleId))
|
||||||
|
{
|
||||||
|
titleId = (controlData.AddOnContentBaseId - 0x1000).ToString("x16");
|
||||||
|
}
|
||||||
|
|
||||||
developer = controlData.Descriptions[(int)DesiredTitleLanguage].Developer;
|
developer = controlData.Descriptions[(int)DesiredTitleLanguage].Developer;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(developer))
|
if (string.IsNullOrWhiteSpace(developer))
|
||||||
{
|
{
|
||||||
developer = controlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Developer)).Developer;
|
developer = controlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Developer)).Developer;
|
||||||
|
@ -136,10 +151,10 @@ namespace Ryujinx.UI
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IFile icon = controlFs.OpenFile($"/icon_{DesiredTitleLanguage}.dat", OpenMode.Read);
|
IFile icon = controlFs.OpenFile($"/icon_{DesiredTitleLanguage}.dat", OpenMode.Read);
|
||||||
using (MemoryStream ms = new MemoryStream())
|
using (MemoryStream stream = new MemoryStream())
|
||||||
{
|
{
|
||||||
icon.AsStream().CopyTo(ms);
|
icon.AsStream().CopyTo(stream);
|
||||||
applicationIcon = ms.ToArray();
|
applicationIcon = stream.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (HorizonResultException)
|
catch (HorizonResultException)
|
||||||
|
@ -147,22 +162,34 @@ namespace Ryujinx.UI
|
||||||
IDirectory controlDir = controlFs.OpenDirectory("./", OpenDirectoryMode.All);
|
IDirectory controlDir = controlFs.OpenDirectory("./", OpenDirectoryMode.All);
|
||||||
foreach (DirectoryEntry entry in controlDir.Read())
|
foreach (DirectoryEntry entry in controlDir.Read())
|
||||||
{
|
{
|
||||||
if (entry.Name == "control.nacp") { continue; }
|
if (entry.Name == "control.nacp")
|
||||||
|
|
||||||
IFile icon = controlFs.OpenFile(entry.FullPath, OpenMode.Read);
|
|
||||||
using (MemoryStream ms = new MemoryStream())
|
|
||||||
{
|
{
|
||||||
icon.AsStream().CopyTo(ms);
|
continue;
|
||||||
applicationIcon = ms.ToArray();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (applicationIcon != null) { break; }
|
IFile icon = controlFs.OpenFile(entry.FullPath, OpenMode.Read);
|
||||||
|
using (MemoryStream stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
icon.AsStream().CopyTo(stream);
|
||||||
|
applicationIcon = stream.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (applicationIcon != null)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (applicationIcon == null)
|
if (applicationIcon == null)
|
||||||
{
|
{
|
||||||
if (Path.GetExtension(applicationPath) == ".xci") { applicationIcon = RyujinxXciIcon; }
|
if (Path.GetExtension(applicationPath) == ".xci")
|
||||||
else { applicationIcon = RyujinxNspIcon; }
|
{
|
||||||
|
applicationIcon = RyujinxXciIcon;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
applicationIcon = RyujinxNspIcon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,8 +200,14 @@ namespace Ryujinx.UI
|
||||||
developer = "Unknown";
|
developer = "Unknown";
|
||||||
version = "?";
|
version = "?";
|
||||||
|
|
||||||
if (Path.GetExtension(applicationPath) == ".xci") { applicationIcon = RyujinxXciIcon; }
|
if (Path.GetExtension(applicationPath) == ".xci")
|
||||||
else { applicationIcon = RyujinxNspIcon; }
|
{
|
||||||
|
applicationIcon = RyujinxXciIcon;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
applicationIcon = RyujinxNspIcon;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.PrintError(LogClass.Application, $"Your key set is missing a key with the name: {exception.Name}");
|
Logger.PrintError(LogClass.Application, $"Your key set is missing a key with the name: {exception.Name}");
|
||||||
}
|
}
|
||||||
|
@ -191,7 +224,6 @@ namespace Ryujinx.UI
|
||||||
Logger.PrintError(LogClass.Application, $"The file is not an NCA file or the header key is incorrect. Errored File: {applicationPath}");
|
Logger.PrintError(LogClass.Application, $"The file is not an NCA file or the header key is incorrect. Errored File: {applicationPath}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (Path.GetExtension(applicationPath) == ".nro")
|
else if (Path.GetExtension(applicationPath) == ".nro")
|
||||||
{
|
{
|
||||||
BinaryReader reader = new BinaryReader(file);
|
BinaryReader reader = new BinaryReader(file);
|
||||||
|
@ -199,6 +231,7 @@ namespace Ryujinx.UI
|
||||||
byte[] Read(long Position, int Size)
|
byte[] Read(long Position, int Size)
|
||||||
{
|
{
|
||||||
file.Seek(Position, SeekOrigin.Begin);
|
file.Seek(Position, SeekOrigin.Begin);
|
||||||
|
|
||||||
return reader.ReadBytes(Size);
|
return reader.ReadBytes(Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,33 +261,55 @@ namespace Ryujinx.UI
|
||||||
version = controlData.DisplayVersion;
|
version = controlData.DisplayVersion;
|
||||||
|
|
||||||
titleName = controlData.Descriptions[(int)DesiredTitleLanguage].Title;
|
titleName = controlData.Descriptions[(int)DesiredTitleLanguage].Title;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(titleName))
|
if (string.IsNullOrWhiteSpace(titleName))
|
||||||
{
|
{
|
||||||
titleName = controlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Title)).Title;
|
titleName = controlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Title)).Title;
|
||||||
}
|
}
|
||||||
|
|
||||||
titleId = controlData.PresenceGroupId.ToString("x16");
|
titleId = controlData.PresenceGroupId.ToString("x16");
|
||||||
if (string.IsNullOrWhiteSpace(titleId)) { titleId = controlData.SaveDataOwnerId.ToString("x16"); }
|
|
||||||
if (string.IsNullOrWhiteSpace(titleId)) { titleId = (controlData.AddOnContentBaseId - 0x1000).ToString("x16"); }
|
if (string.IsNullOrWhiteSpace(titleId))
|
||||||
|
{
|
||||||
|
titleId = controlData.SaveDataOwnerId.ToString("x16");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(titleId)) {
|
||||||
|
titleId = (controlData.AddOnContentBaseId - 0x1000).ToString("x16");
|
||||||
|
}
|
||||||
|
|
||||||
developer = controlData.Descriptions[(int)DesiredTitleLanguage].Developer;
|
developer = controlData.Descriptions[(int)DesiredTitleLanguage].Developer;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(developer))
|
if (string.IsNullOrWhiteSpace(developer))
|
||||||
{
|
{
|
||||||
developer = controlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Developer)).Developer;
|
developer = controlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Developer)).Developer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { applicationIcon = RyujinxNroIcon; titleName = "Application"; titleId = "0000000000000000"; developer = "Unknown"; version = "?"; }
|
else
|
||||||
|
{
|
||||||
|
applicationIcon = RyujinxNroIcon;
|
||||||
|
titleName = "Application";
|
||||||
|
titleId = "0000000000000000";
|
||||||
|
developer = "Unknown";
|
||||||
|
version = "?";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If its an NCA or NSO we just set defaults
|
// If its an NCA or NSO we just set defaults
|
||||||
else if ((Path.GetExtension(applicationPath) == ".nca") || (Path.GetExtension(applicationPath) == ".nso"))
|
else if ((Path.GetExtension(applicationPath) == ".nca") || (Path.GetExtension(applicationPath) == ".nso"))
|
||||||
{
|
{
|
||||||
if (Path.GetExtension(applicationPath) == ".nca") { applicationIcon = RyujinxNcaIcon; }
|
if (Path.GetExtension(applicationPath) == ".nca")
|
||||||
else if (Path.GetExtension(applicationPath) == ".nso") { applicationIcon = RyujinxNsoIcon; }
|
{
|
||||||
|
applicationIcon = RyujinxNcaIcon;
|
||||||
|
}
|
||||||
|
else if (Path.GetExtension(applicationPath) == ".nso")
|
||||||
|
{
|
||||||
|
applicationIcon = RyujinxNsoIcon;
|
||||||
|
}
|
||||||
|
|
||||||
string fileName = Path.GetFileName(applicationPath);
|
string fileName = Path.GetFileName(applicationPath);
|
||||||
string fileExt = Path.GetExtension(applicationPath);
|
string fileExt = Path.GetExtension(applicationPath);
|
||||||
|
|
||||||
StringBuilder titlename = new StringBuilder();
|
StringBuilder titlename = new StringBuilder();
|
||||||
titlename.Append(fileName);
|
titlename.Append(fileName);
|
||||||
titlename.Remove(fileName.Length - fileExt.Length, fileExt.Length);
|
titlename.Remove(fileName.Length - fileExt.Length, fileExt.Length);
|
||||||
|
@ -335,7 +390,10 @@ namespace Ryujinx.UI
|
||||||
if (File.Exists(Path.Combine(savePath, "TimePlayed.dat")) == false)
|
if (File.Exists(Path.Combine(savePath, "TimePlayed.dat")) == false)
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(savePath);
|
Directory.CreateDirectory(savePath);
|
||||||
using (FileStream file = File.OpenWrite(Path.Combine(savePath, "TimePlayed.dat"))) { file.Write(Encoding.ASCII.GetBytes("0")); }
|
using (FileStream file = File.OpenWrite(Path.Combine(savePath, "TimePlayed.dat")))
|
||||||
|
{
|
||||||
|
file.Write(Encoding.ASCII.GetBytes("0"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
using (FileStream fs = File.OpenRead(Path.Combine(savePath, "TimePlayed.dat")))
|
using (FileStream fs = File.OpenRead(Path.Combine(savePath, "TimePlayed.dat")))
|
||||||
{
|
{
|
||||||
|
@ -343,10 +401,22 @@ namespace Ryujinx.UI
|
||||||
{
|
{
|
||||||
float timePlayed = float.Parse(sr.ReadLine());
|
float timePlayed = float.Parse(sr.ReadLine());
|
||||||
|
|
||||||
if (timePlayed < SecondsPerMinute) { playedData[0] = $"{timePlayed}s"; }
|
if (timePlayed < SecondsPerMinute)
|
||||||
else if (timePlayed < SecondsPerHour) { playedData[0] = $"{Math.Round(timePlayed / SecondsPerMinute, 2, MidpointRounding.AwayFromZero)} mins"; }
|
{
|
||||||
else if (timePlayed < SecondsPerDay) { playedData[0] = $"{Math.Round(timePlayed / SecondsPerHour , 2, MidpointRounding.AwayFromZero)} hrs"; }
|
playedData[0] = $"{timePlayed}s";
|
||||||
else { playedData[0] = $"{Math.Round(timePlayed / SecondsPerDay , 2, MidpointRounding.AwayFromZero)} days"; }
|
}
|
||||||
|
else if (timePlayed < SecondsPerHour)
|
||||||
|
{
|
||||||
|
playedData[0] = $"{Math.Round(timePlayed / SecondsPerMinute, 2, MidpointRounding.AwayFromZero)} mins";
|
||||||
|
}
|
||||||
|
else if (timePlayed < SecondsPerDay)
|
||||||
|
{
|
||||||
|
playedData[0] = $"{Math.Round(timePlayed / SecondsPerHour , 2, MidpointRounding.AwayFromZero)} hrs";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
playedData[0] = $"{Math.Round(timePlayed / SecondsPerDay , 2, MidpointRounding.AwayFromZero)} days";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,6 +428,7 @@ namespace Ryujinx.UI
|
||||||
file.Write(Encoding.ASCII.GetBytes("Never"));
|
file.Write(Encoding.ASCII.GetBytes("Never"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
using (FileStream fs = File.OpenRead(Path.Combine(savePath, "LastPlayed.dat")))
|
using (FileStream fs = File.OpenRead(Path.Combine(savePath, "LastPlayed.dat")))
|
||||||
{
|
{
|
||||||
using (StreamReader sr = new StreamReader(fs))
|
using (StreamReader sr = new StreamReader(fs))
|
||||||
|
@ -368,7 +439,10 @@ namespace Ryujinx.UI
|
||||||
|
|
||||||
return playedData;
|
return playedData;
|
||||||
}
|
}
|
||||||
catch { return new string[] { "Unknown", "Unknown" }; }
|
catch
|
||||||
|
{
|
||||||
|
return new string[] { "Unknown", "Unknown" };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ using Ryujinx.Audio;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Graphics.Gal;
|
using Ryujinx.Graphics.Gal;
|
||||||
using Ryujinx.Graphics.Gal.OpenGL;
|
using Ryujinx.Graphics.Gal.OpenGL;
|
||||||
using Ryujinx.HLE.FileSystem;
|
|
||||||
using Ryujinx.Profiler;
|
using Ryujinx.Profiler;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
@ -19,46 +18,48 @@ namespace Ryujinx.UI
|
||||||
{
|
{
|
||||||
public class MainWindow : Window
|
public class MainWindow : Window
|
||||||
{
|
{
|
||||||
|
internal static HLE.Switch _device;
|
||||||
|
|
||||||
|
private static IGalRenderer _renderer;
|
||||||
|
|
||||||
|
private static IAalOutput _audioOut;
|
||||||
|
|
||||||
|
private static Application _gtkApplication;
|
||||||
|
|
||||||
|
private static ListStore _tableStore;
|
||||||
|
|
||||||
|
private static bool _gameLoaded = false;
|
||||||
|
|
||||||
|
private static string _userId = "00000000000000000000000000000001";
|
||||||
|
|
||||||
public static bool DiscordIntegrationEnabled { get; set; }
|
public static bool DiscordIntegrationEnabled { get; set; }
|
||||||
|
|
||||||
public static DiscordRpcClient DiscordClient;
|
public static DiscordRpcClient DiscordClient;
|
||||||
|
|
||||||
public static RichPresence DiscordPresence;
|
public static RichPresence DiscordPresence;
|
||||||
|
|
||||||
private static IGalRenderer _renderer;
|
|
||||||
|
|
||||||
private static IAalOutput _audioOut;
|
|
||||||
|
|
||||||
internal static HLE.Switch _device;
|
|
||||||
|
|
||||||
private static Application _gtkapp;
|
|
||||||
|
|
||||||
private static ListStore _tableStore;
|
|
||||||
|
|
||||||
private static bool _gameLoaded = false;
|
|
||||||
|
|
||||||
#pragma warning disable 649
|
#pragma warning disable 649
|
||||||
[GUI] Window _mainWin;
|
[GUI] Window _mainWin;
|
||||||
[GUI] CheckMenuItem _fullScreen;
|
[GUI] CheckMenuItem _fullScreen;
|
||||||
[GUI] MenuItem _stopEmulation;
|
[GUI] MenuItem _stopEmulation;
|
||||||
[GUI] CheckMenuItem _iconToggle;
|
[GUI] CheckMenuItem _iconToggle;
|
||||||
[GUI] CheckMenuItem _titleToggle;
|
[GUI] CheckMenuItem _titleToggle;
|
||||||
[GUI] CheckMenuItem _developerToggle;
|
[GUI] CheckMenuItem _developerToggle;
|
||||||
[GUI] CheckMenuItem _versionToggle;
|
[GUI] CheckMenuItem _versionToggle;
|
||||||
[GUI] CheckMenuItem _timePlayedToggle;
|
[GUI] CheckMenuItem _timePlayedToggle;
|
||||||
[GUI] CheckMenuItem _lastPlayedToggle;
|
[GUI] CheckMenuItem _lastPlayedToggle;
|
||||||
[GUI] CheckMenuItem _fileExtToggle;
|
[GUI] CheckMenuItem _fileExtToggle;
|
||||||
[GUI] CheckMenuItem _fileSizeToggle;
|
[GUI] CheckMenuItem _fileSizeToggle;
|
||||||
[GUI] CheckMenuItem _pathToggle;
|
[GUI] CheckMenuItem _pathToggle;
|
||||||
[GUI] MenuItem _nfc;
|
[GUI] MenuItem _nfc;
|
||||||
[GUI] Box _box;
|
[GUI] Box _box;
|
||||||
[GUI] TreeView _gameTable;
|
[GUI] TreeView _gameTable;
|
||||||
[GUI] GLArea _glScreen;
|
[GUI] GLArea _glScreen;
|
||||||
#pragma warning restore 649
|
#pragma warning restore 649
|
||||||
|
|
||||||
public MainWindow(string[] args, Application gtkapp) : this(new Builder("Ryujinx.Ui.MainWindow.glade"), args, gtkapp) { }
|
public MainWindow(string[] args, Application gtkApplication) : this(new Builder("Ryujinx.Ui.MainWindow.glade"), args, gtkApplication) { }
|
||||||
|
|
||||||
private MainWindow(Builder builder, string[] args, Application gtkapp) : base(builder.GetObject("_mainWin").Handle)
|
private MainWindow(Builder builder, string[] args, Application gtkApplication) : base(builder.GetObject("_mainWin").Handle)
|
||||||
{
|
{
|
||||||
_renderer = new OglRenderer();
|
_renderer = new OglRenderer();
|
||||||
|
|
||||||
|
@ -71,7 +72,7 @@ namespace Ryujinx.UI
|
||||||
|
|
||||||
ApplicationLibrary.Init(SwitchSettings.SwitchConfig.GameDirs, _device.System.KeySet, _device.System.State.DesiredTitleLanguage);
|
ApplicationLibrary.Init(SwitchSettings.SwitchConfig.GameDirs, _device.System.KeySet, _device.System.State.DesiredTitleLanguage);
|
||||||
|
|
||||||
_gtkapp = gtkapp;
|
_gtkApplication = gtkApplication;
|
||||||
|
|
||||||
ApplyTheme();
|
ApplyTheme();
|
||||||
|
|
||||||
|
@ -116,17 +117,20 @@ namespace Ryujinx.UI
|
||||||
{
|
{
|
||||||
// Temporary code section start, remove this section when game is rendered to the GLArea in the GUI
|
// Temporary code section start, remove this section when game is rendered to the GLArea in the GUI
|
||||||
_box.Remove(_glScreen);
|
_box.Remove(_glScreen);
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[0]) { _gameTable.AppendColumn("Icon" , new CellRendererPixbuf(), "pixbuf", 0); }
|
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[1]) { _gameTable.AppendColumn("Application", new CellRendererText() , "text" , 1); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[0]) { _gameTable.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[2]) { _gameTable.AppendColumn("Developer" , new CellRendererText() , "text" , 2); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[1]) { _gameTable.AppendColumn("Application", new CellRendererText(), "text", 1); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[3]) { _gameTable.AppendColumn("Version" , new CellRendererText() , "text" , 3); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[2]) { _gameTable.AppendColumn("Developer", new CellRendererText(), "text", 2); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[4]) { _gameTable.AppendColumn("Time Played", new CellRendererText() , "text" , 4); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[3]) { _gameTable.AppendColumn("Version", new CellRendererText(), "text", 3); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[5]) { _gameTable.AppendColumn("Last Played", new CellRendererText() , "text" , 5); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[4]) { _gameTable.AppendColumn("Time Played", new CellRendererText(), "text", 4); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[6]) { _gameTable.AppendColumn("File Ext" , new CellRendererText() , "text" , 6); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[5]) { _gameTable.AppendColumn("Last Played", new CellRendererText(), "text", 5); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[7]) { _gameTable.AppendColumn("File Size" , new CellRendererText() , "text" , 7); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[6]) { _gameTable.AppendColumn("File Ext", new CellRendererText(), "text", 6); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[8]) { _gameTable.AppendColumn("Path" , new CellRendererText() , "text" , 8); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[7]) { _gameTable.AppendColumn("File Size", new CellRendererText(), "text", 7); }
|
||||||
|
if (SwitchSettings.SwitchConfig.GuiColumns[8]) { _gameTable.AppendColumn("Path", new CellRendererText(), "text", 8); }
|
||||||
|
|
||||||
_tableStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
|
_tableStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
|
||||||
_gameTable.Model = _tableStore;
|
_gameTable.Model = _tableStore;
|
||||||
|
|
||||||
UpdateGameTable();
|
UpdateGameTable();
|
||||||
// Temporary code section end
|
// Temporary code section end
|
||||||
|
|
||||||
|
@ -136,15 +140,15 @@ namespace Ryujinx.UI
|
||||||
{
|
{
|
||||||
_box.Remove(_glScreen);
|
_box.Remove(_glScreen);
|
||||||
|
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[0]) { _gameTable.AppendColumn("Icon" , new CellRendererPixbuf(), "pixbuf", 0); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[0]) { _gameTable.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[1]) { _gameTable.AppendColumn("Application", new CellRendererText() , "text" , 1); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[1]) { _gameTable.AppendColumn("Application", new CellRendererText(), "text", 1); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[2]) { _gameTable.AppendColumn("Developer" , new CellRendererText() , "text" , 2); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[2]) { _gameTable.AppendColumn("Developer", new CellRendererText(), "text", 2); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[3]) { _gameTable.AppendColumn("Version" , new CellRendererText() , "text" , 3); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[3]) { _gameTable.AppendColumn("Version", new CellRendererText(), "text", 3); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[4]) { _gameTable.AppendColumn("Time Played", new CellRendererText() , "text" , 4); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[4]) { _gameTable.AppendColumn("Time Played", new CellRendererText(), "text", 4); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[5]) { _gameTable.AppendColumn("Last Played", new CellRendererText() , "text" , 5); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[5]) { _gameTable.AppendColumn("Last Played", new CellRendererText(), "text", 5); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[6]) { _gameTable.AppendColumn("File Ext" , new CellRendererText() , "text" , 6); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[6]) { _gameTable.AppendColumn("File Ext", new CellRendererText(), "text", 6); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[7]) { _gameTable.AppendColumn("File Size" , new CellRendererText() , "text" , 7); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[7]) { _gameTable.AppendColumn("File Size", new CellRendererText(), "text", 7); }
|
||||||
if (SwitchSettings.SwitchConfig.GuiColumns[8]) { _gameTable.AppendColumn("Path" , new CellRendererText() , "text" , 8); }
|
if (SwitchSettings.SwitchConfig.GuiColumns[8]) { _gameTable.AppendColumn("Path", new CellRendererText(), "text", 8); }
|
||||||
|
|
||||||
_tableStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
|
_tableStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
|
||||||
_gameTable.Model = _tableStore;
|
_gameTable.Model = _tableStore;
|
||||||
|
@ -246,8 +250,14 @@ namespace Ryujinx.UI
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Logger.PrintInfo(LogClass.Application, "Loading as homebrew.");
|
Logger.PrintInfo(LogClass.Application, "Loading as homebrew.");
|
||||||
try { _device.LoadProgram(path); }
|
try
|
||||||
catch (ArgumentOutOfRangeException) { Logger.PrintError(LogClass.Application, $"The file which you have specified is unsupported by Ryujinx"); }
|
{
|
||||||
|
_device.LoadProgram(path);
|
||||||
|
}
|
||||||
|
catch (ArgumentOutOfRangeException)
|
||||||
|
{
|
||||||
|
Logger.PrintError(LogClass.Application, $"The file which you have specified is unsupported by Ryujinx");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -268,8 +278,27 @@ namespace Ryujinx.UI
|
||||||
{
|
{
|
||||||
DiscordPresence.Assets.LargeImageKey = _device.System.TitleID;
|
DiscordPresence.Assets.LargeImageKey = _device.System.TitleID;
|
||||||
}
|
}
|
||||||
DiscordPresence.Details = $"Playing {_device.System.TitleName}";
|
|
||||||
DiscordPresence.State = string.IsNullOrWhiteSpace(_device.System.TitleID) ? string.Empty : _device.System.TitleID.ToUpper();
|
string state = _device.System.TitleID;
|
||||||
|
|
||||||
|
if (state == null)
|
||||||
|
{
|
||||||
|
state = "Ryujinx";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
state = state.ToUpper();
|
||||||
|
}
|
||||||
|
|
||||||
|
string details = "Idling";
|
||||||
|
|
||||||
|
if (_device.System.TitleName != null)
|
||||||
|
{
|
||||||
|
details = $"Playing {_device.System.TitleName}";
|
||||||
|
}
|
||||||
|
|
||||||
|
DiscordPresence.Details = details;
|
||||||
|
DiscordPresence.State = state;
|
||||||
DiscordPresence.Assets.LargeImageText = _device.System.TitleName;
|
DiscordPresence.Assets.LargeImageText = _device.System.TitleName;
|
||||||
DiscordPresence.Assets.SmallImageKey = "ryujinx";
|
DiscordPresence.Assets.SmallImageKey = "ryujinx";
|
||||||
DiscordPresence.Assets.SmallImageText = "Ryujinx is an emulator for the Nintendo Switch";
|
DiscordPresence.Assets.SmallImageText = "Ryujinx is an emulator for the Nintendo Switch";
|
||||||
|
@ -278,24 +307,23 @@ namespace Ryujinx.UI
|
||||||
DiscordClient.SetPresence(DiscordPresence);
|
DiscordClient.SetPresence(DiscordPresence);
|
||||||
}
|
}
|
||||||
|
|
||||||
string userId = "00000000000000000000000000000001";
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string savePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RyuFS", "nand", "user", "save", "0000000000000000", userId, _device.System.TitleID);
|
string savePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RyuFS", "nand", "user", "save", "0000000000000000", _userId, _device.System.TitleID);
|
||||||
|
|
||||||
if (File.Exists(System.IO.Path.Combine(savePath, "TimePlayed.dat")) == false)
|
if (File.Exists(System.IO.Path.Combine(savePath, "TimePlayed.dat")) == false)
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(savePath);
|
Directory.CreateDirectory(savePath);
|
||||||
using (FileStream file = File.OpenWrite(System.IO.Path.Combine(savePath, "TimePlayed.dat"))) { file.Write(Encoding.ASCII.GetBytes("0")); }
|
using (FileStream stream = File.OpenWrite(System.IO.Path.Combine(savePath, "TimePlayed.dat"))) { stream.Write(Encoding.ASCII.GetBytes("0")); }
|
||||||
}
|
}
|
||||||
if (File.Exists(System.IO.Path.Combine(savePath, "LastPlayed.dat")) == false)
|
if (File.Exists(System.IO.Path.Combine(savePath, "LastPlayed.dat")) == false)
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(savePath);
|
Directory.CreateDirectory(savePath);
|
||||||
using (FileStream file = File.OpenWrite(System.IO.Path.Combine(savePath, "LastPlayed.dat"))) { file.Write(Encoding.ASCII.GetBytes("Never")); }
|
using (FileStream stream = File.OpenWrite(System.IO.Path.Combine(savePath, "LastPlayed.dat"))) { stream.Write(Encoding.ASCII.GetBytes("Never")); }
|
||||||
}
|
}
|
||||||
using (FileStream fs = File.OpenWrite(System.IO.Path.Combine(savePath, "LastPlayed.dat")))
|
using (FileStream stream = File.OpenWrite(System.IO.Path.Combine(savePath, "LastPlayed.dat")))
|
||||||
{
|
{
|
||||||
using (StreamWriter sr = new StreamWriter(fs))
|
using (StreamWriter sr = new StreamWriter(stream))
|
||||||
{
|
{
|
||||||
sr.WriteLine(DateTime.UtcNow);
|
sr.WriteLine(DateTime.UtcNow);
|
||||||
}
|
}
|
||||||
|
@ -303,7 +331,7 @@ namespace Ryujinx.UI
|
||||||
}
|
}
|
||||||
catch (ArgumentNullException)
|
catch (ArgumentNullException)
|
||||||
{
|
{
|
||||||
Logger.PrintError(LogClass.Application, $"Could not access save path to retrieve time/last played data using: UserID: {userId}, TitleID: {_device.System.TitleID}");
|
Logger.PrintError(LogClass.Application, $"Could not access save path to retrieve time/last played data using: UserID: {_userId}, TitleID: {_device.System.TitleID}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -322,33 +350,32 @@ namespace Ryujinx.UI
|
||||||
|
|
||||||
private static void End()
|
private static void End()
|
||||||
{
|
{
|
||||||
string userId = "00000000000000000000000000000001";
|
|
||||||
if (_gameLoaded)
|
if (_gameLoaded)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string savePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RyuFS", "nand", "user", "save", "0000000000000000", userId, _device.System.TitleID);
|
string savePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RyuFS", "nand", "user", "save", "0000000000000000", _userId, _device.System.TitleID);
|
||||||
double currentPlayTime = 0;
|
double currentPlayTime = 0;
|
||||||
|
|
||||||
using (FileStream fs = File.OpenRead(System.IO.Path.Combine(savePath, "LastPlayed.dat")))
|
using (FileStream stream = File.OpenRead(System.IO.Path.Combine(savePath, "LastPlayed.dat")))
|
||||||
{
|
{
|
||||||
using (StreamReader sr = new StreamReader(fs))
|
using (StreamReader reader = new StreamReader(stream))
|
||||||
{
|
{
|
||||||
DateTime startTime = DateTime.Parse(sr.ReadLine());
|
DateTime startTime = DateTime.Parse(reader.ReadLine());
|
||||||
|
|
||||||
using (FileStream lpfs = File.OpenRead(System.IO.Path.Combine(savePath, "TimePlayed.dat")))
|
using (FileStream lastPlayedStream = File.OpenRead(System.IO.Path.Combine(savePath, "TimePlayed.dat")))
|
||||||
{
|
{
|
||||||
using (StreamReader lpsr = new StreamReader(lpfs))
|
using (StreamReader lastPlayedReader = new StreamReader(lastPlayedStream))
|
||||||
{
|
{
|
||||||
currentPlayTime = double.Parse(lpsr.ReadLine());
|
currentPlayTime = double.Parse(lastPlayedReader.ReadLine());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
using (FileStream tpfs = File.OpenWrite(System.IO.Path.Combine(savePath, "TimePlayed.dat")))
|
using (FileStream timePlayedStream = File.OpenWrite(System.IO.Path.Combine(savePath, "TimePlayed.dat")))
|
||||||
{
|
{
|
||||||
using (StreamWriter tpsr = new StreamWriter(tpfs))
|
using (StreamWriter timePlayedWriter = new StreamWriter(timePlayedStream))
|
||||||
{
|
{
|
||||||
tpsr.WriteLine(currentPlayTime + Math.Round(DateTime.UtcNow.Subtract(startTime).TotalSeconds, MidpointRounding.AwayFromZero));
|
timePlayedWriter.WriteLine(currentPlayTime + Math.Round(DateTime.UtcNow.Subtract(startTime).TotalSeconds, MidpointRounding.AwayFromZero));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -356,7 +383,7 @@ namespace Ryujinx.UI
|
||||||
}
|
}
|
||||||
catch (ArgumentNullException)
|
catch (ArgumentNullException)
|
||||||
{
|
{
|
||||||
Logger.PrintError(LogClass.Application, $"Could not access save path to retrieve time/last played data using: UserID: {userId}, TitleID: {_device.System.TitleID}");
|
Logger.PrintError(LogClass.Application, $"Could not access save path to retrieve time/last played data using: UserID: {_userId}, TitleID: {_device.System.TitleID}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,8 +418,8 @@ namespace Ryujinx.UI
|
||||||
//Events
|
//Events
|
||||||
private void Row_Activated(object o, RowActivatedArgs args)
|
private void Row_Activated(object o, RowActivatedArgs args)
|
||||||
{
|
{
|
||||||
_tableStore.GetIter(out TreeIter treeiter, new TreePath(args.Path.ToString()));
|
_tableStore.GetIter(out TreeIter treeIter, new TreePath(args.Path.ToString()));
|
||||||
string path = (string)_tableStore.GetValue(treeiter, 8);
|
string path = (string)_tableStore.GetValue(treeIter, 8);
|
||||||
|
|
||||||
LoadApplication(path);
|
LoadApplication(path);
|
||||||
}
|
}
|
||||||
|
@ -400,7 +427,8 @@ namespace Ryujinx.UI
|
||||||
private void Load_Application_File(object o, EventArgs args)
|
private void Load_Application_File(object o, EventArgs args)
|
||||||
{
|
{
|
||||||
FileChooserDialog fc = new FileChooserDialog("Choose the file to open", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
|
FileChooserDialog fc = new FileChooserDialog("Choose the file to open", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
|
||||||
fc.Filter = new FileFilter();
|
|
||||||
|
fc.Filter = new FileFilter();
|
||||||
fc.Filter.AddPattern("*.nsp" );
|
fc.Filter.AddPattern("*.nsp" );
|
||||||
fc.Filter.AddPattern("*.pfs0");
|
fc.Filter.AddPattern("*.pfs0");
|
||||||
fc.Filter.AddPattern("*.xci" );
|
fc.Filter.AddPattern("*.xci" );
|
||||||
|
@ -432,15 +460,21 @@ namespace Ryujinx.UI
|
||||||
{
|
{
|
||||||
Process.Start(new ProcessStartInfo()
|
Process.Start(new ProcessStartInfo()
|
||||||
{
|
{
|
||||||
FileName = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RyuFs"),
|
FileName = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RyuFs"),
|
||||||
UseShellExecute = true,
|
UseShellExecute = true,
|
||||||
Verb = "open"
|
Verb = "open"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Exit_Pressed(object o, EventArgs args) { End(); }
|
private void Exit_Pressed(object o, EventArgs args)
|
||||||
|
{
|
||||||
|
End();
|
||||||
|
}
|
||||||
|
|
||||||
private void Window_Close(object o, DeleteEventArgs args) { End(); }
|
private void Window_Close(object o, DeleteEventArgs args)
|
||||||
|
{
|
||||||
|
End();
|
||||||
|
}
|
||||||
|
|
||||||
private void StopEmulation_Pressed(object o, EventArgs args)
|
private void StopEmulation_Pressed(object o, EventArgs args)
|
||||||
{
|
{
|
||||||
|
@ -449,22 +483,31 @@ namespace Ryujinx.UI
|
||||||
|
|
||||||
private void FullScreen_Toggled(object o, EventArgs args)
|
private void FullScreen_Toggled(object o, EventArgs args)
|
||||||
{
|
{
|
||||||
if (_fullScreen.Active == true) { Fullscreen(); }
|
if (_fullScreen.Active == true)
|
||||||
else { Unfullscreen(); }
|
{
|
||||||
|
Fullscreen();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Unfullscreen();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Settings_Pressed(object o, EventArgs args)
|
private void Settings_Pressed(object o, EventArgs args)
|
||||||
{
|
{
|
||||||
SwitchSettings SettingsWin = new SwitchSettings(_device);
|
SwitchSettings SettingsWin = new SwitchSettings(_device);
|
||||||
_gtkapp.Register(GLib.Cancellable.Current);
|
|
||||||
_gtkapp.AddWindow(SettingsWin);
|
_gtkApplication.Register(GLib.Cancellable.Current);
|
||||||
|
_gtkApplication.AddWindow(SettingsWin);
|
||||||
|
|
||||||
SettingsWin.Show();
|
SettingsWin.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Nfc_Pressed(object o, EventArgs args)
|
private void Nfc_Pressed(object o, EventArgs args)
|
||||||
{
|
{
|
||||||
FileChooserDialog fc = new FileChooserDialog("Choose the file to open", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
|
FileChooserDialog fc = new FileChooserDialog("Choose the file to open", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
|
||||||
fc.Filter = new FileFilter();
|
|
||||||
|
fc.Filter = new FileFilter();
|
||||||
fc.Filter.AddPattern("*.bin");
|
fc.Filter.AddPattern("*.bin");
|
||||||
|
|
||||||
if (fc.Run() == (int)ResponseType.Accept)
|
if (fc.Run() == (int)ResponseType.Accept)
|
||||||
|
@ -477,15 +520,24 @@ namespace Ryujinx.UI
|
||||||
private void Update_Pressed(object o, EventArgs args)
|
private void Update_Pressed(object o, EventArgs args)
|
||||||
{
|
{
|
||||||
string ryuUpdater = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RyuFS", "RyuUpdater.exe");
|
string ryuUpdater = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RyuFS", "RyuUpdater.exe");
|
||||||
try { Process.Start(new ProcessStartInfo(ryuUpdater, "/U") { UseShellExecute = true }); }
|
|
||||||
catch(System.ComponentModel.Win32Exception) { CreateErrorDialog("Update canceled by user or updater was not found"); }
|
try
|
||||||
|
{
|
||||||
|
Process.Start(new ProcessStartInfo(ryuUpdater, "/U") { UseShellExecute = true });
|
||||||
|
}
|
||||||
|
catch(System.ComponentModel.Win32Exception)
|
||||||
|
{
|
||||||
|
CreateErrorDialog("Update canceled by user or updater was not found");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void About_Pressed(object o, EventArgs args)
|
private void About_Pressed(object o, EventArgs args)
|
||||||
{
|
{
|
||||||
AboutWindow AboutWin = new AboutWindow();
|
AboutWindow AboutWin = new AboutWindow();
|
||||||
_gtkapp.Register(GLib.Cancellable.Current);
|
|
||||||
_gtkapp.AddWindow(AboutWin);
|
_gtkApplication.Register(GLib.Cancellable.Current);
|
||||||
|
_gtkApplication.AddWindow(AboutWin);
|
||||||
|
|
||||||
AboutWin.Show();
|
AboutWin.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ namespace Ryujinx.UI
|
||||||
_fsLogSpinAdjustment.Value = SwitchConfig.FsGlobalAccessLogMode;
|
_fsLogSpinAdjustment.Value = SwitchConfig.FsGlobalAccessLogMode;
|
||||||
|
|
||||||
_gameDirsBox.AppendColumn("", new CellRendererText(), "text", 0);
|
_gameDirsBox.AppendColumn("", new CellRendererText(), "text", 0);
|
||||||
_gameDirsBoxStore = new ListStore(typeof(string));
|
_gameDirsBoxStore = new ListStore(typeof(string));
|
||||||
_gameDirsBox.Model = _gameDirsBoxStore;
|
_gameDirsBox.Model = _gameDirsBoxStore;
|
||||||
foreach (string gameDir in SwitchConfig.GameDirs)
|
foreach (string gameDir in SwitchConfig.GameDirs)
|
||||||
{
|
{
|
||||||
|
@ -197,6 +197,7 @@ namespace Ryujinx.UI
|
||||||
if (_listeningForKeypress == false)
|
if (_listeningForKeypress == false)
|
||||||
{
|
{
|
||||||
KeyPressEvent += On_KeyPress;
|
KeyPressEvent += On_KeyPress;
|
||||||
|
|
||||||
_listeningForKeypress = true;
|
_listeningForKeypress = true;
|
||||||
|
|
||||||
void On_KeyPress(object Obj, KeyPressEventArgs KeyPressed)
|
void On_KeyPress(object Obj, KeyPressEventArgs KeyPressed)
|
||||||
|
@ -204,35 +205,52 @@ namespace Ryujinx.UI
|
||||||
string key = KeyPressed.Event.Key.ToString();
|
string key = KeyPressed.Event.Key.ToString();
|
||||||
string capKey = key.First().ToString().ToUpper() + key.Substring(1);
|
string capKey = key.First().ToString().ToUpper() + key.Substring(1);
|
||||||
|
|
||||||
if (Enum.IsDefined(typeof(OpenTK.Input.Key), capKey)) { Button.Label = capKey; }
|
if (Enum.IsDefined(typeof(OpenTK.Input.Key), capKey))
|
||||||
else if (GdkToOpenTKInput.ContainsKey(key)) { Button.Label = GdkToOpenTKInput[key]; }
|
{
|
||||||
else { Button.Label = "Space"; }
|
Button.Label = capKey;
|
||||||
|
}
|
||||||
|
else if (GdkToOpenTKInput.ContainsKey(key))
|
||||||
|
{
|
||||||
|
Button.Label = GdkToOpenTKInput[key];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Button.Label = "Space";
|
||||||
|
}
|
||||||
|
|
||||||
Button.SetStateFlags(0, true);
|
Button.SetStateFlags(0, true);
|
||||||
|
|
||||||
KeyPressEvent -= On_KeyPress;
|
KeyPressEvent -= On_KeyPress;
|
||||||
|
|
||||||
_listeningForKeypress = false;
|
_listeningForKeypress = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { Button.SetStateFlags(0, true); }
|
else
|
||||||
|
{
|
||||||
|
Button.SetStateFlags(0, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddDir_Pressed(object obj, EventArgs args)
|
private void AddDir_Pressed(object obj, EventArgs args)
|
||||||
{
|
{
|
||||||
if (Directory.Exists(_addGameDirBox.Buffer.Text)) { _gameDirsBoxStore.AppendValues(_addGameDirBox.Buffer.Text); }
|
if (Directory.Exists(_addGameDirBox.Buffer.Text))
|
||||||
|
{
|
||||||
|
_gameDirsBoxStore.AppendValues(_addGameDirBox.Buffer.Text);
|
||||||
|
}
|
||||||
|
|
||||||
_addDir.SetStateFlags(0, true);
|
_addDir.SetStateFlags(0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BrowseDir_Pressed(object obj, EventArgs args)
|
private void BrowseDir_Pressed(object obj, EventArgs args)
|
||||||
{
|
{
|
||||||
FileChooserDialog fc = new FileChooserDialog("Choose the game directory to add to the list", this, FileChooserAction.SelectFolder, "Cancel", ResponseType.Cancel, "Add", ResponseType.Accept);
|
FileChooserDialog fileChooser = new FileChooserDialog("Choose the game directory to add to the list", this, FileChooserAction.SelectFolder, "Cancel", ResponseType.Cancel, "Add", ResponseType.Accept);
|
||||||
|
|
||||||
if (fc.Run() == (int)ResponseType.Accept)
|
if (fileChooser.Run() == (int)ResponseType.Accept)
|
||||||
{
|
{
|
||||||
_gameDirsBoxStore.AppendValues(fc.Filename);
|
_gameDirsBoxStore.AppendValues(fileChooser.Filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
fc.Destroy();
|
fileChooser.Destroy();
|
||||||
|
|
||||||
_browseDir.SetStateFlags(0, true);
|
_browseDir.SetStateFlags(0, true);
|
||||||
}
|
}
|
||||||
|
@ -241,40 +259,32 @@ namespace Ryujinx.UI
|
||||||
{
|
{
|
||||||
TreeSelection selection = _gameDirsBox.Selection;
|
TreeSelection selection = _gameDirsBox.Selection;
|
||||||
|
|
||||||
selection.GetSelected(out TreeIter treeiter);
|
selection.GetSelected(out TreeIter treeIter);
|
||||||
_gameDirsBoxStore.Remove(ref treeiter);
|
_gameDirsBoxStore.Remove(ref treeIter);
|
||||||
|
|
||||||
_removeDir.SetStateFlags(0, true);
|
_removeDir.SetStateFlags(0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CustThemeToggle_Activated(object obj, EventArgs args)
|
private void CustThemeToggle_Activated(object obj, EventArgs args)
|
||||||
{
|
{
|
||||||
if (_custThemeToggle.Active == false)
|
_custThemePath.Sensitive = _custThemeToggle.Active;
|
||||||
{
|
_custThemePathLabel.Sensitive = _custThemeToggle.Active;
|
||||||
_custThemePath.Sensitive = false;
|
_browseThemePath.Sensitive = _custThemeToggle.Active;
|
||||||
_custThemePathLabel.Sensitive = false;
|
|
||||||
_browseThemePath.Sensitive = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_custThemePath.Sensitive = true;
|
|
||||||
_custThemePathLabel.Sensitive = true;
|
|
||||||
_browseThemePath.Sensitive = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BrowseThemeDir_Pressed(object obj, EventArgs args)
|
private void BrowseThemeDir_Pressed(object obj, EventArgs args)
|
||||||
{
|
{
|
||||||
FileChooserDialog fc = new FileChooserDialog("Choose the theme to load", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Select", ResponseType.Accept);
|
FileChooserDialog fileChooser = new FileChooserDialog("Choose the theme to load", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Select", ResponseType.Accept);
|
||||||
fc.Filter = new FileFilter();
|
|
||||||
fc.Filter.AddPattern("*.css");
|
|
||||||
|
|
||||||
if (fc.Run() == (int)ResponseType.Accept)
|
fileChooser.Filter = new FileFilter();
|
||||||
|
fileChooser.Filter.AddPattern("*.css");
|
||||||
|
|
||||||
|
if (fileChooser.Run() == (int)ResponseType.Accept)
|
||||||
{
|
{
|
||||||
_custThemePath.Buffer.Text = fc.Filename;
|
_custThemePath.Buffer.Text = fileChooser.Filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
fc.Destroy();
|
fileChooser.Destroy();
|
||||||
|
|
||||||
_browseThemePath.SetStateFlags(0, true);
|
_browseThemePath.SetStateFlags(0, true);
|
||||||
}
|
}
|
||||||
|
@ -283,51 +293,33 @@ namespace Ryujinx.UI
|
||||||
{
|
{
|
||||||
List<string> gameDirs = new List<string>();
|
List<string> gameDirs = new List<string>();
|
||||||
|
|
||||||
_gameDirsBoxStore.GetIterFirst(out TreeIter iter);
|
_gameDirsBoxStore.GetIterFirst(out TreeIter treeIter);
|
||||||
for (int i = 0; i < _gameDirsBoxStore.IterNChildren(); i++)
|
for (int i = 0; i < _gameDirsBoxStore.IterNChildren(); i++)
|
||||||
{
|
{
|
||||||
_gameDirsBoxStore.GetValue(iter, i);
|
_gameDirsBoxStore.GetValue(treeIter, i);
|
||||||
|
|
||||||
gameDirs.Add((string)_gameDirsBoxStore.GetValue(iter, 0));
|
gameDirs.Add((string)_gameDirsBoxStore.GetValue(treeIter, 0));
|
||||||
|
|
||||||
_gameDirsBoxStore.IterNext(ref iter);
|
_gameDirsBoxStore.IterNext(ref treeIter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_errorLogToggle.Active) SwitchConfig.LoggingEnableError = true;
|
SwitchConfig.LoggingEnableError = _errorLogToggle.Active;
|
||||||
if (_warningLogToggle.Active) SwitchConfig.LoggingEnableWarn = true;
|
SwitchConfig.LoggingEnableWarn = _warningLogToggle.Active;
|
||||||
if (_infoLogToggle.Active) SwitchConfig.LoggingEnableInfo = true;
|
SwitchConfig.LoggingEnableInfo = _infoLogToggle.Active;
|
||||||
if (_stubLogToggle.Active) SwitchConfig.LoggingEnableStub = true;
|
SwitchConfig.LoggingEnableStub = _stubLogToggle.Active;
|
||||||
if (_debugLogToggle.Active) SwitchConfig.LoggingEnableDebug = true;
|
SwitchConfig.LoggingEnableDebug = _debugLogToggle.Active;
|
||||||
if (_guestLogToggle.Active) SwitchConfig.LoggingEnableGuest = true;
|
SwitchConfig.LoggingEnableGuest = _guestLogToggle.Active;
|
||||||
if (_fsAccessLogToggle.Active) SwitchConfig.LoggingEnableFsAccessLog = true;
|
SwitchConfig.LoggingEnableFsAccessLog = _fsAccessLogToggle.Active;
|
||||||
if (_fileLogToggle.Active) SwitchConfig.EnableFileLog = true;
|
SwitchConfig.EnableFileLog = _fileLogToggle.Active;
|
||||||
if (_dockedModeToggle.Active) SwitchConfig.DockedMode = true;
|
SwitchConfig.DockedMode = _dockedModeToggle.Active;
|
||||||
if (_discordToggle.Active) SwitchConfig.EnableDiscordIntegration = true;
|
SwitchConfig.EnableDiscordIntegration = _discordToggle.Active;
|
||||||
if (_vSyncToggle.Active) SwitchConfig.EnableVsync = true;
|
SwitchConfig.EnableVsync = _vSyncToggle.Active;
|
||||||
if (_multiSchedToggle.Active) SwitchConfig.EnableMulticoreScheduling = true;
|
SwitchConfig.EnableMulticoreScheduling = _multiSchedToggle.Active;
|
||||||
if (_fsicToggle.Active) SwitchConfig.EnableFsIntegrityChecks = true;
|
SwitchConfig.EnableFsIntegrityChecks = _fsicToggle.Active;
|
||||||
if (_legacyJitToggle.Active) SwitchConfig.EnableLegacyJit = true;
|
SwitchConfig.EnableLegacyJit = _legacyJitToggle.Active;
|
||||||
if (_ignoreToggle.Active) SwitchConfig.IgnoreMissingServices = true;
|
SwitchConfig.IgnoreMissingServices = _ignoreToggle.Active;
|
||||||
if (_directKeyboardAccess.Active) SwitchConfig.EnableKeyboard = true;
|
SwitchConfig.EnableKeyboard = _directKeyboardAccess.Active;
|
||||||
if (_custThemeToggle.Active) SwitchConfig.EnableCustomTheme = true;
|
SwitchConfig.EnableCustomTheme = _custThemeToggle.Active;
|
||||||
|
|
||||||
if (!_errorLogToggle.Active) SwitchConfig.LoggingEnableError = false;
|
|
||||||
if (!_warningLogToggle.Active) SwitchConfig.LoggingEnableWarn = false;
|
|
||||||
if (!_infoLogToggle.Active) SwitchConfig.LoggingEnableInfo = false;
|
|
||||||
if (!_stubLogToggle.Active ) SwitchConfig.LoggingEnableStub = false;
|
|
||||||
if (!_debugLogToggle.Active) SwitchConfig.LoggingEnableDebug = false;
|
|
||||||
if (!_guestLogToggle.Active) SwitchConfig.LoggingEnableGuest = false;
|
|
||||||
if (!_fsAccessLogToggle.Active) SwitchConfig.LoggingEnableFsAccessLog = false;
|
|
||||||
if (!_fileLogToggle.Active) SwitchConfig.EnableFileLog = false;
|
|
||||||
if (!_dockedModeToggle.Active) SwitchConfig.DockedMode = false;
|
|
||||||
if (!_discordToggle.Active) SwitchConfig.EnableDiscordIntegration = false;
|
|
||||||
if (!_vSyncToggle.Active) SwitchConfig.EnableVsync = false;
|
|
||||||
if (!_multiSchedToggle.Active) SwitchConfig.EnableMulticoreScheduling = false;
|
|
||||||
if (!_fsicToggle.Active) SwitchConfig.EnableFsIntegrityChecks = false;
|
|
||||||
if (!_legacyJitToggle.Active) SwitchConfig.EnableLegacyJit = false;
|
|
||||||
if (!_ignoreToggle.Active) SwitchConfig.IgnoreMissingServices = false;
|
|
||||||
if (!_directKeyboardAccess.Active) SwitchConfig.EnableKeyboard = false;
|
|
||||||
if (!_custThemeToggle.Active) SwitchConfig.EnableCustomTheme = false;
|
|
||||||
|
|
||||||
SwitchConfig.KeyboardControls.LeftJoycon = new NpadKeyboardLeft()
|
SwitchConfig.KeyboardControls.LeftJoycon = new NpadKeyboardLeft()
|
||||||
{
|
{
|
||||||
|
@ -370,6 +362,7 @@ namespace Ryujinx.UI
|
||||||
|
|
||||||
Configuration.SaveConfig(SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
|
Configuration.SaveConfig(SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
|
||||||
Configuration.Configure(Device, SwitchConfig);
|
Configuration.Configure(Device, SwitchConfig);
|
||||||
|
|
||||||
MainWindow.ApplyTheme();
|
MainWindow.ApplyTheme();
|
||||||
MainWindow.UpdateGameTable();
|
MainWindow.UpdateGameTable();
|
||||||
|
|
||||||
|
@ -383,49 +376,49 @@ namespace Ryujinx.UI
|
||||||
|
|
||||||
public readonly Dictionary<string, string> GdkToOpenTKInput = new Dictionary<string, string>()
|
public readonly Dictionary<string, string> GdkToOpenTKInput = new Dictionary<string, string>()
|
||||||
{
|
{
|
||||||
{ "Key_0" , "Number0" },
|
{ "Key_0", "Number0" },
|
||||||
{ "Key_1" , "Number1" },
|
{ "Key_1", "Number1" },
|
||||||
{ "Key_2" , "Number2" },
|
{ "Key_2", "Number2" },
|
||||||
{ "Key_3" , "Number3" },
|
{ "Key_3", "Number3" },
|
||||||
{ "Key_4" , "Number4" },
|
{ "Key_4", "Number4" },
|
||||||
{ "Key_5" , "Number5" },
|
{ "Key_5", "Number5" },
|
||||||
{ "Key_6" , "Number6" },
|
{ "Key_6", "Number6" },
|
||||||
{ "Key_7" , "Number7" },
|
{ "Key_7", "Number7" },
|
||||||
{ "Key_8" , "Number8" },
|
{ "Key_8", "Number8" },
|
||||||
{ "Key_9" , "Number9" },
|
{ "Key_9", "Number9" },
|
||||||
{ "equal" , "Plus" },
|
{ "equal", "Plus" },
|
||||||
{ "uparrow" , "Up" },
|
{ "uparrow", "Up" },
|
||||||
{ "downarrow" , "Down" },
|
{ "downarrow", "Down" },
|
||||||
{ "leftarrow" , "Left" },
|
{ "leftarrow", "Left" },
|
||||||
{ "rightarrow" , "Right" },
|
{ "rightarrow", "Right" },
|
||||||
{ "Control_L" , "ControlLeft" },
|
{ "Control_L", "ControlLeft" },
|
||||||
{ "Control_R" , "ControlRight" },
|
{ "Control_R", "ControlRight" },
|
||||||
{ "Shift_L" , "ShiftLeft" },
|
{ "Shift_L", "ShiftLeft" },
|
||||||
{ "Shift_R" , "ShiftRight" },
|
{ "Shift_R", "ShiftRight" },
|
||||||
{ "Alt_L" , "AltLeft" },
|
{ "Alt_L", "AltLeft" },
|
||||||
{ "Alt_R" , "AltRight" },
|
{ "Alt_R", "AltRight" },
|
||||||
{ "Page_Up" , "PageUp" },
|
{ "Page_Up", "PageUp" },
|
||||||
{ "Page_Down" , "PageDown" },
|
{ "Page_Down", "PageDown" },
|
||||||
{ "KP_Enter" , "KeypadEnter" },
|
{ "KP_Enter", "KeypadEnter" },
|
||||||
{ "KP_Up" , "Up" },
|
{ "KP_Up", "Up" },
|
||||||
{ "KP_Down" , "Down" },
|
{ "KP_Down", "Down" },
|
||||||
{ "KP_Left" , "Left" },
|
{ "KP_Left", "Left" },
|
||||||
{ "KP_Right" , "Right" },
|
{ "KP_Right", "Right" },
|
||||||
{ "KP_Divide" , "KeypadDivide" },
|
{ "KP_Divide", "KeypadDivide" },
|
||||||
{ "KP_Multiply", "KeypadMultiply" },
|
{ "KP_Multiply", "KeypadMultiply" },
|
||||||
{ "KP_Subtract", "KeypadSubtract" },
|
{ "KP_Subtract", "KeypadSubtract" },
|
||||||
{ "KP_Add" , "KeypadAdd" },
|
{ "KP_Add", "KeypadAdd" },
|
||||||
{ "KP_Decimal" , "KeypadDecimal" },
|
{ "KP_Decimal", "KeypadDecimal" },
|
||||||
{ "KP_0" , "Keypad0" },
|
{ "KP_0", "Keypad0" },
|
||||||
{ "KP_1" , "Keypad1" },
|
{ "KP_1", "Keypad1" },
|
||||||
{ "KP_2" , "Keypad2" },
|
{ "KP_2", "Keypad2" },
|
||||||
{ "KP_3" , "Keypad3" },
|
{ "KP_3", "Keypad3" },
|
||||||
{ "KP_4" , "Keypad4" },
|
{ "KP_4", "Keypad4" },
|
||||||
{ "KP_5" , "Keypad5" },
|
{ "KP_5", "Keypad5" },
|
||||||
{ "KP_6" , "Keypad6" },
|
{ "KP_6", "Keypad6" },
|
||||||
{ "KP_7" , "Keypad7" },
|
{ "KP_7", "Keypad7" },
|
||||||
{ "KP_8" , "Keypad8" },
|
{ "KP_8", "Keypad8" },
|
||||||
{ "KP_9" , "Keypad9" },
|
{ "KP_9", "Keypad9" },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue