소스 검색

UI: Intel Mac warning
Upon launch, shows a warning about using an Intel Mac. This will only show once every boot. You can only turn it off by getting a better system.

Evan Husted 1 년 전
부모
커밋
4868fface8
1개의 변경된 파일20개의 추가작업 그리고 0개의 파일을 삭제
  1. 20 0
      src/Ryujinx/UI/Windows/MainWindow.axaml.cs

+ 20 - 0
src/Ryujinx/UI/Windows/MainWindow.axaml.cs

@@ -32,6 +32,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Reactive.Linq;
+using System.Runtime.InteropServices;
 using System.Runtime.Versioning;
 using System.Threading;
 using System.Threading.Tasks;
@@ -136,6 +137,8 @@ namespace Ryujinx.Ava.UI.Windows
             base.OnApplyTemplate(e);
 
             NotificationHelper.SetNotificationManager(this);
+
+            ShowIntelMacWarningAsync();
         }
 
         private void OnScalingChanged(object sender, EventArgs e)
@@ -731,5 +734,22 @@ namespace Ryujinx.Ava.UI.Windows
                     (int)Symbol.Checkmark);
             });
         }
+
+        private static bool _intelMacWarningShown;
+
+        public static async Task ShowIntelMacWarningAsync()
+        {
+            if (!_intelMacWarningShown && 
+                (OperatingSystem.IsMacOS() && 
+                 (RuntimeInformation.OSArchitecture == Architecture.X64 ||
+                                               RuntimeInformation.OSArchitecture == Architecture.X86)))
+            {
+                _intelMacWarningShown = true;
+
+                await Dispatcher.UIThread.InvokeAsync(async () => await ContentDialogHelper.CreateWarningDialog(
+                    "Intel Mac Warning",
+                    "Intel Macs are not supported and will not work properly.\nIf you continue, do not come to our Discord asking for support."));
+            }
+        }
     }
 }