mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
feat: Add options to save the current world name/id to screenshot metadata/filenames
This commit is contained in:
22
AppApi.cs
22
AppApi.cs
@@ -634,5 +634,27 @@ namespace VRCX
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void AddScreenshotMetadata(string path, string worldName, string worldId, bool changeFilename = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
string fileName = Path.GetFileNameWithoutExtension(path);
|
||||
if (!File.Exists(path) || !path.EndsWith(".png") || !fileName.StartsWith("VRChat_")) return;
|
||||
|
||||
if (changeFilename)
|
||||
{
|
||||
var newFileName = $"{fileName}_{worldId}";
|
||||
var newPath = Path.Combine(Path.GetDirectoryName(path), newFileName + Path.GetExtension(path));
|
||||
File.Move(path, newPath);
|
||||
path = newPath;
|
||||
}
|
||||
|
||||
string metadataString = $"{Program.Version}||{worldId}||{worldName}";
|
||||
|
||||
ScreenshotHelper.WritePNGDescription(path, metadataString);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user