Преглед на файлове

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."));
+            }
+        }
     }
 }