updated nuget package with missing dlls and changed emmauss' requested changes

This commit is contained in:
Xpl0itR 2019-07-09 21:54:34 +01:00
parent e42b68977f
commit d0ff8f44ae
No known key found for this signature in database
GPG key ID: 91798184109676AD
6 changed files with 37 additions and 45 deletions

View file

@ -9,12 +9,12 @@ using System.Linq;
using System.Reflection;
using System.Text;
namespace Ryujinx
namespace Ryujinx.HLE
{
public class ApplicationLibrary
{
private static Keyset KeySet;
private static HLE.HOS.SystemState.TitleLanguage DesiredTitleLanguage;
private static HOS.SystemState.TitleLanguage DesiredTitleLanguage;
public static byte[] RyujinxNspIcon { get; private set; }
public static byte[] RyujinxXciIcon { get; private set; }
@ -38,7 +38,7 @@ namespace Ryujinx
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, HOS.SystemState.TitleLanguage desiredTitleLanguage)
{
KeySet = keySet;
DesiredTitleLanguage = desiredTitleLanguage;
@ -104,7 +104,9 @@ namespace Ryujinx
using (FileStream file = new FileStream(applicationPath, FileMode.Open, FileAccess.Read))
{
if ((Path.GetExtension(applicationPath) == ".nsp") || (Path.GetExtension(applicationPath) == ".pfs0") || (Path.GetExtension(applicationPath) == ".xci"))
if ((Path.GetExtension(applicationPath) == ".nsp") ||
(Path.GetExtension(applicationPath) == ".pfs0") ||
(Path.GetExtension(applicationPath) == ".xci"))
{
try
{
@ -120,7 +122,7 @@ namespace Ryujinx
// Creates NACP class from the NACP file
IFile controlNacp = controlFs.OpenFile("/control.nacp", OpenMode.Read);
Nacp controlData = new Nacp(controlNacp.AsStream());
Nacp controlData = new Nacp(controlNacp.AsStream());
// Get the title name, title ID, developer name and version number from the NACP
version = controlData.DisplayVersion;
@ -262,13 +264,15 @@ namespace Ryujinx
if (Path.GetExtension(applicationPath) == ".nca") { applicationIcon = RyujinxNcaIcon; }
else if (Path.GetExtension(applicationPath) == ".nso") { applicationIcon = RyujinxNsoIcon; }
string fileName = Path.GetFileName(applicationPath);
string fileExt = Path.GetExtension(applicationPath);
StringBuilder titlename = new StringBuilder();
titlename.Append(Path.GetFileName(applicationPath));
titlename.Remove(Path.GetFileName(applicationPath).Length - Path.GetExtension(applicationPath).Length, Path.GetExtension(applicationPath).Length);
titlename.Append(fileName);
titlename.Remove(fileName.Length - fileExt.Length, fileExt.Length);
titleName = titlename.ToString();
titleId = "0000000000000000";
version = "?";
titleId = "0000000000000000";
version = "?";
developer = "Unknown";
}
}

View file

@ -453,7 +453,7 @@ namespace Ryujinx.HLE.HOS
Nacp controlData = new Nacp(controlFile.AsStream());
TitleName = CurrentTitle = controlData.Descriptions[(int)State.DesiredTitleLanguage].Title;
TitleID = metaData.Aci0.TitleId.ToString("x16");
TitleID = metaData.Aci0.TitleId.ToString("x16");
if (string.IsNullOrWhiteSpace(CurrentTitle))
{

View file

@ -26,7 +26,7 @@ namespace Ryujinx
Application.Init();
Application gtkapp = new Application("Ryujinx.Ryujinx", GLib.ApplicationFlags.None);
MainWindow win = new MainWindow(args, gtkapp);
MainWindow win = new MainWindow(args, gtkapp);
gtkapp.Register(GLib.Cancellable.Current);
gtkapp.AddWindow(win);

View file

@ -34,7 +34,7 @@
<ItemGroup>
<PackageReference Include="DiscordRichPresence" Version="1.0.108" />
<PackageReference Include="GtkSharp" Version="3.22.24.37" />
<PackageReference Include="GtkSharp.Dependencies" Version="1.0.0" />
<PackageReference Include="GtkSharp.Dependencies" Version="1.0.1" />
<PackageReference Include="JsonPrettyPrinter" Version="1.0.1.1" />
<PackageReference Include="OpenTK.NetStandard" Version="1.0.4" />
</ItemGroup>

View file

@ -5,6 +5,7 @@ using Ryujinx.Audio;
using Ryujinx.Common.Logging;
using Ryujinx.Graphics.Gal;
using Ryujinx.Graphics.Gal.OpenGL;
using Ryujinx.HLE;
using Ryujinx.Profiler;
using System;
using System.Diagnostics;
@ -55,7 +56,7 @@ namespace Ryujinx.UI
_audioOut = InitializeAudioEngine();
_device = new HLE.Switch(_renderer, _audioOut);
_device = new HLE.Switch(_renderer, _audioOut);
Configuration.Load(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
Configuration.InitialConfigure(_device);
@ -92,9 +93,7 @@ namespace Ryujinx.UI
if (args.Length == 1)
{
//Box.Remove(GameTableWindow);
//Temporary code section start, remove this section and uncomment above line 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);
Nfc.Sensitive = false;
ReturnMain.Sensitive = false;
@ -110,7 +109,7 @@ namespace Ryujinx.UI
_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;
UpdateGameTable();
//Temporary code section end
// Temporary code section end
LoadApplication(args[0]);
}
@ -182,15 +181,14 @@ namespace Ryujinx.UI
{
if (_GameLoaded)
{
MessageDialog eRrOr = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, "A game has already been loaded. Please close the emulator and try again");
eRrOr.SetSizeRequest(100, 20);
eRrOr.Title = "Ryujinx - Error";
eRrOr.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.ryujinxIcon.png");
eRrOr.WindowPosition = WindowPosition.Center;
eRrOr.Run();
eRrOr.Destroy();
MessageDialog errorDialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, "A game has already been loaded. Please close the emulator and try again");
errorDialog.SetSizeRequest(100, 20);
errorDialog.Title = "Ryujinx - Error";
errorDialog.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.ryujinxIcon.png");
errorDialog.WindowPosition = WindowPosition.Center;
errorDialog.Run();
errorDialog.Destroy();
}
else
{
if (Directory.Exists(path))
@ -310,7 +308,7 @@ namespace Ryujinx.UI
try
{
string appdataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string savePath = System.IO.Path.Combine(appdataPath, "RyuFs", "nand", "user", "save", "0000000000000000", userId, _device.System.TitleID);
string savePath = System.IO.Path.Combine(appdataPath, "RyuFs", "nand", "user", "save", "0000000000000000", userId, _device.System.TitleID);
double currentPlayTime = 0;
using (FileStream fs = File.OpenRead(System.IO.Path.Combine(savePath, "LastPlayed.dat")))
@ -357,27 +355,22 @@ namespace Ryujinx.UI
string path = (string)_TableStore.GetValue(treeiter, 8);
LoadApplication(path);
//Box.Remove(GameTableWindow);
//Box.Add(GlScreen);
}
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);
fc.Filter = new FileFilter();
fc.Filter.AddPattern("*.nsp");
fc.Filter.AddPattern("*.xci");
fc.Filter.AddPattern("*.nca");
fc.Filter.AddPattern("*.nro");
fc.Filter.AddPattern("*.nso");
fc.Filter.AddPattern("*.nsp" );
fc.Filter.AddPattern("*.pfs0");
fc.Filter.AddPattern("*.xci" );
fc.Filter.AddPattern("*.nca" );
fc.Filter.AddPattern("*.nro" );
fc.Filter.AddPattern("*.nso" );
if (fc.Run() == (int)ResponseType.Accept)
{
LoadApplication(fc.Filename);
//Box.Remove(GameTableWindow);
//Box.Add(GlScreen);
}
fc.Destroy();
@ -390,9 +383,6 @@ namespace Ryujinx.UI
if (fc.Run() == (int)ResponseType.Accept)
{
LoadApplication(fc.Filename);
//Box.Remove(GameTableWindow);
//Box.Add(GlScreen);
}
fc.Destroy();
@ -414,9 +404,7 @@ namespace Ryujinx.UI
private void ReturnMain_Pressed(object o, EventArgs args)
{
Box.Remove(GlScreen);
Box.Add(GameTableWindow);
//will also have to write logic to kill running game
//TODO: Write logic to kill running game
}
private void FullScreen_Toggled(object o, EventArgs args)
@ -441,7 +429,7 @@ namespace Ryujinx.UI
if (fc.Run() == (int)ResponseType.Accept)
{
//Soon™
//TODO: Write logic to emulate reading an NFC tag
}
fc.Destroy();
}

View file

@ -188,7 +188,7 @@ namespace Ryujinx.UI
GameDirsBox.AppendColumn("", new CellRendererText(), "text", 0);
_GameDirsBoxStore = new ListStore(typeof(string));
GameDirsBox.Model = _GameDirsBoxStore;
GameDirsBox.Model = _GameDirsBoxStore;
foreach (string GameDir in SwitchConfig.GameDirs)
{
_GameDirsBoxStore.AppendValues(GameDir);