mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Keep instance when reopening world dialog
This commit is contained in:
@@ -1155,9 +1155,9 @@
|
|||||||
showChangeWorldImageDialog();
|
showChangeWorldImageDialog();
|
||||||
break;
|
break;
|
||||||
case 'Refresh':
|
case 'Refresh':
|
||||||
const worldId = D.id;
|
const { tag, shortName } = worldDialog.value.$location;
|
||||||
D.id = '';
|
D.id = '';
|
||||||
showWorldDialog(worldId);
|
showWorldDialog(tag, shortName);
|
||||||
break;
|
break;
|
||||||
case 'New Instance':
|
case 'New Instance':
|
||||||
showNewInstanceDialog(D.$location.tag);
|
showNewInstanceDialog(D.$location.tag);
|
||||||
|
|||||||
+18
-5
@@ -69,7 +69,8 @@ export const useUiStore = defineStore('Ui', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function pushDialogCrumb(type, id, label = '') {
|
function pushDialogCrumb(data) {
|
||||||
|
const { type, id, label } = data;
|
||||||
if (!type || !id) {
|
if (!type || !id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -91,7 +92,10 @@ export const useUiStore = defineStore('Ui', () => {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
items.push({ type, id, label: label || id });
|
if (!data.label) {
|
||||||
|
data.label = data.id;
|
||||||
|
}
|
||||||
|
items.push(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setDialogCrumbLabel(type, id, label) {
|
function setDialogCrumbLabel(type, id, label) {
|
||||||
@@ -135,7 +139,7 @@ export const useUiStore = defineStore('Ui', () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (item.type === 'world') {
|
if (item.type === 'world') {
|
||||||
worldStore.showWorldDialog(item.id, null);
|
worldStore.showWorldDialog(item.tag, item.shortName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (item.type === 'avatar') {
|
if (item.type === 'avatar') {
|
||||||
@@ -187,7 +191,16 @@ export const useUiStore = defineStore('Ui', () => {
|
|||||||
clearDialogCrumbs();
|
clearDialogCrumbs();
|
||||||
}
|
}
|
||||||
|
|
||||||
function openDialog({ type, id, label = '' }) {
|
/**
|
||||||
|
* @param {Object} data
|
||||||
|
* @param {string} data.type
|
||||||
|
* @param {string} data.id
|
||||||
|
* @param {string?} data.tag
|
||||||
|
* @param {string?} data.shortName
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
function openDialog(data) {
|
||||||
|
const { type } = data;
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const worldStore = useWorldStore();
|
const worldStore = useWorldStore();
|
||||||
const avatarStore = useAvatarStore();
|
const avatarStore = useAvatarStore();
|
||||||
@@ -229,7 +242,7 @@ export const useUiStore = defineStore('Ui', () => {
|
|||||||
if (!hadActiveDialog) {
|
if (!hadActiveDialog) {
|
||||||
clearDialogCrumbs();
|
clearDialogCrumbs();
|
||||||
}
|
}
|
||||||
pushDialogCrumb(type, id, label);
|
pushDialogCrumb(data);
|
||||||
return hadActiveDialog;
|
return hadActiveDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -84,7 +84,9 @@ export const useWorldStore = defineStore('World', () => {
|
|||||||
}
|
}
|
||||||
const isMainDialogOpen = uiStore.openDialog({
|
const isMainDialogOpen = uiStore.openDialog({
|
||||||
type: 'world',
|
type: 'world',
|
||||||
id: L.worldId
|
id: L.worldId,
|
||||||
|
tag,
|
||||||
|
shortName
|
||||||
});
|
});
|
||||||
D.visible = true;
|
D.visible = true;
|
||||||
if (isMainDialogOpen && D.id === L.worldId) {
|
if (isMainDialogOpen && D.id === L.worldId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user