mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-17 22:03:50 +02:00
canOpenInstanceInGame
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
<template>
|
||||
<div v-if="isVisible" :class="['inline-block']">
|
||||
<el-tooltip
|
||||
v-if="!canOpenInstanceInGame()"
|
||||
placement="top"
|
||||
:content="t('dialog.user.info.self_invite_tooltip')">
|
||||
<el-tooltip v-if="!canOpenInstanceInGame" placement="top" :content="t('dialog.user.info.self_invite_tooltip')">
|
||||
<el-button v-show="isVisible" @click="confirmInvite" size="small" :icon="Message" circle />
|
||||
</el-tooltip>
|
||||
<el-tooltip v-else placement="top" :content="t('dialog.user.info.open_in_vrchat_tooltip')">
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
@click="showInviteDialog(launchDialog.location)">
|
||||
{{ t('dialog.launch.invite') }}
|
||||
</el-button>
|
||||
<template v-if="canOpenInstanceInGame()">
|
||||
<template v-if="canOpenInstanceInGame">
|
||||
<el-button
|
||||
:disabled="!launchDialog.secureOrShortName"
|
||||
@click="handleLaunchGame(launchDialog.location, launchDialog.shortName, launchDialog.desktop)">
|
||||
|
||||
@@ -417,7 +417,7 @@
|
||||
@click="showInviteDialog(newInstanceDialog.location)"
|
||||
>{{ t('dialog.new_instance.invite') }}</el-button
|
||||
>
|
||||
<template v-if="canOpenInstanceInGame()">
|
||||
<template v-if="canOpenInstanceInGame">
|
||||
<el-button @click="showLaunchDialog(newInstanceDialog.location, newInstanceDialog.shortName)">{{
|
||||
t('dialog.new_instance.launch')
|
||||
}}</el-button>
|
||||
@@ -454,7 +454,7 @@
|
||||
@click="showInviteDialog(newInstanceDialog.location)"
|
||||
>{{ t('dialog.new_instance.invite') }}</el-button
|
||||
>
|
||||
<template v-if="canOpenInstanceInGame()">
|
||||
<template v-if="canOpenInstanceInGame">
|
||||
<el-button @click="showLaunchDialog(newInstanceDialog.location, newInstanceDialog.shortName)">{{
|
||||
t('dialog.new_instance.launch')
|
||||
}}</el-button>
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :icon="Message" command="New Instance and Self Invite">
|
||||
{{
|
||||
canOpenInstanceInGame()
|
||||
canOpenInstanceInGame
|
||||
? t('dialog.world.actions.new_instance_and_open_ingame')
|
||||
: t('dialog.world.actions.new_instance_and_self_invite')
|
||||
}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ref, watch } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
@@ -71,6 +71,14 @@ export const useInviteStore = defineStore('Invite', () => {
|
||||
{ flush: 'sync' }
|
||||
);
|
||||
|
||||
const canOpenInstanceInGame = computed(() => {
|
||||
return (
|
||||
!LINUX &&
|
||||
gameStore.isGameRunning &&
|
||||
!advancedSettingsStore.selfInviteOverride
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {'message' | 'request' | 'response' | 'requestResponse'} mode
|
||||
@@ -99,14 +107,6 @@ export const useInviteStore = defineStore('Invite', () => {
|
||||
});
|
||||
}
|
||||
|
||||
function canOpenInstanceInGame() {
|
||||
return (
|
||||
!LINUX &&
|
||||
gameStore.isGameRunning &&
|
||||
!advancedSettingsStore.selfInviteOverride
|
||||
);
|
||||
}
|
||||
|
||||
function newInstanceSelfInvite(worldId) {
|
||||
instanceStore.createNewInstance(worldId).then((args) => {
|
||||
const location = args?.json?.location;
|
||||
@@ -122,7 +122,7 @@ export const useInviteStore = defineStore('Invite', () => {
|
||||
if (!L.isRealInstance) {
|
||||
return;
|
||||
}
|
||||
if (canOpenInstanceInGame()) {
|
||||
if (canOpenInstanceInGame.value) {
|
||||
const secureOrShortName =
|
||||
args.json.shortName || args.json.secureName;
|
||||
launchStore.tryOpenInstanceInVrc(location, secureOrShortName);
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<el-tooltip placement="left" :teleported="false">
|
||||
<template #content>
|
||||
{{
|
||||
canOpenInstanceInGame()
|
||||
canOpenInstanceInGame
|
||||
? t('dialog.world.actions.new_instance_and_open_ingame')
|
||||
: t('dialog.world.actions.new_instance_and_self_invite')
|
||||
}}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<el-tooltip placement="left">
|
||||
<template #content>
|
||||
{{
|
||||
canOpenInstanceInGame()
|
||||
canOpenInstanceInGame
|
||||
? t('dialog.world.actions.new_instance_and_open_ingame')
|
||||
: t('dialog.world.actions.new_instance_and_self_invite')
|
||||
}}
|
||||
|
||||
@@ -117,13 +117,13 @@
|
||||
:class="{ 'is-editing': editFavoritesMode }"
|
||||
style="margin-top: 10px">
|
||||
<el-scrollbar height="700px" @end-reached="worldFavoritesLoadMore">
|
||||
<FavoritesWorldItem
|
||||
<!-- <FavoritesWorldItem
|
||||
v-for="favorite in sliceWorldFavorites(group.key)"
|
||||
:key="favorite.id"
|
||||
:group="group"
|
||||
:favorite="favorite"
|
||||
@click="showWorldDialog(favorite.id)"
|
||||
@handle-select="favorite.$selected = $event" />
|
||||
@handle-select="favorite.$selected = $event" /> -->
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user