diff options
author | Kyle <59298462+Kfollen93@users.noreply.github.com> | 2024-03-07 14:49:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-07 22:49:57 +0000 |
commit | 4e1a60328e1236c5f54a36c147914b2c13a770d4 (patch) | |
tree | 5a2c3bb1b331e35deaf24ebab01bc5477d658cc4 /src/Ryujinx.Gtk3/UI/RendererWidgetBase.cs | |
parent | 2505a1abcd5f31e4364bfb7f9313546f1840e5e1 (diff) |
Add title of game to screenshot text (#6266)1.1.1218
* Add sanitize method
* Add app name to screenshot text output
* Add app name to screenshot text
Diffstat (limited to 'src/Ryujinx.Gtk3/UI/RendererWidgetBase.cs')
-rw-r--r-- | src/Ryujinx.Gtk3/UI/RendererWidgetBase.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Ryujinx.Gtk3/UI/RendererWidgetBase.cs b/src/Ryujinx.Gtk3/UI/RendererWidgetBase.cs index e27d0604..0e636792 100644 --- a/src/Ryujinx.Gtk3/UI/RendererWidgetBase.cs +++ b/src/Ryujinx.Gtk3/UI/RendererWidgetBase.cs @@ -3,6 +3,7 @@ using Gtk; using Ryujinx.Common; using Ryujinx.Common.Configuration; using Ryujinx.Common.Logging; +using Ryujinx.Common.Utilities; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL.Multithreading; using Ryujinx.Graphics.Gpu; @@ -378,8 +379,12 @@ namespace Ryujinx.UI { lock (this) { - var currentTime = DateTime.Now; - string filename = $"ryujinx_capture_{currentTime.Year}-{currentTime.Month:D2}-{currentTime.Day:D2}_{currentTime.Hour:D2}-{currentTime.Minute:D2}-{currentTime.Second:D2}.png"; + string applicationName = Device.Processes.ActiveApplication.Name; + string sanitizedApplicationName = FileSystemUtils.SanitizeFileName(applicationName); + DateTime currentTime = DateTime.Now; + + string filename = $"{sanitizedApplicationName}_{currentTime.Year}-{currentTime.Month:D2}-{currentTime.Day:D2}_{currentTime.Hour:D2}-{currentTime.Minute:D2}-{currentTime.Second:D2}.png"; + string directory = AppDataManager.Mode switch { AppDataManager.LaunchMode.Portable or AppDataManager.LaunchMode.Custom => System.IO.Path.Combine(AppDataManager.BaseDirPath, "screenshots"), |