Open instance in-game

This commit is contained in:
Natsumi
2025-08-16 02:45:55 +12:00
parent 90c6422418
commit b3c58a8c08
11 changed files with 204 additions and 65 deletions

View File

@@ -413,9 +413,7 @@
<div v-for="room in groupDialog.instances" :key="room.tag" style="width: 100%">
<div style="margin: 5px 0">
<Location :location="room.tag" style="display: inline-block" />
<el-tooltip placement="top" content="Invite yourself" :disabled="hideTooltips">
<InviteYourself :location="room.tag" style="margin-left: 5px" />
</el-tooltip>
<InviteYourself :location="room.tag" style="margin-left: 5px" />
<el-tooltip placement="top" content="Refresh player count" :disabled="hideTooltips">
<el-button
size="mini"

View File

@@ -66,13 +66,31 @@
@click="showInviteDialog(launchDialog.location)">
{{ t('dialog.launch.invite') }}
</el-button>
<el-button
type="primary"
size="small"
:disabled="!launchDialog.secureOrShortName"
@click="handleLaunchGame(launchDialog.location, launchDialog.shortName, launchDialog.desktop)">
{{ t('dialog.launch.launch') }}
</el-button>
<template v-if="isGameRunning">
<el-button
type="default"
size="small"
:disabled="!launchDialog.secureOrShortName"
@click="handleLaunchGame(launchDialog.location, launchDialog.shortName, launchDialog.desktop)">
{{ t('dialog.launch.launch') }}
</el-button>
<el-button
type="primary"
size="small"
:disabled="!launchDialog.secureOrShortName"
@click="handleAttachGame(launchDialog.location, launchDialog.shortName)">
{{ t('dialog.launch.open_ingame') }}
</el-button>
</template>
<template v-else>
<el-button
type="primary"
size="small"
:disabled="!launchDialog.secureOrShortName"
@click="handleLaunchGame(launchDialog.location, launchDialog.shortName, launchDialog.desktop)">
{{ t('dialog.launch.launch') }}
</el-button>
</template>
</template>
<InviteDialog :invite-dialog="inviteDialog" @closeInviteDialog="closeInviteDialog" />
</safe-dialog>
@@ -88,6 +106,7 @@
import {
useAppearanceSettingsStore,
useFriendStore,
useGameStore,
useInstanceStore,
useLaunchStore,
useLocationStore
@@ -100,9 +119,10 @@
const { friends } = storeToRefs(useFriendStore());
const { hideTooltips } = storeToRefs(useAppearanceSettingsStore());
const { lastLocation } = storeToRefs(useLocationStore());
const { launchGame } = useLaunchStore();
const { launchGame, tryOpenInstanceInVrc } = useLaunchStore();
const { launchDialogData } = storeToRefs(useLaunchStore());
const { showPreviousInstancesInfoDialog } = useInstanceStore();
const { isGameRunning } = storeToRefs(useGameStore());
const launchDialogRef = ref(null);
@@ -180,6 +200,10 @@
launchGame(location, shortName, desktop);
isVisible.value = false;
}
function handleAttachGame(location, shortName) {
tryOpenInstanceInVrc(location, shortName);
isVisible.value = false;
}
function getConfig() {
configRepository.getBool('launchAsDesktop').then((value) => (launchDialog.value.desktop = value));
}

View File

@@ -568,15 +568,10 @@
<div style="flex: none">
<template v-if="isRealInstance(userDialog.$location.tag)">
<Launch :location="userDialog.$location.tag" />
<el-tooltip
placement="top"
:content="t('dialog.user.info.self_invite_tooltip')"
:disabled="hideTooltips">
<InviteYourself
:location="userDialog.$location.tag"
:shortname="userDialog.$location.shortName"
style="margin-left: 5px" />
</el-tooltip>
<InviteYourself
:location="userDialog.$location.tag"
:shortname="userDialog.$location.shortName"
style="margin-left: 5px" />
<el-tooltip
placement="top"
:content="t('dialog.user.info.refresh_instance_info')"

View File

@@ -348,15 +348,10 @@
:currentuserid="currentUser.id"
:worlddialogshortname="worldDialog.$location.shortName" />
<Launch :location="room.tag" style="margin-left: 5px" />
<el-tooltip
placement="top"
:content="t('dialog.world.instances.self_invite_tooltip')"
:disabled="hideTooltips">
<InviteYourself
:location="room.$location.tag"
:shortname="room.$location.shortName"
style="margin-left: 5px" />
</el-tooltip>
<InviteYourself
:location="room.$location.tag"
:shortname="room.$location.shortName"
style="margin-left: 5px" />
<el-tooltip
placement="top"
:content="t('dialog.world.instances.refresh_instance_info')"