mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-01-11 20:10:38 +00:00
Add Discord Capture option under End Capture.
This commit is contained in:
parent
08af8d8cf8
commit
1910ab363a
3 changed files with 34 additions and 2 deletions
|
|
@ -92,6 +92,14 @@ namespace Ryujinx.Ava.UI.Renderer
|
|||
return RenderDoc.IsFrameCapturing && RenderDoc.EndFrameCapture(nint.Zero, WindowHandle);
|
||||
}
|
||||
|
||||
public bool DiscardRenderDocCapture()
|
||||
{
|
||||
if (!RenderDoc.IsAvailable) return false;
|
||||
if (!RenderDoc.IsFrameCapturing) return false;
|
||||
|
||||
return RenderDoc.IsFrameCapturing && RenderDoc.DiscardFrameCapture(nint.Zero, WindowHandle);
|
||||
}
|
||||
|
||||
protected virtual void OnWindowDestroying()
|
||||
{
|
||||
WindowHandle = nint.Zero;
|
||||
|
|
|
|||
|
|
@ -1882,6 +1882,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
|
||||
public void ToggleCapture()
|
||||
{
|
||||
if (ShowLoadProgress) return;
|
||||
|
||||
AppHost.RendererHost.EmbeddedWindow.ToggleRenderDocCapture(AppHost.Device);
|
||||
}
|
||||
|
||||
|
|
@ -2501,7 +2503,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
}
|
||||
|
||||
public static RelayCommand<MainWindowViewModel> StartRenderDocCapture { get; } =
|
||||
Commands.CreateConditional<MainWindowViewModel>(_ => RenderDoc.IsAvailable,
|
||||
Commands.CreateConditional<MainWindowViewModel>(vm => RenderDoc.IsAvailable && !vm.ShowLoadProgress,
|
||||
viewModel =>
|
||||
{
|
||||
if (!RenderDoc.IsFrameCapturing)
|
||||
|
|
@ -2517,7 +2519,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
});
|
||||
|
||||
public static RelayCommand<MainWindowViewModel> EndRenderDocCapture { get; } =
|
||||
Commands.CreateConditional<MainWindowViewModel>(_ => RenderDoc.IsAvailable,
|
||||
Commands.CreateConditional<MainWindowViewModel>(vm => RenderDoc.IsAvailable && !vm.ShowLoadProgress,
|
||||
viewModel =>
|
||||
{
|
||||
if (RenderDoc.IsFrameCapturing)
|
||||
|
|
@ -2531,6 +2533,21 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
viewModel.RenderDocIsCapturing = RenderDoc.IsFrameCapturing;
|
||||
});
|
||||
|
||||
public static RelayCommand<MainWindowViewModel> DiscardRenderDocCapture { get; } =
|
||||
Commands.CreateConditional<MainWindowViewModel>(vm => RenderDoc.IsAvailable && !vm.ShowLoadProgress,
|
||||
viewModel =>
|
||||
{
|
||||
if (RenderDoc.IsFrameCapturing)
|
||||
{
|
||||
if (viewModel.AppHost.RendererHost.EmbeddedWindow.DiscardRenderDocCapture())
|
||||
{
|
||||
Logger.Info?.Print(LogClass.Application, "Discarded RenderDoc capture.");
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.RenderDocIsCapturing = RenderDoc.IsFrameCapturing;
|
||||
});
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,6 +216,13 @@
|
|||
Header="End RenderDoc Frame Capture"
|
||||
Icon="{ext:Icon fa-solid fa-video-slash}"
|
||||
IsEnabled="{Binding IsGameRunning}" />
|
||||
<MenuItem
|
||||
IsVisible="{Binding ShowEndCaptureButton}"
|
||||
Command="{Binding DiscardRenderDocCapture}"
|
||||
CommandParameter="{Binding}"
|
||||
Header="Discard RenderDoc Frame Capture"
|
||||
Icon="{ext:Icon fa-solid fa-video-slash}"
|
||||
IsEnabled="{Binding IsGameRunning}" />
|
||||
</MenuItem>
|
||||
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarActions}" IsVisible="{Binding EnableNonGameRunningControls}">
|
||||
<MenuItem Header="{ext:Locale MenuBarActionsInstallKeys}" Icon="{ext:Icon fa-solid fa-key}">
|
||||
|
|
|
|||
Loading…
Reference in a new issue