Update MainWindow.cs

This commit is contained in:
LDj3SNuD 2019-09-19 02:08:23 +02:00 committed by GitHub
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 Gtk;
using GUI = Gtk.Builder.ObjectAttribute; using GUI = Gtk.Builder.ObjectAttribute;
using Ryujinx.Audio; using Ryujinx.Audio;
@ -208,6 +208,8 @@ namespace Ryujinx.UI
} }
else else
{ {
Logger.RestartTime();
if (Directory.Exists(path)) if (Directory.Exists(path))
{ {
string[] romFsFiles = Directory.GetFiles(path, "*.istorage"); string[] romFsFiles = Directory.GetFiles(path, "*.istorage");
@ -228,7 +230,6 @@ namespace Ryujinx.UI
_device.LoadCart(path); _device.LoadCart(path);
} }
} }
else if (File.Exists(path)) else if (File.Exists(path))
{ {
switch (System.IO.Path.GetExtension(path).ToLowerInvariant()) switch (System.IO.Path.GetExtension(path).ToLowerInvariant())
@ -254,14 +255,14 @@ namespace Ryujinx.UI
} }
catch (ArgumentOutOfRangeException) 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; break;
} }
} }
else 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(); End();
} }
@ -396,7 +397,7 @@ namespace Ryujinx.UI
Profile.FinishProfiling(); Profile.FinishProfiling();
_device.Dispose(); _device.Dispose();
_audioOut.Dispose(); _audioOut.Dispose();
DiscordClient.Dispose(); DiscordClient?.Dispose();
Logger.Shutdown(); Logger.Shutdown();
Environment.Exit(0); Environment.Exit(0);
} }