mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-08-03 02:37:11 +02:00
Overlay system
This commit is contained in:
parent
3be20385ed
commit
069a703f22
13 changed files with 1088 additions and 19 deletions
|
@ -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()
|
||||
|
|
|
@ -1703,11 +1703,22 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
? ConfigurationState.InstanceExtra.Hid.InputConfig.Value
|
||||
: ConfigurationState.Instance.Hid.InputConfig.Value;
|
||||
|
||||
// Only show overlay if there are actual controller configurations for players 1-4
|
||||
if (inputConfigs?.Any(c => c.PlayerIndex <= PlayerIndex.Player4) == true)
|
||||
// Debug: Log what we're getting
|
||||
Logger.Info?.Print(LogClass.UI, $"MainWindowViewModel: Found {inputConfigs?.Count ?? 0} input configs");
|
||||
if (inputConfigs != null)
|
||||
{
|
||||
int duration = ConfigurationState.Instance.ControllerOverlayGameStartDuration.Value;
|
||||
Window.ControllerOverlay.ShowControllerBindings(inputConfigs, duration);
|
||||
foreach (var config in inputConfigs)
|
||||
{
|
||||
Logger.Info?.Print(LogClass.UI, $" Config: Player {config.PlayerIndex}, Backend {config.Backend}, Name '{config.Name}', Type {config.ControllerType}");
|
||||
}
|
||||
}
|
||||
|
||||
// Always show overlay - if no configs, it will show test data
|
||||
int duration = ConfigurationState.Instance.ControllerOverlayGameStartDuration.Value;
|
||||
// Show overlay through the GPU context window directly
|
||||
if (AppHost?.Device?.Gpu?.Window != null)
|
||||
{
|
||||
AppHost.Device.Gpu.Window.ShowControllerBindings(inputConfigs, duration);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
@ -180,9 +180,6 @@
|
|||
Grid.Row="2" />
|
||||
</Grid>
|
||||
|
||||
<!-- Controller Overlay -->
|
||||
<overlayControls:ControllerOverlay
|
||||
Name="ControllerOverlay"
|
||||
ZIndex="2000" />
|
||||
|
||||
</Grid>
|
||||
</window:StyleableAppWindow>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue