Update MainWindow.cs

This commit is contained in:
LDj3SNuD 2019-09-19 02:08:23 +02:00 committed by GitHub
parent 81e8be9c1b
commit 2fd3f3c326
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
using DiscordRPC;
using DiscordRPC;
using Gtk;
using GUI = Gtk.Builder.ObjectAttribute;
using Ryujinx.Audio;
@ -208,6 +208,8 @@ namespace Ryujinx.UI
}
else
{
Logger.RestartTime();
if (Directory.Exists(path))
{
string[] romFsFiles = Directory.GetFiles(path, "*.istorage");
@ -228,7 +230,6 @@ namespace Ryujinx.UI
_device.LoadCart(path);
}
}
else if (File.Exists(path))
{
switch (System.IO.Path.GetExtension(path).ToLowerInvariant())
@ -254,14 +255,14 @@ namespace Ryujinx.UI
}
catch (ArgumentOutOfRangeException)
{
Logger.PrintError(LogClass.Application, $"The file which you have specified is unsupported by Ryujinx");
Logger.PrintError(LogClass.Application, "The file which you have specified is unsupported by Ryujinx.");
}
break;
}
}
else
{
Logger.PrintWarning(LogClass.Application, "Please specify a valid XCI/NCA/NSP/PFS0/NRO file");
Logger.PrintWarning(LogClass.Application, "Please specify a valid XCI/NCA/NSP/PFS0/NRO file.");
End();
}
@ -396,7 +397,7 @@ namespace Ryujinx.UI
Profile.FinishProfiling();
_device.Dispose();
_audioOut.Dispose();
DiscordClient.Dispose();
DiscordClient?.Dispose();
Logger.Shutdown();
Environment.Exit(0);
}