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

View File

@@ -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 ||

View File

@@ -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;
};

View File

@@ -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")