mirror of
https://github.com/vrcx-team/VRCX.git
synced 2026-04-06 00:32:02 +02:00
change start mode checkbox to split-button (#1550)
This commit is contained in:
@@ -53,12 +53,6 @@
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-checkbox
|
||||
v-model="launchDialog.desktop"
|
||||
style="display: inline-flex; align-items: center; margin-top: 5px"
|
||||
@change="saveLaunchDialog">
|
||||
{{ t('dialog.launch.start_as_desktop') }}
|
||||
</el-checkbox>
|
||||
<template #footer>
|
||||
<el-button
|
||||
:disabled="!checkCanInvite(launchDialog.location)"
|
||||
@@ -68,7 +62,7 @@
|
||||
<template v-if="canOpenInstanceInGame">
|
||||
<el-button
|
||||
:disabled="!launchDialog.secureOrShortName"
|
||||
@click="handleLaunchGame(launchDialog.location, launchDialog.shortName, launchDialog.desktop)">
|
||||
@click="handleLaunchGame(launchDialog.location, launchDialog.shortName, false)">
|
||||
{{ t('dialog.launch.launch') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -80,16 +74,30 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button
|
||||
class="mr-1.25"
|
||||
:disabled="!launchDialog.secureOrShortName"
|
||||
@click="selfInvite(launchDialog.location, launchDialog.shortName)">
|
||||
{{ t('dialog.launch.self_invite') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
<el-dropdown
|
||||
split-button
|
||||
type="primary"
|
||||
:disabled="!launchDialog.secureOrShortName"
|
||||
@click="handleLaunchGame(launchDialog.location, launchDialog.shortName, launchDialog.desktop)">
|
||||
{{ t('dialog.launch.launch') }}
|
||||
</el-button>
|
||||
@click="handleLaunchDefault(launchDialog.location, launchDialog.shortName)"
|
||||
@command="(cmd) => handleLaunchCommand(cmd, launchDialog.location, launchDialog.shortName)">
|
||||
{{ launchModeLabel }}
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item :command="launchDialog.desktop ? 'vr' : 'desktop'">
|
||||
{{
|
||||
launchDialog.desktop
|
||||
? t('dialog.launch.launch')
|
||||
: t('dialog.launch.start_as_desktop')
|
||||
}}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</template>
|
||||
<InviteDialog :invite-dialog="inviteDialog" @closeInviteDialog="closeInviteDialog" />
|
||||
@@ -118,9 +126,13 @@
|
||||
const { launchGame, tryOpenInstanceInVrc } = useLaunchStore();
|
||||
const { launchDialogData } = storeToRefs(useLaunchStore());
|
||||
|
||||
const { canOpenInstanceInGame } = useInviteStore();
|
||||
const { canOpenInstanceInGame } = storeToRefs(useInviteStore());
|
||||
const { isGameRunning } = storeToRefs(useGameStore());
|
||||
|
||||
const launchModeLabel = computed(() =>
|
||||
launchDialog.value.desktop ? t('dialog.launch.start_as_desktop') : t('dialog.launch.launch')
|
||||
);
|
||||
|
||||
const launchDialogIndex = ref(2000);
|
||||
|
||||
const launchDialog = ref({
|
||||
@@ -212,6 +224,17 @@
|
||||
launchGame(location, shortName, desktop);
|
||||
isVisible.value = false;
|
||||
}
|
||||
|
||||
function handleLaunchDefault(location, shortName) {
|
||||
handleLaunchGame(location, shortName, launchDialog.value.desktop);
|
||||
}
|
||||
|
||||
function handleLaunchCommand(command, location, shortName) {
|
||||
const desktop = command === 'desktop';
|
||||
launchDialog.value.desktop = desktop;
|
||||
configRepository.setBool('launchAsDesktop', desktop);
|
||||
handleLaunchGame(location, shortName, desktop);
|
||||
}
|
||||
function handleAttachGame(location, shortName) {
|
||||
tryOpenInstanceInVrc(location, shortName);
|
||||
isVisible.value = false;
|
||||
@@ -235,12 +258,10 @@
|
||||
return args;
|
||||
});
|
||||
}
|
||||
|
||||
function getConfig() {
|
||||
configRepository.getBool('launchAsDesktop').then((value) => (launchDialog.value.desktop = value));
|
||||
}
|
||||
function saveLaunchDialog() {
|
||||
configRepository.setBool('launchAsDesktop', launchDialog.value.desktop);
|
||||
}
|
||||
async function initLaunchDialog() {
|
||||
const { tag, shortName } = launchDialogData.value;
|
||||
if (!isRealInstance(tag)) {
|
||||
|
||||
@@ -1526,9 +1526,9 @@
|
||||
"short_url_notice": "Short URL's expire after a set period of time",
|
||||
"location": "Location",
|
||||
"copy_tooltip": "Copy to clipboard",
|
||||
"start_as_desktop": "Start as Desktop (No VR)",
|
||||
"start_as_desktop": "Launch (Desktop)",
|
||||
"invite": "Invite",
|
||||
"launch": "Launch",
|
||||
"launch": "Launch (VR)",
|
||||
"open_ingame": "Open in-game",
|
||||
"self_invite": "Self invite",
|
||||
"game_running_warning": "Are you sure you want to launch a second VRChat instance?",
|
||||
|
||||
@@ -1381,9 +1381,9 @@
|
||||
"short_url_notice": "短縮URLは一定時間後に失効します。",
|
||||
"location": "場所",
|
||||
"copy_tooltip": "クリップボードにコピー",
|
||||
"start_as_desktop": "デスクトップモードで起動 (VR無し)",
|
||||
"start_as_desktop": "起動(デスクトップモード)",
|
||||
"invite": "招待",
|
||||
"launch": "起動",
|
||||
"launch": "起動(VRモード)",
|
||||
"open_ingame": "ゲーム内で開く",
|
||||
"self_invite": "自分を招待",
|
||||
"game_running_warning": "本当に2つ目のVRChatインスタンスを起動しますか?",
|
||||
|
||||
@@ -1482,9 +1482,9 @@
|
||||
"short_url_notice": "短链接会在一段时间后过期",
|
||||
"location": "地点",
|
||||
"copy_tooltip": "复制到剪贴板",
|
||||
"start_as_desktop": "以桌面模式启动游戏(不使用 VR)",
|
||||
"start_as_desktop": "启动(桌面模式)",
|
||||
"invite": "邀请",
|
||||
"launch": "启动",
|
||||
"launch": "启动(VR模式)",
|
||||
"open_ingame": "在 VRChat 中打开",
|
||||
"self_invite": "自我邀请",
|
||||
"game_running_warning": "你确定要启动另一个 VRChat 客户端吗?",
|
||||
|
||||
@@ -1467,9 +1467,9 @@
|
||||
"short_url_notice": "短網址會在一段時間後過期",
|
||||
"location": "地點",
|
||||
"copy_tooltip": "複製到剪貼簿",
|
||||
"start_as_desktop": "以桌面模式啟動(無 VR)",
|
||||
"start_as_desktop": "啟動(桌面模式)",
|
||||
"invite": "邀請",
|
||||
"launch": "啟動",
|
||||
"launch": "啟動(VR模式)",
|
||||
"open_ingame": "於遊戲中開啟",
|
||||
"self_invite": "自我邀請",
|
||||
"game_running_warning": "你確定要啟動第二個 VRChat 房間嗎?",
|
||||
|
||||
Reference in New Issue
Block a user