mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Sort by Private/GPS for aside and instance time for user/world dialog
This commit is contained in:
+62
-2
@@ -5107,16 +5107,24 @@ speechSynthesis.getVoices();
|
|||||||
$app.data.orderFriendsGroup1 = configRepository.getBool('orderFriendGroup1');
|
$app.data.orderFriendsGroup1 = configRepository.getBool('orderFriendGroup1');
|
||||||
$app.data.orderFriendsGroup2 = configRepository.getBool('orderFriendGroup2');
|
$app.data.orderFriendsGroup2 = configRepository.getBool('orderFriendGroup2');
|
||||||
$app.data.orderFriendsGroup3 = configRepository.getBool('orderFriendGroup3');
|
$app.data.orderFriendsGroup3 = configRepository.getBool('orderFriendGroup3');
|
||||||
|
$app.data.orderFriendsGroupPrivate = configRepository.getBool('orderFriendGroupPrivate');
|
||||||
|
$app.data.orderFriendsGroupGPS = configRepository.getBool('orderFriendGroupGPS');
|
||||||
var saveOrderFriendGroup = function () {
|
var saveOrderFriendGroup = function () {
|
||||||
configRepository.setBool('orderFriendGroup0', this.orderFriendsGroup0);
|
configRepository.setBool('orderFriendGroup0', this.orderFriendsGroup0);
|
||||||
configRepository.setBool('orderFriendGroup1', this.orderFriendsGroup1);
|
configRepository.setBool('orderFriendGroup1', this.orderFriendsGroup1);
|
||||||
configRepository.setBool('orderFriendGroup2', this.orderFriendsGroup2);
|
configRepository.setBool('orderFriendGroup2', this.orderFriendsGroup2);
|
||||||
configRepository.setBool('orderFriendGroup3', this.orderFriendsGroup3);
|
configRepository.setBool('orderFriendGroup3', this.orderFriendsGroup3);
|
||||||
|
configRepository.setBool('orderFriendGroupPrivate', this.orderFriendsGroupPrivate);
|
||||||
|
configRepository.setBool('orderFriendGroupGPS', this.orderFriendsGroupGPS);
|
||||||
|
this.sortFriendsGroup0 = true;
|
||||||
|
this.sortFriendsGroup1 = true;
|
||||||
};
|
};
|
||||||
$app.watch.orderFriendsGroup0 = saveOrderFriendGroup;
|
$app.watch.orderFriendsGroup0 = saveOrderFriendGroup;
|
||||||
$app.watch.orderFriendsGroup1 = saveOrderFriendGroup;
|
$app.watch.orderFriendsGroup1 = saveOrderFriendGroup;
|
||||||
$app.watch.orderFriendsGroup2 = saveOrderFriendGroup;
|
$app.watch.orderFriendsGroup2 = saveOrderFriendGroup;
|
||||||
$app.watch.orderFriendsGroup3 = saveOrderFriendGroup;
|
$app.watch.orderFriendsGroup3 = saveOrderFriendGroup;
|
||||||
|
$app.watch.orderFriendsGroupPrivate = saveOrderFriendGroup;
|
||||||
|
$app.watch.orderFriendsGroupGPS = saveOrderFriendGroup;
|
||||||
|
|
||||||
$app.methods.fetchActiveFriend = function (userId) {
|
$app.methods.fetchActiveFriend = function (userId) {
|
||||||
this.pendingActiveFriends.add(userId);
|
this.pendingActiveFriends.add(userId);
|
||||||
@@ -5494,6 +5502,9 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.updateFriendGPS = function (userId) {
|
$app.methods.updateFriendGPS = function (userId) {
|
||||||
|
if (!this.orderFriendsGroupGPS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var ctx = this.friends.get(userId);
|
var ctx = this.friends.get(userId);
|
||||||
if ((typeof ctx.ref !== 'undefined') &&
|
if ((typeof ctx.ref !== 'undefined') &&
|
||||||
(ctx.ref.location !== 'private') &&
|
(ctx.ref.location !== 'private') &&
|
||||||
@@ -5547,14 +5558,46 @@ speechSynthesis.getVoices();
|
|||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// private
|
||||||
|
var compareByPrivate = function (a, b) {
|
||||||
|
if ((typeof a.ref === 'undefined') || (typeof b.ref === 'undefined')) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ((a.ref.location === 'private') && (b.ref.location === 'private')) {
|
||||||
|
return 0;
|
||||||
|
} else if (a.ref.location === 'private') {
|
||||||
|
return 1;
|
||||||
|
} else if (b.ref.location === 'private') {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
// location at
|
||||||
|
var compareByLocationAt = function (a, b) {
|
||||||
|
if (a.$location_at < b.$location_at) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (a.$location_at > b.$location_at) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
// VIP friends
|
// VIP friends
|
||||||
$app.computed.friendsGroup0 = function () {
|
$app.computed.friendsGroup0 = function () {
|
||||||
if (this.orderFriendsGroup0) {
|
if (this.orderFriendsGroup0) {
|
||||||
|
if (this.orderFriendsGroupPrivate) {
|
||||||
|
this.friendsGroupA_.sort(compareByPrivate);
|
||||||
|
}
|
||||||
return this.friendsGroupA_;
|
return this.friendsGroupA_;
|
||||||
}
|
}
|
||||||
if (this.sortFriendsGroup0) {
|
if (this.sortFriendsGroup0) {
|
||||||
this.sortFriendsGroup0 = false;
|
this.sortFriendsGroup0 = false;
|
||||||
this.friendsGroup0_.sort(compareByName);
|
this.friendsGroup0_.sort(compareByName);
|
||||||
|
if (this.orderFriendsGroupPrivate) {
|
||||||
|
this.friendsGroup0_.sort(compareByPrivate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return this.friendsGroup0_;
|
return this.friendsGroup0_;
|
||||||
};
|
};
|
||||||
@@ -5562,11 +5605,17 @@ speechSynthesis.getVoices();
|
|||||||
// Online friends
|
// Online friends
|
||||||
$app.computed.friendsGroup1 = function () {
|
$app.computed.friendsGroup1 = function () {
|
||||||
if (this.orderFriendsGroup1) {
|
if (this.orderFriendsGroup1) {
|
||||||
|
if (this.orderFriendsGroupPrivate) {
|
||||||
|
this.friendsGroupB_.sort(compareByPrivate);
|
||||||
|
}
|
||||||
return this.friendsGroupB_;
|
return this.friendsGroupB_;
|
||||||
}
|
}
|
||||||
if (this.sortFriendsGroup1) {
|
if (this.sortFriendsGroup1) {
|
||||||
this.sortFriendsGroup1 = false;
|
this.sortFriendsGroup1 = false;
|
||||||
this.friendsGroup1_.sort(compareByName);
|
this.friendsGroup1_.sort(compareByName);
|
||||||
|
if (this.orderFriendsGroupPrivate) {
|
||||||
|
this.friendsGroup1_.sort(compareByPrivate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return this.friendsGroup1_;
|
return this.friendsGroup1_;
|
||||||
};
|
};
|
||||||
@@ -8236,7 +8285,7 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
users.sort(compareByDisplayName);
|
users.sort(compareByLocationAt);
|
||||||
D.users = users;
|
D.users = users;
|
||||||
if (!L.worldId) {
|
if (!L.worldId) {
|
||||||
return;
|
return;
|
||||||
@@ -8856,9 +8905,20 @@ speechSynthesis.getVoices();
|
|||||||
L.user = ref;
|
L.user = ref;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
instance.users.sort(compareByDisplayName);
|
instance.users.sort(compareByLocationAt);
|
||||||
rooms.push(instance);
|
rooms.push(instance);
|
||||||
}
|
}
|
||||||
|
// reuse instance occupants from getInstance
|
||||||
|
for (var room of rooms) {
|
||||||
|
if (room.occupants === 0) {
|
||||||
|
for (var instance of D.rooms) {
|
||||||
|
if (instance.id === room.id) {
|
||||||
|
room.occupants = instance.occupants;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// sort by more friends, occupants
|
// sort by more friends, occupants
|
||||||
rooms.sort(function (a, b) {
|
rooms.sort(function (a, b) {
|
||||||
return b.users.length - a.users.length ||
|
return b.users.length - a.users.length ||
|
||||||
|
|||||||
@@ -763,6 +763,12 @@ html
|
|||||||
el-switch(v-model="displayVRCPlusIconsAsAvatar")
|
el-switch(v-model="displayVRCPlusIconsAsAvatar")
|
||||||
div.options-container
|
div.options-container
|
||||||
span.header Side Pannel Sorting Options
|
span.header Side Pannel Sorting Options
|
||||||
|
div.options-container-item
|
||||||
|
span.name Sort Private to bottom
|
||||||
|
el-switch(v-model="orderFriendsGroupPrivate")
|
||||||
|
div.options-container-item
|
||||||
|
span.name Sort GPS to top
|
||||||
|
el-switch(v-model="orderFriendsGroupGPS")
|
||||||
div.options-container-item
|
div.options-container-item
|
||||||
span.name VIP
|
span.name VIP
|
||||||
el-switch(v-model="orderFriendsGroup0" inactive-text="by name" active-text="by state")
|
el-switch(v-model="orderFriendsGroup0" inactive-text="by name" active-text="by state")
|
||||||
|
|||||||
Reference in New Issue
Block a user