diff --git a/AppApi.cs b/AppApi.cs index 20c9e9f9..9ccd10a9 100644 --- a/AppApi.cs +++ b/AppApi.cs @@ -172,13 +172,7 @@ namespace VRCX if (match.Success == true) { var path = match.Groups[1].Value; - Process.Start(new ProcessStartInfo - { - WorkingDirectory = path, - FileName = $"{path}\\VRChat.exe", - UseShellExecute = false, - Arguments = arguments - }).Close(); + StartGameFromPath(path, arguments); } } } @@ -187,6 +181,17 @@ namespace VRCX } } + public void StartGameFromPath(string path, string arguments) + { + Process.Start(new ProcessStartInfo + { + WorkingDirectory = path, + FileName = $"{path}\\VRChat.exe", + UseShellExecute = false, + Arguments = arguments + }).Close(); + } + public void OpenLink(string url) { if (url.StartsWith("http://") == true || diff --git a/html/src/app.js b/html/src/app.js index 00aa2d90..9bb61c36 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -14873,15 +14873,12 @@ speechSynthesis.getVoices(); }); }; - // App: Launch Options - - $app.data.launchArguments = VRCXStorage.Get('launchArguments'); - // App: Launch Options Dialog $app.data.launchOptionsDialog = { visible: false, - arguments: '' + launchArguments: configRepository.getString('launchArguments'), + vrcLaunchPathOverride: configRepository.getString('vrcLaunchPathOverride') }; API.$on('LOGOUT', function () { @@ -14891,9 +14888,9 @@ speechSynthesis.getVoices(); $app.methods.updateLaunchOptions = function () { var D = this.launchOptionsDialog; D.visible = false; - var args = String(D.arguments).replace(/\s+/g, ' ').trim(); - this.launchArguments = args; - VRCXStorage.Set('launchArguments', args); + D.launchArguments = String(D.launchArguments).replace(/\s+/g, ' ').trim(); + configRepository.setString('launchArguments', D.launchArguments); + configRepository.setString('vrcLaunchPathOverride', D.vrcLaunchPathOverride); this.$message({ message: 'updated', type: 'success' @@ -14903,7 +14900,6 @@ speechSynthesis.getVoices(); $app.methods.showLaunchOptions = function () { this.$nextTick(() => adjustDialogZ(this.$refs.launchOptionsDialog.$el)); var D = this.launchOptionsDialog; - D.arguments = this.launchArguments; D.visible = true; }; @@ -15049,13 +15045,18 @@ speechSynthesis.getVoices(); $app.methods.launchGame = function (...args) { var D = this.launchDialog; - if (this.launchArguments) { - args.push(this.launchArguments); + var { launchArguments, vrcLaunchPathOverride } = this.launchOptionsDialog; + if (launchArguments) { + args.push(launchArguments); } - if (D.desktop === true) { + if (D.desktop) { args.push('--no-vr'); } - AppApi.StartGame(args.join(' ')); + if (vrcLaunchPathOverride) { + AppApi.StartGameFromPath(vrcLaunchPathOverride, args.join(' ')); + } else { + AppApi.StartGame(args.join(' ')); + } D.visible = false; }; diff --git a/html/src/index.pug b/html/src/index.pug index 285081fe..88f6d0bf 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -2030,16 +2030,19 @@ html el-button(type="primary" size="small" @click="showLaunchDialog(newInstanceDialog.location)") Launch //- dialog: launch options - el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="launchOptionsDialog" :visible.sync="launchOptionsDialog.visible" title="Launch Options" width="400px") - div(style='font-size:12px;') + el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="launchOptionsDialog" :visible.sync="launchOptionsDialog.visible" title="Launch Options" width="500px") + div(style="font-size:12px") | These options are for advanced users only. #[br] - | to change fps: --fps=<N> e.g.) #[el-tag(size="mini") --fps=144] - el-input(type="textarea" v-model="launchOptionsDialog.arguments" size="mini" show-word-limit :autosize="{ minRows:2, maxRows:5 }" placeholder="" style="margin-top:10px") + | to change max fps: --fps=<N> e.g.) #[el-tag(size="mini") --fps=144] + el-input(type="textarea" v-model="launchOptionsDialog.launchArguments" size="mini" show-word-limit :autosize="{ minRows:2, maxRows:5 }" placeholder="" style="margin-top:10px") + div(style="font-size:12px;margin-top:10px") + | VRChat Path Override + el-input(type="textarea" v-model="launchOptionsDialog.vrcLaunchPathOverride" placeholder="C:\\Program Files (x86)\\Steam\\steamapps\\common\\VRChat" :rows="1" style="dispaly:block;margin-top:10px") template(#footer) div(style="display:flex") 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 + el-button(type="primary" size="small" :disabled="launchOptionsDialog.loading" @click="updateLaunchOptions" style="margin-left:auto") Save //- dialog: VRChat Config JSON el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="VRChatConfigDialog" :visible.sync="VRChatConfigDialog.visible" title="VRChat Config JSON" width="420px")