mirror of
https://github.com/vrcx-team/VRCX.git
synced 2026-04-06 00:32:02 +02:00
Add self invite to launch dialog
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<safe-dialog ref="launchDialogRef" :visible.sync="isVisible" :title="t('dialog.launch.header')" width="450px">
|
||||
<safe-dialog ref="launchDialogRef" :visible.sync="isVisible" :title="t('dialog.launch.header')" width="500px">
|
||||
<el-form :model="launchDialog" label-width="100px">
|
||||
<el-form-item :label="t('dialog.launch.url')">
|
||||
<el-input
|
||||
@@ -67,6 +67,13 @@
|
||||
{{ t('dialog.launch.invite') }}
|
||||
</el-button>
|
||||
<template v-if="isGameRunning">
|
||||
<el-button
|
||||
type="default"
|
||||
size="small"
|
||||
:disabled="!launchDialog.secureOrShortName"
|
||||
@click="handleSelfInvite(launchDialog.location, launchDialog.shortName)">
|
||||
{{ t('dialog.launch.self_invite') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="default"
|
||||
size="small"
|
||||
@@ -197,6 +204,20 @@
|
||||
});
|
||||
}
|
||||
function handleLaunchGame(location, shortName, desktop) {
|
||||
if (isGameRunning.value) {
|
||||
proxy.$confirm(t('dialog.launch.game_running_warning'), t('dialog.launch.header'), {
|
||||
confirmButtonText: t('dialog.launch.confirm_yes'),
|
||||
cancelButtonText: t('dialog.launch.confirm_no'),
|
||||
type: 'warning',
|
||||
callback: (action) => {
|
||||
if (action === 'confirm') {
|
||||
launchGame(location, shortName, desktop);
|
||||
isVisible.value = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
launchGame(location, shortName, desktop);
|
||||
isVisible.value = false;
|
||||
}
|
||||
@@ -204,6 +225,18 @@
|
||||
tryOpenInstanceInVrc(location, shortName);
|
||||
isVisible.value = false;
|
||||
}
|
||||
async function handleSelfInvite(location, shortName) {
|
||||
const L = parseLocation(location);
|
||||
await instanceRequest.selfInvite({
|
||||
instanceId: L.instanceId,
|
||||
worldId: L.worldId,
|
||||
shortName
|
||||
});
|
||||
proxy.$message({
|
||||
message: 'Self invite sent',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
function getConfig() {
|
||||
configRepository.getBool('launchAsDesktop').then((value) => (launchDialog.value.desktop = value));
|
||||
}
|
||||
|
||||
@@ -1324,7 +1324,11 @@
|
||||
"info": "Info",
|
||||
"invite": "Invite",
|
||||
"launch": "Launch",
|
||||
"open_ingame": "Open in Game"
|
||||
"open_ingame": "Open in Game",
|
||||
"self_invite": "Self Invite",
|
||||
"game_running_warning": "Are you sure you want to launch a second VRChat instance?",
|
||||
"confirm_yes": "Yes",
|
||||
"confirm_no": "No"
|
||||
},
|
||||
"export_friends_list": {
|
||||
"header": "Export Friends List",
|
||||
|
||||
@@ -111,7 +111,7 @@ export const useInviteStore = defineStore('Invite', () => {
|
||||
/**
|
||||
*
|
||||
* @param {string} messageType
|
||||
* @param {string} inviteMessage
|
||||
* @param {any} inviteMessage
|
||||
*/
|
||||
function showEditInviteMessageDialog(messageType, inviteMessage) {
|
||||
const D = state.editInviteMessageDialog;
|
||||
|
||||
Reference in New Issue
Block a user