mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-24 09:13:50 +02:00
feat: add option to prioritize same instance friends in sidebar (#1238)
This commit is contained in:
@@ -76,6 +76,12 @@
|
||||
:model-value="isHideFriendsInSameInstance"
|
||||
@update:modelValue="setIsHideFriendsInSameInstance" />
|
||||
</Field>
|
||||
<Field v-if="isSidebarGroupByInstance" orientation="horizontal">
|
||||
<FieldLabel>{{ t('side_panel.settings.same_instance_above_favorites') }}</FieldLabel>
|
||||
<Switch
|
||||
:model-value="isSameInstanceAboveFavorites"
|
||||
@update:modelValue="setIsSameInstanceAboveFavorites" />
|
||||
</Field>
|
||||
<Field orientation="horizontal">
|
||||
<FieldLabel>{{ t('side_panel.settings.split_favorite_friends') }}</FieldLabel>
|
||||
<Switch
|
||||
@@ -322,6 +328,7 @@
|
||||
sidebarSortMethod3,
|
||||
isSidebarGroupByInstance,
|
||||
isHideFriendsInSameInstance,
|
||||
isSameInstanceAboveFavorites,
|
||||
isSidebarDivideByFriendGroup,
|
||||
sidebarFavoriteGroups
|
||||
} = storeToRefs(appearanceSettingsStore);
|
||||
@@ -331,6 +338,7 @@
|
||||
setSidebarSortMethod3,
|
||||
setIsSidebarGroupByInstance,
|
||||
setIsHideFriendsInSameInstance,
|
||||
setIsSameInstanceAboveFavorites,
|
||||
setIsSidebarDivideByFriendGroup,
|
||||
setSidebarFavoriteGroups
|
||||
} = appearanceSettingsStore;
|
||||
|
||||
@@ -253,6 +253,7 @@
|
||||
const {
|
||||
isSidebarGroupByInstance,
|
||||
isHideFriendsInSameInstance,
|
||||
isSameInstanceAboveFavorites,
|
||||
isSidebarDivideByFriendGroup,
|
||||
sidebarFavoriteGroups,
|
||||
sidebarFavoriteGroupOrder,
|
||||
@@ -403,23 +404,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
const virtualRows = computed(() => {
|
||||
const rows = [];
|
||||
|
||||
rows.push(
|
||||
buildToggleRow({
|
||||
key: 'me-header',
|
||||
label: t('side_panel.me'),
|
||||
expanded: isFriendsGroupMe.value,
|
||||
headerPadding: '0 0 5px',
|
||||
onClick: toggleFriendsGroupMe
|
||||
})
|
||||
);
|
||||
|
||||
if (isFriendsGroupMe.value) {
|
||||
rows.push({ type: 'me-item', key: `me:${currentUser.value?.id ?? 'me'}` });
|
||||
}
|
||||
|
||||
function buildFavoriteRows(rows) {
|
||||
const vipFriendCount = isSidebarDivideByFriendGroup.value
|
||||
? vipFriendsDivideByGroup.value.reduce((sum, group) => sum + group.length, 0)
|
||||
: visibleFavoriteOnlineFriends.value.length;
|
||||
@@ -476,7 +461,9 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function buildSameInstanceRows(rows) {
|
||||
if (isSidebarGroupByInstance.value && friendsInSameInstance.value.length) {
|
||||
rows.push(
|
||||
buildToggleRow({
|
||||
@@ -512,6 +499,32 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const virtualRows = computed(() => {
|
||||
const rows = [];
|
||||
|
||||
rows.push(
|
||||
buildToggleRow({
|
||||
key: 'me-header',
|
||||
label: t('side_panel.me'),
|
||||
expanded: isFriendsGroupMe.value,
|
||||
headerPadding: '0 0 5px',
|
||||
onClick: toggleFriendsGroupMe
|
||||
})
|
||||
);
|
||||
|
||||
if (isFriendsGroupMe.value) {
|
||||
rows.push({ type: 'me-item', key: `me:${currentUser.value?.id ?? 'me'}` });
|
||||
}
|
||||
|
||||
if (isSameInstanceAboveFavorites.value) {
|
||||
buildSameInstanceRows(rows);
|
||||
buildFavoriteRows(rows);
|
||||
} else {
|
||||
buildFavoriteRows(rows);
|
||||
buildSameInstanceRows(rows);
|
||||
}
|
||||
|
||||
if (onlineFriendsByGroupStatus.value.length) {
|
||||
rows.push(
|
||||
|
||||
Reference in New Issue
Block a user