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

@@ -9272,6 +9272,22 @@ speechSynthesis.getVoices();
this.nowPlaying.offset = parseInt(timestamp, 10);
}
return;
case 'screenshot':
if (!this.isGameRunning || !this.screenshotHelper) return;
var entry = {
created_at: gameLog.dt,
type: 'Event',
//location: location,
data: "Screenshot Processed: " + gameLog.screenshotPath.replace(/^.*[\\\/]/, ''),
};
let world = API.parseLocation(this.lastLocation.location);
let worldID = world.worldId;
database.addGamelogEventToDatabase(entry);
AppApi.AddScreenshotMetadata(gameLog.screenshotPath, this.lastLocation.name, worldID, this.screenshotHelperModifyFilename);
break;
case 'api-request':
var bias = Date.parse(gameLog.dt) + 60 * 1000;
if (
@@ -13477,6 +13493,9 @@ speechSynthesis.getVoices();
'VRCX_progressPieFilter'
);
$app.data.screenshotHelper = configRepository.getBool('VRCX_screenshotHelper');
$app.data.screenshotHelperModifyFilename = configRepository.getBool('VRCX_screenshotHelperModifyFilename');
$app.methods.updateVRConfigVars = function () {
var notificationTheme = 'relax';
if (this.isDarkMode) {
@@ -20060,6 +20079,18 @@ speechSynthesis.getVoices();
this.VRChatConfigFile.screenshot_res_width = res.width;
};
// Screenshot Helper
$app.methods.saveScreenshotHelper = function () {
console.log("save helper toggle press")
configRepository.setBool('VRCX_screenshotHelper', this.screenshotHelper);
};
$app.methods.saveScreenshotHelperModifyFilename = function () {
console.log("save helper filename toggle press")
configRepository.setBool('VRCX_screenshotHelperSaveFilename', this.screenshotHelperModifyFilename);
};
// YouTube API
$app.data.youTubeApiKey = '';