mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Self invite on launch dialog
This commit is contained in:
@@ -83,6 +83,13 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
|
<el-button
|
||||||
|
type="default"
|
||||||
|
size="small"
|
||||||
|
:disabled="!launchDialog.secureOrShortName"
|
||||||
|
@click="selfInvite(launchDialog.location, launchDialog.shortName)">
|
||||||
|
{{ t('dialog.launch.self_invite') }}
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -109,7 +116,8 @@
|
|||||||
useInviteStore,
|
useInviteStore,
|
||||||
useInstanceStore,
|
useInstanceStore,
|
||||||
useLaunchStore,
|
useLaunchStore,
|
||||||
useLocationStore
|
useLocationStore,
|
||||||
|
useGameStore
|
||||||
} from '../../stores';
|
} from '../../stores';
|
||||||
import InviteDialog from './InviteDialog/InviteDialog.vue';
|
import InviteDialog from './InviteDialog/InviteDialog.vue';
|
||||||
|
|
||||||
@@ -123,6 +131,7 @@
|
|||||||
const { launchDialogData } = storeToRefs(useLaunchStore());
|
const { launchDialogData } = storeToRefs(useLaunchStore());
|
||||||
const { showPreviousInstancesInfoDialog } = useInstanceStore();
|
const { showPreviousInstancesInfoDialog } = useInstanceStore();
|
||||||
const { canOpenInstanceInGame } = useInviteStore();
|
const { canOpenInstanceInGame } = useInviteStore();
|
||||||
|
const { isGameRunning } = storeToRefs(useGameStore());
|
||||||
|
|
||||||
const launchDialogRef = ref(null);
|
const launchDialogRef = ref(null);
|
||||||
|
|
||||||
@@ -197,6 +206,20 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function handleLaunchGame(location, shortName, desktop) {
|
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);
|
launchGame(location, shortName, desktop);
|
||||||
isVisible.value = false;
|
isVisible.value = false;
|
||||||
}
|
}
|
||||||
@@ -204,6 +227,25 @@
|
|||||||
tryOpenInstanceInVrc(location, shortName);
|
tryOpenInstanceInVrc(location, shortName);
|
||||||
isVisible.value = false;
|
isVisible.value = false;
|
||||||
}
|
}
|
||||||
|
function selfInvite(location, shortName) {
|
||||||
|
const L = parseLocation(location);
|
||||||
|
if (!L.isRealInstance) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
instanceRequest
|
||||||
|
.selfInvite({
|
||||||
|
instanceId: L.instanceId,
|
||||||
|
worldId: L.worldId,
|
||||||
|
shortName
|
||||||
|
})
|
||||||
|
.then((args) => {
|
||||||
|
proxy.$message({
|
||||||
|
message: 'Self invite sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
function getConfig() {
|
function getConfig() {
|
||||||
configRepository.getBool('launchAsDesktop').then((value) => (launchDialog.value.desktop = value));
|
configRepository.getBool('launchAsDesktop').then((value) => (launchDialog.value.desktop = value));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1329,7 +1329,11 @@
|
|||||||
"info": "Info",
|
"info": "Info",
|
||||||
"invite": "Invite",
|
"invite": "Invite",
|
||||||
"launch": "Launch",
|
"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": {
|
"export_friends_list": {
|
||||||
"header": "Export Friends List",
|
"header": "Export Friends List",
|
||||||
|
|||||||
Reference in New Issue
Block a user