VRChat Path Override

This commit is contained in:
Natsumi
2022-03-18 09:07:08 +13:00
parent 7ad28fbc24
commit 98c65779c7
3 changed files with 34 additions and 25 deletions
+11 -6
View File
@@ -172,6 +172,17 @@ namespace VRCX
if (match.Success == true) if (match.Success == true)
{ {
var path = match.Groups[1].Value; var path = match.Groups[1].Value;
StartGameFromPath(path, arguments);
}
}
}
catch
{
}
}
public void StartGameFromPath(string path, string arguments)
{
Process.Start(new ProcessStartInfo Process.Start(new ProcessStartInfo
{ {
WorkingDirectory = path, WorkingDirectory = path,
@@ -180,12 +191,6 @@ namespace VRCX
Arguments = arguments Arguments = arguments
}).Close(); }).Close();
} }
}
}
catch
{
}
}
public void OpenLink(string url) public void OpenLink(string url)
{ {
+13 -12
View File
@@ -14873,15 +14873,12 @@ speechSynthesis.getVoices();
}); });
}; };
// App: Launch Options
$app.data.launchArguments = VRCXStorage.Get('launchArguments');
// App: Launch Options Dialog // App: Launch Options Dialog
$app.data.launchOptionsDialog = { $app.data.launchOptionsDialog = {
visible: false, visible: false,
arguments: '' launchArguments: configRepository.getString('launchArguments'),
vrcLaunchPathOverride: configRepository.getString('vrcLaunchPathOverride')
}; };
API.$on('LOGOUT', function () { API.$on('LOGOUT', function () {
@@ -14891,9 +14888,9 @@ speechSynthesis.getVoices();
$app.methods.updateLaunchOptions = function () { $app.methods.updateLaunchOptions = function () {
var D = this.launchOptionsDialog; var D = this.launchOptionsDialog;
D.visible = false; D.visible = false;
var args = String(D.arguments).replace(/\s+/g, ' ').trim(); D.launchArguments = String(D.launchArguments).replace(/\s+/g, ' ').trim();
this.launchArguments = args; configRepository.setString('launchArguments', D.launchArguments);
VRCXStorage.Set('launchArguments', args); configRepository.setString('vrcLaunchPathOverride', D.vrcLaunchPathOverride);
this.$message({ this.$message({
message: 'updated', message: 'updated',
type: 'success' type: 'success'
@@ -14903,7 +14900,6 @@ speechSynthesis.getVoices();
$app.methods.showLaunchOptions = function () { $app.methods.showLaunchOptions = function () {
this.$nextTick(() => adjustDialogZ(this.$refs.launchOptionsDialog.$el)); this.$nextTick(() => adjustDialogZ(this.$refs.launchOptionsDialog.$el));
var D = this.launchOptionsDialog; var D = this.launchOptionsDialog;
D.arguments = this.launchArguments;
D.visible = true; D.visible = true;
}; };
@@ -15049,13 +15045,18 @@ speechSynthesis.getVoices();
$app.methods.launchGame = function (...args) { $app.methods.launchGame = function (...args) {
var D = this.launchDialog; var D = this.launchDialog;
if (this.launchArguments) { var { launchArguments, vrcLaunchPathOverride } = this.launchOptionsDialog;
args.push(this.launchArguments); if (launchArguments) {
args.push(launchArguments);
} }
if (D.desktop === true) { if (D.desktop) {
args.push('--no-vr'); args.push('--no-vr');
} }
if (vrcLaunchPathOverride) {
AppApi.StartGameFromPath(vrcLaunchPathOverride, args.join(' '));
} else {
AppApi.StartGame(args.join(' ')); AppApi.StartGame(args.join(' '));
}
D.visible = false; D.visible = false;
}; };
+8 -5
View File
@@ -2030,16 +2030,19 @@ html
el-button(type="primary" size="small" @click="showLaunchDialog(newInstanceDialog.location)") Launch el-button(type="primary" size="small" @click="showLaunchDialog(newInstanceDialog.location)") Launch
//- dialog: launch options //- 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") 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;') div(style="font-size:12px")
| These options are for advanced users only. #[br] | These options are for advanced users only. #[br]
| to change fps: --fps=<N> e.g.) #[el-tag(size="mini") --fps=144] | to change max 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") 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) template(#footer)
div(style="display:flex") 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.vrchat.com/docs/launch-options')") VRChat Docs
el-button(size="small" @click="openExternalLink('https://docs.unity3d.com/Manual/CommandLineArguments.html')") Unity Manual 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 //- 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") 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")