Requested Changes have been changed
This commit is contained in:
parent
c47f932d1f
commit
f3eba5ebe4
1 changed files with 28 additions and 33 deletions
|
@ -6,14 +6,15 @@ using Ryujinx.HLE;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using DiscordRPC;
|
||||||
|
|
||||||
namespace Ryujinx
|
namespace Ryujinx
|
||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
public static DiscordRPC.DiscordRpcClient DiscordClient;
|
public static DiscordRpcClient DiscordClient;
|
||||||
|
|
||||||
public static DiscordRPC.RichPresence DiscordPresence;
|
public static RichPresence DiscordPresence;
|
||||||
|
|
||||||
public static string ApplicationDirectory => AppDomain.CurrentDomain.BaseDirectory;
|
public static string ApplicationDirectory => AppDomain.CurrentDomain.BaseDirectory;
|
||||||
|
|
||||||
|
@ -21,15 +22,18 @@ namespace Ryujinx
|
||||||
{
|
{
|
||||||
Console.Title = "Ryujinx Console";
|
Console.Title = "Ryujinx Console";
|
||||||
|
|
||||||
DiscordClient = new DiscordRPC.DiscordRpcClient("568815339807309834");
|
DiscordClient = new DiscordRpcClient("568815339807309834");
|
||||||
DiscordPresence = new DiscordRPC.RichPresence();
|
DiscordPresence = new RichPresence
|
||||||
DiscordPresence.Assets = new DiscordRPC.Assets();
|
{
|
||||||
DiscordPresence.Timestamps = new DiscordRPC.Timestamps(DateTime.UtcNow);
|
Assets = new Assets
|
||||||
|
{
|
||||||
DiscordPresence.Details = "Ryujinx Console";
|
LargeImageKey = "ryujinx",
|
||||||
DiscordPresence.State = "Reading the console logs...";
|
LargeImageText = "Ryujinx"
|
||||||
DiscordPresence.Assets.LargeImageKey = "ryujinx";
|
},
|
||||||
DiscordPresence.Assets.LargeImageText = "Ryujinx";
|
Timestamps = new Timestamps(DateTime.UtcNow),
|
||||||
|
Details = "Ryujinx Console",
|
||||||
|
State = "Reading the console logs..."
|
||||||
|
};
|
||||||
|
|
||||||
DiscordClient.Initialize();
|
DiscordClient.Initialize();
|
||||||
DiscordClient.SetPresence(DiscordPresence);
|
DiscordClient.SetPresence(DiscordPresence);
|
||||||
|
@ -61,13 +65,11 @@ namespace Ryujinx
|
||||||
{
|
{
|
||||||
Logger.PrintInfo(LogClass.Application, "Loading as cart with RomFS.");
|
Logger.PrintInfo(LogClass.Application, "Loading as cart with RomFS.");
|
||||||
device.LoadCart(args[0], romFsFiles[0]);
|
device.LoadCart(args[0], romFsFiles[0]);
|
||||||
SetGamePresence(device);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Logger.PrintInfo(LogClass.Application, "Loading as cart WITHOUT RomFS.");
|
Logger.PrintInfo(LogClass.Application, "Loading as cart WITHOUT RomFS.");
|
||||||
device.LoadCart(args[0]);
|
device.LoadCart(args[0]);
|
||||||
SetGamePresence(device);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (File.Exists(args[0]))
|
else if (File.Exists(args[0]))
|
||||||
|
@ -77,23 +79,19 @@ namespace Ryujinx
|
||||||
case ".xci":
|
case ".xci":
|
||||||
Logger.PrintInfo(LogClass.Application, "Loading as XCI.");
|
Logger.PrintInfo(LogClass.Application, "Loading as XCI.");
|
||||||
device.LoadXci(args[0]);
|
device.LoadXci(args[0]);
|
||||||
SetGamePresence(device);
|
|
||||||
break;
|
break;
|
||||||
case ".nca":
|
case ".nca":
|
||||||
Logger.PrintInfo(LogClass.Application, "Loading as NCA.");
|
Logger.PrintInfo(LogClass.Application, "Loading as NCA.");
|
||||||
device.LoadNca(args[0]);
|
device.LoadNca(args[0]);
|
||||||
SetGamePresence(device);
|
|
||||||
break;
|
break;
|
||||||
case ".nsp":
|
case ".nsp":
|
||||||
case ".pfs0":
|
case ".pfs0":
|
||||||
Logger.PrintInfo(LogClass.Application, "Loading as NSP.");
|
Logger.PrintInfo(LogClass.Application, "Loading as NSP.");
|
||||||
device.LoadNsp(args[0]);
|
device.LoadNsp(args[0]);
|
||||||
SetGamePresence(device);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Logger.PrintInfo(LogClass.Application, "Loading as homebrew.");
|
Logger.PrintInfo(LogClass.Application, "Loading as homebrew.");
|
||||||
device.LoadProgram(args[0]);
|
device.LoadProgram(args[0]);
|
||||||
SetGamePresence(device);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,6 +105,19 @@ namespace Ryujinx
|
||||||
Logger.PrintWarning(LogClass.Application, "Please specify the folder with the NSOs/IStorage or a NSO/NRO.");
|
Logger.PrintWarning(LogClass.Application, "Please specify the folder with the NSOs/IStorage or a NSO/NRO.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (File.ReadAllLines(Path.Combine(ApplicationDirectory, "RPsupported.dat")).Contains(device.System.TitleID))
|
||||||
|
{
|
||||||
|
DiscordPresence.Assets.LargeImageKey = device.System.TitleID;
|
||||||
|
DiscordPresence.Assets.LargeImageText = device.System.TitleName;
|
||||||
|
}
|
||||||
|
DiscordPresence.Details = $"Playing {device.System.TitleName}";
|
||||||
|
DiscordPresence.State = device.System.TitleID.ToUpper();
|
||||||
|
DiscordPresence.Assets.SmallImageKey = "ryujinx";
|
||||||
|
DiscordPresence.Assets.SmallImageText = "Ryujinx";
|
||||||
|
DiscordPresence.Timestamps = new Timestamps(DateTime.UtcNow);
|
||||||
|
|
||||||
|
DiscordClient.SetPresence(DiscordPresence);
|
||||||
|
|
||||||
using (GlScreen screen = new GlScreen(device, renderer))
|
using (GlScreen screen = new GlScreen(device, renderer))
|
||||||
{
|
{
|
||||||
screen.MainLoop();
|
screen.MainLoop();
|
||||||
|
@ -142,22 +153,6 @@ namespace Ryujinx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetGamePresence(Switch device)
|
|
||||||
{
|
|
||||||
if (File.ReadAllLines(Path.Combine(ApplicationDirectory, "RPsupported.dat")).Contains(device.System.TitleID))
|
|
||||||
{
|
|
||||||
DiscordPresence.Assets.LargeImageKey = device.System.TitleID;
|
|
||||||
DiscordPresence.Assets.LargeImageText = device.System.TitleName;
|
|
||||||
}
|
|
||||||
DiscordPresence.Details = $"Playing {device.System.TitleName}";
|
|
||||||
DiscordPresence.State = device.System.TitleID.ToUpper();
|
|
||||||
DiscordPresence.Assets.SmallImageKey = "ryujinx";
|
|
||||||
DiscordPresence.Assets.SmallImageText = "Ryujinx";
|
|
||||||
DiscordPresence.Timestamps = new DiscordRPC.Timestamps(DateTime.UtcNow);
|
|
||||||
|
|
||||||
DiscordClient.SetPresence(DiscordPresence);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Picks an <see cref="IAalOutput"/> audio output renderer supported on this machine
|
/// Picks an <see cref="IAalOutput"/> audio output renderer supported on this machine
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue