Overlay system

This commit is contained in:
Barış Hamil 2025-06-21 00:17:10 +03:00
parent 3be20385ed
commit 069a703f22
13 changed files with 1088 additions and 19 deletions

View file

@ -1480,22 +1480,23 @@ namespace Ryujinx.Ava.Systems
private void ShowControllerOverlay(List<InputConfig> inputConfigs)
{
Dispatcher.UIThread.InvokeAsync(() =>
try
{
try
// Show overlay through the GPU context window directly
if (Device?.Gpu?.Window != null)
{
// Access the overlay through the MainWindow via the ViewModel
if (_viewModel?.Window?.ControllerOverlay != null)
{
int duration = ConfigurationState.Instance.ControllerOverlayInputCycleDuration.Value;
_viewModel.Window.ControllerOverlay.ShowControllerBindings(inputConfigs, duration);
}
int duration = ConfigurationState.Instance.ControllerOverlayInputCycleDuration.Value;
Device.Gpu.Window.ShowControllerBindings(inputConfigs, duration);
}
catch (Exception ex)
else
{
Logger.Error?.Print(LogClass.Application, $"Failed to show controller overlay: {ex.Message}");
Logger.Warning?.Print(LogClass.Application, "AppHost: Cannot show overlay - Device.Gpu.Window is null");
}
});
}
catch (Exception ex)
{
Logger.Error?.Print(LogClass.Application, $"Failed to show controller overlay: {ex.Message}");
}
}
private KeyboardHotkeyState GetHotkeyState()