Add CommonWarningDialogUI and RegistryUtil to Support NVIDIA Driver Warning

This commit is contained in:
copecone committed 2026-06-23 09:03:59 +09:00
1 parent 210eb443bd
commit 5f463273c7
7 files changed
+539 -10

No files matched your search

+9 -2
View File
@@ -32,12 +32,12 @@ namespace ADOFAIRenderer.UI
private System.Threading.CancellationTokenSource? _cts;
private readonly System.Collections.Concurrent.ConcurrentQueue<Action> _mainThreadQueue = new();
private static bool CheckFFmpegExists()
public static bool CheckFFmpegExists()
{
var userLibs = MelonEnvironment.UserLibsDirectory;
if (!Directory.Exists(userLibs)) return false;
string searchPattern = Application.platform switch
var searchPattern = Application.platform switch
{
RuntimePlatform.WindowsPlayer => "avcodec-*.dll",
RuntimePlatform.OSXPlayer => "libavcodec.*.dylib",
@@ -58,8 +58,11 @@ namespace ADOFAIRenderer.UI
obj.AddComponent<FFmpegDownloadUI>();
}
public static FFmpegDownloadUI? Instance { get; private set; }
private void Awake()
{
Instance = this;
if (CheckFFmpegExists())
{
Destroy(gameObject);
@@ -647,6 +650,10 @@ namespace ADOFAIRenderer.UI
private void OnDestroy()
{
_cts?.Dispose();
if (Instance == this)
{
Instance = null;
}
}
}
}