feat: Add options to save the current world name/id to screenshot metadata/filenames

This commit is contained in:
Teacup
2023-02-11 18:30:53 -05:00
parent 8aae8f3b78
commit 0f3b8c732a
10 changed files with 265 additions and 6 deletions

View File

@@ -168,7 +168,7 @@ namespace VRCX
m_FirstRun = false;
}
private void ParseLog(FileInfo fileInfo, LogContext logContext)
{
try
@@ -227,7 +227,8 @@ namespace VRCX
ParseLogUsharpVideoPlay(fileInfo, logContext, line, offset) == true ||
ParseLogUsharpVideoSync(fileInfo, logContext, line, offset) == true ||
ParseLogWorldVRCX(fileInfo, logContext, line, offset) == true ||
ParseLogOnAudioConfigurationChanged(fileInfo, logContext, line, offset) == true)
ParseLogOnAudioConfigurationChanged(fileInfo, logContext, line, offset) == true ||
ParseLogScreenshot(fileInfo, logContext, line, offset) == true)
{
continue;
}
@@ -344,6 +345,22 @@ namespace VRCX
return false;
}
private bool ParseLogScreenshot(FileInfo fileInfo, LogContext logContext, string line, int offset)
{
// This won't work with VRChat's new "Multi Layer" camera mode, since it doesn't output any logs like normal pictures.
// 2023.02.08 12:31:35 Log - [VRC Camera] Took screenshot to: C:\Users\Tea\Pictures\VRChat\2023-02\VRChat_2023-02-08_12-31-35.104_1920x1080.png
if (!line.Contains("[VRC Camera] Took screenshot to: "))
return false;
var lineOffset = line.LastIndexOf("] Took screenshot to: ");
if (lineOffset < 0)
return true;
var screenshotPath = line.Substring(lineOffset + 22);
AppendLog(new[] { fileInfo.Name, ConvertLogTimeToISO8601(line), "screenshot", screenshotPath });
return true;
}
private bool ParseLogLocationDestination(FileInfo fileInfo, LogContext logContext, string line, int offset)
{
// 2021.09.02 00:02:12 Log - [Behaviour] Destination set: wrld_4432ea9b-729c-46e3-8eaf-846aa0a37fdd:15609~private(usr_032383a7-748c-4fb2-94e4-bcb928e5de6b)~nonce(72CC87D420C1D49AEFFBEE8824C84B2DF0E38678E840661E)