config.json editor

This commit is contained in:
Natsumi
2021-05-03 00:00:40 +12:00
parent 279b4c61bd
commit 35b23e0b13
3 changed files with 115 additions and 0 deletions

View File

@@ -10905,6 +10905,83 @@ speechSynthesis.getVoices();
this.userDialogLastActiveTab = obj.label;
};
// VRChat Config JSON
$app.data.VRChatConfigFile = {};
$app.data.VRChatConfigList = {
cache_size: 'Max Cache Size in Gigabytes (minimum 20)',
cache_expiry_delay: 'Expire Cache in Days (minimum 30)',
dynamic_bone_max_affected_transform_count: 'Dynamic Bones Limit Max Transforms (0 disables all components)',
dynamic_bone_max_collider_check_count: 'Dynamic Bones Limit Max Collider Collisions (0 disables all components)'
};
$app.methods.ReadVRChatConfigFile = async function () {
this.VRChatConfigFile = {};
var config = await AppApi.ReadConfigFile();
if (config) {
this.VRChatConfigFile = JSON.parse(config);
}
};
$app.methods.WriteVRChatConfigFile = async function () {
var json = JSON.stringify(this.VRChatConfigFile, null, "\t");
AppApi.WriteConfigFile(json);
};
$app.data.VRChatConfigDialog = {
visible: false,
cameraRes: false,
screenshotRes: false
};
API.$on('LOGOUT', function () {
$app.VRChatConfigDialog.visible = false;
});
$app.methods.showVRChatConfig = async function () {
await this.ReadVRChatConfigFile();
this.$nextTick(() => adjustDialogZ(this.$refs.VRChatConfigDialog.$el));
this.VRChatConfigDialog = {
cameraRes: false,
screenshotRes: false,
visible: true
}
if ((this.VRChatConfigFile.camera_res_height === 2160) &&
(this.VRChatConfigFile.camera_res_width === 3840)) {
this.VRChatConfigDialog.cameraRes = true;
}
if ((this.VRChatConfigFile.screenshot_res_height === 2160) &&
(this.VRChatConfigFile.screenshot_res_width === 3840)) {
this.VRChatConfigDialog.screenshotRes = true;
}
};
$app.methods.SaveVRChatConfigFile = function () {
if (this.VRChatConfigDialog.cameraRes) {
this.VRChatConfigFile.camera_res_height = 2160;
this.VRChatConfigFile.camera_res_width = 3840;
} else {
delete this.VRChatConfigFile.camera_res_height;
delete this.VRChatConfigFile.camera_res_width;
}
if (this.VRChatConfigDialog.screenshotRes) {
this.VRChatConfigFile.screenshot_res_height = 2160;
this.VRChatConfigFile.screenshot_res_width = 3840;
} else {
delete this.VRChatConfigFile.screenshot_res_height;
delete this.VRChatConfigFile.screenshot_res_width;
}
for (var item in this.VRChatConfigFile) {
if (!this.VRChatConfigFile[item]) {
delete this.VRChatConfigFile[item];
}
}
this.VRChatConfigDialog.visible = false;
this.WriteVRChatConfigFile();
};
$app = new Vue($app);
window.$app = $app;
}());

View File

@@ -866,6 +866,7 @@ html
div.options-container-item
el-button-group
el-button(size="small" icon="el-icon-s-operation" @click="showLaunchOptions()") Launch Options
el-button(size="small" icon="el-icon-s-operation" @click="showVRChatConfig()") VRChat config.json
div.options-container(style="margin-top:45px;border-top:1px solid #eee;padding-top:30px")
span.header Legal Notice
div.options-container-item
@@ -1465,6 +1466,24 @@ html
el-button(size="small" @click="openExternalLink('https://docs.vrchat.com/docs/launch-options')") VRChat Docs
el-button(size="small" @click="openExternalLink('https://docs.unity3d.com/Manual/CommandLineArguments.html')") Unity Manual
el-button(type="primary" size="small" :disabled="launchOptionsDialog.loading" @click="updateLaunchOptions" style="margin-left:auto") OK
//- dialog: VRChat Config JSON
el-dialog.x-dialog(ref="VRChatConfigDialog" :visible.sync="VRChatConfigDialog.visible" title="VRChat Config JSON" width="420px")
div(style='font-size:12px;')
| These options are for advanced users only. #[br]
| Leave field empty to set as default.
br
div(style="display:inline-block" v-for="(name, value) in VRChatConfigList" :key="value")
span(v-text="name" style="word-break:keep-all")
|:
el-input(v-model="VRChatConfigFile[value]" size="mini" style="margin-top:10px")
el-checkbox(v-model="VRChatConfigFile.disableRichPresence" style="margin-top:5px;display:block") Disable Discord Rich Presence
el-checkbox(v-model="VRChatConfigDialog.cameraRes" style="margin-top:5px") 4K Camera
el-checkbox(v-model="VRChatConfigDialog.screenshotRes" style="margin-top:5px") 4K Screenshots
template(#footer)
el-button(size="small" @click="openExternalLink('https://docs.vrchat.com/docs/configuration-file')") VRChat Docs
el-button(size="small" @click="VRChatConfigDialog.visible = false") Cancel
el-button(type="primary" size="small" :disabled="VRChatConfigDialog.loading" @click="SaveVRChatConfigFile") Save
//- dialog: launch
el-dialog.x-dialog(ref="launchDialog" :visible.sync="launchDialog.visible" title="Launch" width="400px")