Add title of game to screenshot text (#6266)

* Add sanitize method

* Add app name to screenshot text output

* Add app name to screenshot text
This commit is contained in:
Kyle 2024-03-07 14:49:57 -08:00 committed by GitHub
parent 2505a1abcd
commit 4e1a60328e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 3 deletions

View file

@ -1,4 +1,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Ryujinx.Common.Utilities
{
@ -44,5 +46,11 @@ namespace Ryujinx.Common.Utilities
CopyDirectory(sourceDir, destinationDir, true);
Directory.Delete(sourceDir, true);
}
public static string SanitizeFileName(string fileName)
{
var reservedChars = new HashSet<char>(Path.GetInvalidFileNameChars());
return string.Concat(fileName.Select(c => reservedChars.Contains(c) ? '_' : c));
}
}
}