Ava UI: Prevent Status Bar Backend Update (#6506)

* Prevent Status Bar Backend Update

* Make it a switch
This commit is contained in:
Isaac Marovitz 2024-04-10 22:40:17 +01:00 committed by GitHub
parent 0652813b0f
commit 9480e5c5ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 10 deletions

View file

@ -0,0 +1,16 @@
using System;
namespace Ryujinx.Ava.UI.Models
{
internal class StatusInitEventArgs : EventArgs
{
public string GpuBackend { get; }
public string GpuName { get; }
public StatusInitEventArgs(string gpuBackend, string gpuName)
{
GpuBackend = gpuBackend;
GpuName = gpuName;
}
}
}

View file

@ -6,23 +6,19 @@ namespace Ryujinx.Ava.UI.Models
{
public bool VSyncEnabled { get; }
public string VolumeStatus { get; }
public string GpuBackend { get; }
public string AspectRatio { get; }
public string DockedMode { get; }
public string FifoStatus { get; }
public string GameStatus { get; }
public string GpuName { get; }
public StatusUpdatedEventArgs(bool vSyncEnabled, string volumeStatus, string gpuBackend, string dockedMode, string aspectRatio, string gameStatus, string fifoStatus, string gpuName)
public StatusUpdatedEventArgs(bool vSyncEnabled, string volumeStatus, string dockedMode, string aspectRatio, string gameStatus, string fifoStatus)
{
VSyncEnabled = vSyncEnabled;
VolumeStatus = volumeStatus;
GpuBackend = gpuBackend;
DockedMode = dockedMode;
AspectRatio = aspectRatio;
GameStatus = gameStatus;
FifoStatus = fifoStatus;
GpuName = gpuName;
}
}
}

View file

@ -1172,6 +1172,7 @@ namespace Ryujinx.Ava.UI.ViewModels
{
RendererHostControl.WindowCreated += RendererHost_Created;
AppHost.StatusInitEvent += Init_StatusBar;
AppHost.StatusUpdatedEvent += Update_StatusBar;
AppHost.AppExit += AppHost_AppExit;
@ -1198,6 +1199,18 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
private void Init_StatusBar(object sender, StatusInitEventArgs args)
{
if (ShowMenuAndStatusBar && !ShowLoadProgress)
{
Dispatcher.UIThread.InvokeAsync(() =>
{
GpuNameText = args.GpuName;
BackendText = args.GpuBackend;
});
}
}
private void Update_StatusBar(object sender, StatusUpdatedEventArgs args)
{
if (ShowMenuAndStatusBar && !ShowLoadProgress)
@ -1220,8 +1233,6 @@ namespace Ryujinx.Ava.UI.ViewModels
GameStatusText = args.GameStatus;
VolumeStatusText = args.VolumeStatus;
FifoStatusText = args.FifoStatus;
GpuNameText = args.GpuName;
BackendText = args.GpuBackend;
ShowStatusSeparator = true;
});