mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-05 14:26:06 +02:00
feat: add breadcrumb components and main dialog layout functionality
This commit is contained in:
+27
-1
@@ -18,9 +18,12 @@ import { database } from '../service/database';
|
||||
import { useAdvancedSettingsStore } from './settings/advanced';
|
||||
import { useAvatarProviderStore } from './avatarProvider';
|
||||
import { useFavoriteStore } from './favorite';
|
||||
import { useGroupStore } from './group';
|
||||
import { useModalStore } from './modal';
|
||||
import { useUiStore } from './ui';
|
||||
import { useUserStore } from './user';
|
||||
import { useVRCXUpdaterStore } from './vrcxUpdater';
|
||||
import { useWorldStore } from './world';
|
||||
import { watchState } from '../service/watchState';
|
||||
|
||||
import webApiService from '../service/webapi';
|
||||
@@ -31,7 +34,10 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
||||
const vrcxUpdaterStore = useVRCXUpdaterStore();
|
||||
const advancedSettingsStore = useAdvancedSettingsStore();
|
||||
const userStore = useUserStore();
|
||||
const worldStore = useWorldStore();
|
||||
const groupStore = useGroupStore();
|
||||
const modalStore = useModalStore();
|
||||
const uiStore = useUiStore();
|
||||
const { t } = useI18n();
|
||||
|
||||
let cachedAvatarModerations = new Map();
|
||||
@@ -172,8 +178,22 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
||||
* @param {string} avatarId
|
||||
* @returns
|
||||
*/
|
||||
function showAvatarDialog(avatarId) {
|
||||
function showAvatarDialog(avatarId, options = {}) {
|
||||
const D = avatarDialog.value;
|
||||
if (
|
||||
!avatarDialog.value.visible &&
|
||||
!userStore.userDialog.visible &&
|
||||
!worldStore.worldDialog.visible &&
|
||||
!groupStore.groupDialog.visible
|
||||
) {
|
||||
uiStore.clearDialogCrumbs();
|
||||
}
|
||||
if (!options.skipBreadcrumb) {
|
||||
uiStore.pushDialogCrumb('avatar', avatarId);
|
||||
}
|
||||
userStore.userDialog.visible = false;
|
||||
worldStore.worldDialog.visible = false;
|
||||
groupStore.groupDialog.visible = false;
|
||||
D.visible = true;
|
||||
D.loading = true;
|
||||
D.id = avatarId;
|
||||
@@ -201,6 +221,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
||||
const ref2 = cachedAvatars.get(avatarId);
|
||||
if (typeof ref2 !== 'undefined') {
|
||||
D.ref = ref2;
|
||||
uiStore.setDialogCrumbLabel('avatar', D.id, D.ref?.name || D.id);
|
||||
updateVRChatAvatarCache();
|
||||
if (
|
||||
ref2.releaseStatus !== 'public' &&
|
||||
@@ -215,6 +236,11 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
||||
.then((args) => {
|
||||
const ref = applyAvatar(args.json);
|
||||
D.ref = ref;
|
||||
uiStore.setDialogCrumbLabel(
|
||||
'avatar',
|
||||
D.id,
|
||||
D.ref?.name || D.id
|
||||
);
|
||||
getAvatarGallery(avatarId);
|
||||
updateVRChatAvatarCache();
|
||||
if (/quest/.test(ref.tags)) {
|
||||
|
||||
Reference in New Issue
Block a user