瀏覽代碼

Show confirmation dialog when attempting to close while a game is loaded (#1582)

Xpl0itR 5 年之前
父節點
當前提交
ce87650d81
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      Ryujinx/Ui/MainWindow.cs

+ 12 - 2
Ryujinx/Ui/MainWindow.cs

@@ -918,12 +918,22 @@ namespace Ryujinx.Ui
 
         private void Exit_Pressed(object sender, EventArgs args)
         {
-            End(_emulationContext);
+            if (!_gameLoaded || GtkDialog.CreateExitDialog())
+            {
+                End(_emulationContext);
+            }
         }
 
         private void Window_Close(object sender, DeleteEventArgs args)
         {
-            End(_emulationContext);
+            if (!_gameLoaded || GtkDialog.CreateExitDialog())
+            {
+                End(_emulationContext);
+            }
+            else
+            {
+                args.RetVal = true;
+            }
         }
 
         private void StopEmulation_Pressed(object sender, EventArgs args)