From 7d60b542d624553a6f70b0aadb594a7bf075a8ab Mon Sep 17 00:00:00 2001 From: sharmander Date: Thu, 27 Jan 2022 02:06:35 -0500 Subject: [PATCH] Add ability to restart emulation in Actions menu. --- Ryujinx/Ui/MainWindow.cs | 11 +++++++++++ Ryujinx/Ui/MainWindow.glade | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/Ryujinx/Ui/MainWindow.cs b/Ryujinx/Ui/MainWindow.cs index 6f34304f4..5a6be5188 100644 --- a/Ryujinx/Ui/MainWindow.cs +++ b/Ryujinx/Ui/MainWindow.cs @@ -101,6 +101,7 @@ namespace Ryujinx.Ui [GUI] MenuItem _pauseEmulation; [GUI] MenuItem _resumeEmulation; [GUI] MenuItem _stopEmulation; + [GUI] MenuItem _restartEmulation; [GUI] MenuItem _simulateWakeUpMessage; [GUI] MenuItem _scanAmiibo; [GUI] MenuItem _takeScreenshot; @@ -1318,6 +1319,15 @@ namespace Ryujinx.Ui } } + private void RestartEmulation_Pressed(object sender, EventArgs args) + { + if (_emulationContext != null) + { + _userChannelPersistence.ExecuteProgram(HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy.Types.ProgramSpecifyKind.RestartProgram, 0); + StopEmulation_Pressed(sender, args); + } + } + private void StopEmulation_Pressed(object sender, EventArgs args) { if (_emulationContext != null) @@ -1327,6 +1337,7 @@ namespace Ryujinx.Ui _pauseEmulation.Sensitive = false; _resumeEmulation.Sensitive = false; + RendererWidget?.Exit(); } diff --git a/Ryujinx/Ui/MainWindow.glade b/Ryujinx/Ui/MainWindow.glade index 595786a32..79ad746a6 100644 --- a/Ryujinx/Ui/MainWindow.glade +++ b/Ryujinx/Ui/MainWindow.glade @@ -323,6 +323,16 @@ + + + True + False + Restart of the current game + Restart Emulation + True + + + True