mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
launch options (closes #60)
This commit is contained in:
@@ -6964,6 +6964,40 @@ CefSharp.BindObjectAsync(
|
||||
});
|
||||
};
|
||||
|
||||
// App: Launch Options
|
||||
|
||||
$app.data.launchArguments = VRCXStorage.Get('launchArguments');
|
||||
|
||||
// App: Launch Options Dialog
|
||||
|
||||
$app.data.launchOptionsDialog = {
|
||||
visible: false,
|
||||
arguments: ''
|
||||
};
|
||||
|
||||
API.$on('LOGOUT', function () {
|
||||
$app.launchOptionsDialog.visible = false;
|
||||
});
|
||||
|
||||
$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);
|
||||
this.$message({
|
||||
message: 'updated',
|
||||
type: 'success'
|
||||
});
|
||||
};
|
||||
|
||||
$app.methods.showLaunchOptions = function () {
|
||||
this.$nextTick(() => adjustDialogZ(this.$refs.launchOptionsDialog.$el));
|
||||
var D = this.launchOptionsDialog;
|
||||
D.arguments = this.launchArguments;
|
||||
D.visible = true;
|
||||
};
|
||||
|
||||
// App: Launch Dialog
|
||||
|
||||
$app.data.launchDialog = {
|
||||
@@ -7000,9 +7034,19 @@ CefSharp.BindObjectAsync(
|
||||
D.visible = true;
|
||||
};
|
||||
|
||||
$app.methods.launchGame = function () {
|
||||
$app.methods.locationToLaunchArg = function (location) {
|
||||
return `"vrchat://launch?id=${location}"`;
|
||||
}
|
||||
|
||||
$app.methods.launchGame = function (...args) {
|
||||
var D = this.launchDialog;
|
||||
VRCX.StartGame(D.location, D.desktop);
|
||||
if (this.launchArguments) {
|
||||
args.push(this.launchArguments);
|
||||
}
|
||||
if (D.desktop === true) {
|
||||
args.push('--no-vr');
|
||||
}
|
||||
VRCX.StartGame(args.join(' '));
|
||||
D.visible = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -378,6 +378,9 @@ html
|
||||
.detail
|
||||
span.name Repository URL
|
||||
span.extra https://github.com/pypy-vrc/VRCX
|
||||
div(style="margin-top:5px")
|
||||
el-button-group
|
||||
el-button(size="small" icon="el-icon-s-operation" @click="showLaunchOptions()") VRChat Launch Options
|
||||
div(style="margin-top:30px")
|
||||
span(style="font-weight:bold") Direct Access
|
||||
div(style="margin-top:5px")
|
||||
@@ -1031,13 +1034,25 @@ html
|
||||
el-button(size="small" @click="showInviteDialog(newInstanceDialog.location)") Invite
|
||||
el-button(type="primary" size="small" @click="showLaunchDialog(newInstanceDialog.location)") Launch
|
||||
|
||||
//- dialog: launch options
|
||||
el-dialog.x-dialog(ref="launchOptionsDialog" :visible.sync="launchOptionsDialog.visible" title="Launch Options" width="400px")
|
||||
div(style='font-size:12px;')
|
||||
| These options are for advanced users only. #[br]
|
||||
| to change fps: --fps=<N> ex) #[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")
|
||||
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
|
||||
|
||||
//- dialog: launch
|
||||
el-dialog.x-dialog(ref="launchDialog" :visible.sync="launchDialog.visible" title="Launch" width="400px")
|
||||
div #[span(v-text="launchDialog.url" style="word-break:break-all;font-size:12px")]
|
||||
template(#footer)
|
||||
el-checkbox(v-model="launchDialog.desktop" style="float:left;margin-top:5px") Start as Desktop (No VR)
|
||||
el-button(size="small" @click="showInviteDialog(launchDialog.location)") Invite
|
||||
el-button(type="primary" size="small" @click="launchGame()") Launch
|
||||
el-button(type="primary" size="small" @click="launchGame(locationToLaunchArg(launchDialog.location))") Launch
|
||||
|
||||
//- dialog: open source software notice
|
||||
el-dialog.x-dialog(:visible.sync="ossDialog" title="Open Source Software Notice" width="650px")
|
||||
|
||||
Reference in New Issue
Block a user