diff --git a/html/src/app.js b/html/src/app.js index 97ff69a5..3e9bc0ab 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -4247,7 +4247,7 @@ speechSynthesis.getVoices(); } if ( - args.params.type === 'friend' && + args.params.type === 'friend' && $app.localFavoriteFriendsGroups.includes( 'friend:' + args.params.tags ) @@ -8972,24 +8972,20 @@ speechSynthesis.getVoices(); $app.data.pendingActiveFriends = new Set(); $app.data.friendsNo = 0; $app.data.isFriendsGroupMe = true; - $app.data.isFriendsGroup0 = true; - $app.data.isFriendsGroup1 = true; - $app.data.isFriendsGroup2 = true; - $app.data.isFriendsGroup3 = false; + $app.data.isVIPFriends = true; + $app.data.isOnlineFriends = true; + $app.data.isActiveFriends = true; + $app.data.isOfflineFriends = false; $app.data.isGroupInstances = false; $app.data.groupInstances = []; - $app.data.friendsGroup0_ = []; - $app.data.friendsGroup1_ = []; - $app.data.friendsGroup2_ = []; - $app.data.friendsGroup3_ = []; - $app.data.friendsGroupA_ = []; - $app.data.friendsGroupB_ = []; - $app.data.friendsGroupC_ = []; - $app.data.friendsGroupD_ = []; - $app.data.sortFriendsGroup0 = false; - $app.data.sortFriendsGroup1 = false; - $app.data.sortFriendsGroup2 = false; - $app.data.sortFriendsGroup3 = false; + $app.data.vipFriends_ = []; + $app.data.onlineFriends_ = []; + $app.data.activeFriends_ = []; + $app.data.offlineFriends_ = []; + $app.data.sortVIPFriends = false; + $app.data.sortOnlineFriends = false; + $app.data.sortActiveFriends = false; + $app.data.sortOfflineFriends = false; $app.methods.saveFriendsGroupStates = async function () { await configRepository.setBool( @@ -8998,19 +8994,19 @@ speechSynthesis.getVoices(); ); await configRepository.setBool( 'VRCX_isFriendsGroupFavorites', - this.isFriendsGroup0 + this.isVIPFriends ); await configRepository.setBool( 'VRCX_isFriendsGroupOnline', - this.isFriendsGroup1 + this.isOnlineFriends ); await configRepository.setBool( 'VRCX_isFriendsGroupActive', - this.isFriendsGroup2 + this.isActiveFriends ); await configRepository.setBool( 'VRCX_isFriendsGroupOffline', - this.isFriendsGroup3 + this.isOfflineFriends ); }; @@ -9019,19 +9015,19 @@ speechSynthesis.getVoices(); 'VRCX_isFriendsGroupMe', true ); - this.isFriendsGroup0 = await configRepository.getBool( + this.isVIPFriends = await configRepository.getBool( 'VRCX_isFriendsGroupFavorites', true ); - this.isFriendsGroup1 = await configRepository.getBool( + this.isOnlineFriends = await configRepository.getBool( 'VRCX_isFriendsGroupOnline', true ); - this.isFriendsGroup2 = await configRepository.getBool( + this.isActiveFriends = await configRepository.getBool( 'VRCX_isFriendsGroupActive', false ); - this.isFriendsGroup3 = await configRepository.getBool( + this.isOfflineFriends = await configRepository.getBool( 'VRCX_isFriendsGroupOffline', false ); @@ -9082,22 +9078,18 @@ speechSynthesis.getVoices(); $app.friends.clear(); $app.pendingActiveFriends.clear(); $app.friendsNo = 0; - $app.isFriendsGroup0 = true; - $app.isFriendsGroup1 = true; - $app.isFriendsGroup2 = true; - $app.isFriendsGroup3 = false; - $app.friendsGroup0_ = []; - $app.friendsGroup1_ = []; - $app.friendsGroup2_ = []; - $app.friendsGroup3_ = []; - $app.friendsGroupA_ = []; - $app.friendsGroupB_ = []; - $app.friendsGroupC_ = []; - $app.friendsGroupD_ = []; - $app.sortFriendsGroup0 = false; - $app.sortFriendsGroup1 = false; - $app.sortFriendsGroup2 = false; - $app.sortFriendsGroup3 = false; + $app.isVIPFriends = true; + $app.isOnlineFriends = true; + $app.isActiveFriends = true; + $app.isOfflineFriends = false; + $app.vipFriends_ = []; + $app.onlineFriends_ = []; + $app.activeFriends_ = []; + $app.offlineFriends_ = []; + $app.sortVIPFriends = false; + $app.sortOnlineFriends = false; + $app.sortActiveFriends = false; + $app.sortOfflineFriends = false; }); API.$on('USER:CURRENT', function (args) { @@ -9137,9 +9129,9 @@ speechSynthesis.getVoices(); // If we just got user less then 1 min before code call, don't call it again if ($app.nextCurrentUserRefresh < 720) { - await API.getCurrentUser().catch((err) => { - console.error(err); - }); + await API.getCurrentUser().catch((err) => { + console.error(err); + }); } await API.refreshFriends(); API.reconnectWebSocket(); @@ -9213,22 +9205,18 @@ speechSynthesis.getVoices(); this.friends.set(id, ctx); if (ctx.state === 'online') { if (ctx.isVIP) { - this.friendsGroup0_.push(ctx); - this.friendsGroupA_.unshift(ctx); - this.sortFriendsGroup0 = true; + this.vipFriends_.push(ctx); + this.sortVIPFriends = true; } else { - this.friendsGroup1_.push(ctx); - this.friendsGroupB_.unshift(ctx); - this.sortFriendsGroup1 = true; + this.onlineFriends_.push(ctx); + this.sortOnlineFriends = true; } } else if (ctx.state === 'active') { - this.friendsGroup2_.push(ctx); - this.friendsGroupC_.unshift(ctx); - this.sortFriendsGroup2 = true; + this.activeFriends_.push(ctx); + this.sortActiveFriends = true; } else { - this.friendsGroup3_.push(ctx); - this.friendsGroupD_.unshift(ctx); - this.sortFriendsGroup3 = true; + this.offlineFriends_.push(ctx); + this.sortOfflineFriends = true; } }; @@ -9240,18 +9228,14 @@ speechSynthesis.getVoices(); this.friends.delete(id); if (ctx.state === 'online') { if (ctx.isVIP) { - removeFromArray(this.friendsGroup0_, ctx); - removeFromArray(this.friendsGroupA_, ctx); + removeFromArray(this.vipFriends_, ctx); } else { - removeFromArray(this.friendsGroup1_, ctx); - removeFromArray(this.friendsGroupB_, ctx); + removeFromArray(this.onlineFriends_, ctx); } } else if (ctx.state === 'active') { - removeFromArray(this.friendsGroup2_, ctx); - removeFromArray(this.friendsGroupC_, ctx); + removeFromArray(this.activeFriends_, ctx); } else { - removeFromArray(this.friendsGroup3_, ctx); - removeFromArray(this.friendsGroupD_, ctx); + removeFromArray(this.offlineFriends_, ctx); } }; @@ -9329,37 +9313,23 @@ speechSynthesis.getVoices(); }); } if (ctx.isVIP) { - removeFromArray(this.friendsGroupA_, ctx); - this.friendsGroupA_.unshift(ctx); - this.sortFriendsGroup0 = true; + this.sortVIPFriends = true; } else { - removeFromArray(this.friendsGroupB_, ctx); - this.friendsGroupB_.unshift(ctx); - this.sortFriendsGroup0 = true; + this.sortOnlineFriends = true; } - } else if (ctx.state === 'active') { - removeFromArray(this.friendsGroupC_, ctx); - this.friendsGroupC_.push(ctx); - } else { - removeFromArray(this.friendsGroupD_, ctx); - this.friendsGroupD_.push(ctx); } } if (ctx.isVIP !== isVIP) { ctx.isVIP = isVIP; if (ctx.state === 'online') { if (ctx.isVIP) { - removeFromArray(this.friendsGroup1_, ctx); - removeFromArray(this.friendsGroupB_, ctx); - this.friendsGroup0_.push(ctx); - this.friendsGroupA_.unshift(ctx); - this.sortFriendsGroup0 = true; + removeFromArray(this.onlineFriends_, ctx); + this.vipFriends_.push(ctx); + this.sortVIPFriends = true; } else { - removeFromArray(this.friendsGroup0_, ctx); - removeFromArray(this.friendsGroupA_, ctx); - this.friendsGroup1_.push(ctx); - this.friendsGroupB_.unshift(ctx); - this.sortFriendsGroup1 = true; + removeFromArray(this.vipFriends_, ctx); + this.onlineFriends_.push(ctx); + this.sortOnlineFriends = true; } } } @@ -9367,14 +9337,14 @@ speechSynthesis.getVoices(); ctx.name = ref.displayName; if (ctx.state === 'online') { if (ctx.isVIP) { - this.sortFriendsGroup0 = true; + this.sortVIPFriends = true; } else { - this.sortFriendsGroup1 = true; + this.sortOnlineFriends = true; } } else if (ctx.state === 'active') { - this.sortFriendsGroup2 = true; + this.sortActiveFriends = true; } else { - this.sortFriendsGroup3 = true; + this.sortOfflineFriends = true; } } // FIXME: 도배 가능성 있음 @@ -9490,6 +9460,9 @@ speechSynthesis.getVoices(); ctx.ref.$online_for = ''; ctx.ref.$offline_for = Date.now(); ctx.ref.$active_for = ''; + if (newState === 'active') { + ctx.ref.$active_for = Date.now(); + } var ts = Date.now(); var time = ts - $location_at; var worldName = await this.getWorldName(location); @@ -9537,37 +9510,29 @@ speechSynthesis.getVoices(); } if (ctx.state === 'online') { if (ctx.isVIP) { - removeFromArray(this.friendsGroup0_, ctx); - removeFromArray(this.friendsGroupA_, ctx); + removeFromArray(this.vipFriends_, ctx); } else { - removeFromArray(this.friendsGroup1_, ctx); - removeFromArray(this.friendsGroupB_, ctx); + removeFromArray(this.onlineFriends_, ctx); } } else if (ctx.state === 'active') { - removeFromArray(this.friendsGroup2_, ctx); - removeFromArray(this.friendsGroupC_, ctx); + removeFromArray(this.activeFriends_, ctx); } else { - removeFromArray(this.friendsGroup3_, ctx); - removeFromArray(this.friendsGroupD_, ctx); + removeFromArray(this.offlineFriends_, ctx); } if (newState === 'online') { if (isVIP) { - this.friendsGroup0_.push(ctx); - this.friendsGroupA_.unshift(ctx); - this.sortFriendsGroup0 = true; + this.vipFriends_.push(ctx); + this.sortVIPFriends = true; } else { - this.friendsGroup1_.push(ctx); - this.friendsGroupB_.unshift(ctx); - this.sortFriendsGroup1 = true; + this.onlineFriends_.push(ctx); + this.sortOnlineFriends = true; } } else if (newState === 'active') { - this.friendsGroup2_.push(ctx); - this.friendsGroupC_.unshift(ctx); - this.sortFriendsGroup2 = true; + this.activeFriends_.push(ctx); + this.sortActiveFriends = true; } else { - this.friendsGroup3_.push(ctx); - this.friendsGroupD_.unshift(ctx); - this.sortFriendsGroup3 = true; + this.offlineFriends_.push(ctx); + this.sortOfflineFriends = true; } if (ctx.state !== newState) { this.updateOnlineFriendCoutner(); @@ -9616,31 +9581,18 @@ speechSynthesis.getVoices(); }; $app.methods.updateFriendGPS = function (userId) { - if (!this.orderFriendsGroupGPS) { - if (this.orderFriendsGroupPrivate || this.orderFriendsGroupStatus) { - this.sortFriendsGroup0 = true; - this.sortFriendsGroup1 = true; - } - return; - } var ctx = this.friends.get(userId); - if (typeof ctx.ref !== 'undefined' && ctx.state === 'online') { - if (ctx.isVIP) { - removeFromArray(this.friendsGroupA_, ctx); - this.friendsGroupA_.unshift(ctx); - this.sortFriendsGroup1 = true; - } else { - removeFromArray(this.friendsGroupB_, ctx); - this.friendsGroupB_.unshift(ctx); - this.sortFriendsGroup0 = true; - } + if (ctx.isVIP) { + this.sortVIPFriends = true; + } else { + this.sortOnlineFriends = true; } }; $app.data.onlineFriendCount = 0; $app.methods.updateOnlineFriendCoutner = function () { var onlineFriendCount = - this.friendsGroup0.length + this.friendsGroup1.length; + this.vipFriends.length + this.onlineFriends.length; if (onlineFriendCount !== this.onlineFriendCount) { AppApi.ExecuteVrFeedFunction( 'updateOnlineFriendCount', @@ -9722,17 +9674,10 @@ speechSynthesis.getVoices(); return 0; }; - // status var compareByStatus = function (a, b) { if (typeof a.ref === 'undefined' || typeof b.ref === 'undefined') { return 0; } - if ( - $app.orderFriendsGroupPrivate && - (a.ref.location !== 'private' || b.ref.location !== 'private') - ) { - return 0; - } if (a.ref.status === b.ref.status) { return 0; } @@ -9742,10 +9687,6 @@ speechSynthesis.getVoices(); return $app.sortStatus(a.ref.status, b.ref.status); }; - $app.methods.sortByStatus = function (a, b, field) { - return this.sortStatus(a[field], b[field]); - }; - $app.methods.sortStatus = function (a, b) { switch (b) { case 'join me': @@ -9812,76 +9753,143 @@ speechSynthesis.getVoices(); return 0; }; + // location at but for the sidebar + var compareByLocation = function (a, b) { + if (typeof a.ref === 'undefined' || typeof b.ref === 'undefined') { + return 0; + } + + return a.ref.location.localeCompare(b.ref.location); + } + + var compareByActivityField = function (a, b, field) { + if (typeof a.ref === 'undefined' || typeof b.ref === 'undefined') { + return 0; + } + + // When the field is just and empty string, it means they've been + // in whatever active state for the longest + if (a.ref[field] < b.ref[field] || a.ref[field] !== '' && b.ref[field] === '') { + return 1; + } + if (a.ref[field] > b.ref[field] || a.ref[field] === '' && b.ref[field] !== '') { + return -1; + } + return 0; + } + + // online for + var compareByOnlineFor = function (a, b) { + return compareByActivityField(a, b, "$online_for"); + } + + // offline for + var compareByOfflineFor = function (a, b) { + return compareByActivityField(a, b, "$offline_for"); + } + + // active for + var compareByActiveFor = function (a, b) { + return compareByActivityField(a, b, "$active_for"); + } + + var getFriendsSortFunction = function (sortMethods) { + const sorts = []; + for (const sortMethod of sortMethods) { + switch (sortMethod) { + case "Sort Private to Bottom": + sorts.push(compareByPrivate); + break; + case "Sort by Status": + sorts.push(compareByStatus); + break; + case "Sort by Name": + sorts.push(compareByStatusAndPrivate); + break; + case "Sort by Online For": + sorts.push(compareByOnlineFor); + break; + case "Sort by Offline For": + sorts.push(compareByOfflineFor); + break; + case "Sort by Active For": + sorts.push(compareByActiveFor); + break; + case "Sort by Time in Instance": + sorts.push((a, b) => { + if (typeof a.ref === 'undefined' || typeof b.ref === 'undefined') { + return 0; + } + + return compareByLocationAt(a.ref, b.ref); + }); + break; + case "Sort by Location": + sorts.push(compareByLocation); + break; + case "None": + sorts.push(() => 0); + break; + } + } + + return (a, b) => { + let res; + for (const sort of sorts) { + res = sort(a, b); + if (res !== 0) { + return res; + } + } + return res; + } + } + // VIP friends - $app.computed.friendsGroup0 = function () { - if (this.orderFriendsGroup0) { - if (this.orderFriendsGroupPrivate) { - this.friendsGroupA_.sort(compareByPrivate); - } - if (this.orderFriendsGroupStatus) { - this.friendsGroupA_.sort(compareByStatus); - } - return this.friendsGroupA_; + $app.computed.vipFriends = function () { + if (!this.sortVIPFriends) { + return this.vipFriends_; } - if (this.sortFriendsGroup0) { - this.sortFriendsGroup0 = false; - this.friendsGroup0_.sort(compareByName); - if (this.orderFriendsGroupPrivate) { - this.friendsGroup0_.sort(compareByPrivate); - } - if (this.orderFriendsGroupStatus) { - this.friendsGroup0_.sort(compareByStatus); - } - } - return this.friendsGroup0_; + this.sortVIPFriends = false; + + this.vipFriends_.sort(getFriendsSortFunction(this.vipFriendsSortMethod)); + return this.vipFriends_; }; // Online friends - $app.computed.friendsGroup1 = function () { - if (this.orderFriendsGroup1) { - if (this.orderFriendsGroupPrivate) { - this.friendsGroupB_.sort(compareByPrivate); - } - if (this.orderFriendsGroupStatus) { - this.friendsGroupB_.sort(compareByStatus); - } - return this.friendsGroupB_; + $app.computed.onlineFriends = function () { + if (!this.sortOnlineFriends) { + return this.onlineFriends_; } - if (this.sortFriendsGroup1) { - this.sortFriendsGroup1 = false; - this.friendsGroup1_.sort(compareByName); - if (this.orderFriendsGroupPrivate) { - this.friendsGroup1_.sort(compareByPrivate); - } - if (this.orderFriendsGroupStatus) { - this.friendsGroup1_.sort(compareByStatus); - } - } - return this.friendsGroup1_; + this.sortOnlineFriends = false; + + this.onlineFriends_.sort(getFriendsSortFunction(this.onlineFriendsSortMethod)); + + return this.onlineFriends_; }; // Active friends - $app.computed.friendsGroup2 = function () { - if (this.orderFriendsGroup2) { - return this.friendsGroupC_; + $app.computed.activeFriends = function () { + if (!this.sortActiveFriends) { + return this.activeFriends_; } - if (this.sortFriendsGroup2) { - this.sortFriendsGroup2 = false; - this.friendsGroup2_.sort(compareByName); - } - return this.friendsGroup2_; + this.sortActiveFriends = false; + + this.activeFriends_.sort(getFriendsSortFunction(this.activeFriendsSortMethod)); + + return this.activeFriends_; }; // Offline friends - $app.computed.friendsGroup3 = function () { - if (this.orderFriendsGroup3) { - return this.friendsGroupD_; + $app.computed.offlineFriends = function () { + if (!this.sortOfflineFriends) { + return this.offlineFriends_; } - if (this.sortFriendsGroup3) { - this.sortFriendsGroup3 = false; - this.friendsGroup3_.sort(compareByName); - } - return this.friendsGroup3_; + this.sortOfflineFriends = false; + + this.offlineFriends_.sort(getFriendsSortFunction(this.offlineFriendsSortMethod)); + + return this.offlineFriends_; }; $app.methods.userStatusClass = function (user, pendingOffline) { @@ -15970,65 +15978,72 @@ speechSynthesis.getVoices(); this.vrcRegistryAutoBackup ); }; - $app.data.orderFriendsGroup0 = await configRepository.getBool( - 'orderFriendGroup0', - true - ); - $app.data.orderFriendsGroup1 = await configRepository.getBool( - 'orderFriendGroup1', - true - ); - $app.data.orderFriendsGroup2 = await configRepository.getBool( - 'orderFriendGroup2', - true - ); - $app.data.orderFriendsGroup3 = await configRepository.getBool( - 'orderFriendGroup3', - true - ); - $app.data.orderFriendsGroupPrivate = await configRepository.getBool( - 'orderFriendGroupPrivate', - false - ); - $app.data.orderFriendsGroupStatus = await configRepository.getBool( - 'orderFriendsGroupStatus', - false - ); - $app.data.orderFriendsGroupGPS = await configRepository.getBool( - 'orderFriendGroupGPS', - true + // TODO: FIX DEFAULTS BEFORE MEGNING PLS + $app.data.vipFriendsSortMethod = JSON.parse(await configRepository.getString( + 'vipFriendsSortMethod', + '["Default"]' + )); + $app.data.onlineFriendsSortMethod = JSON.parse(await configRepository.getString( + 'onlineFriendsSortMethod', + '["Default"]' + )); + $app.data.activeFriendsSortMethod = JSON.parse(await configRepository.getString( + 'activeFriendsSortMethod', + '["Default"]' + )); + $app.data.offlineFriendsSortMethod = JSON.parse(await configRepository.getString( + 'offlineFriendsSortMethod', + '["Default"]' + )); + + // Migrate old settings + // Assume all exist if one does + + // TODO: FIX THIS BEFORE MERGING PLS + const orderFriendsGroupPrivate = await configRepository.getBool( + 'orderFriendGroupPrivate' ); + if (orderFriendsGroupPrivate !== null) { + await configRepository.remove('orderFriendGroupPrivate'); + const orderFriendsGroupStatus = await configRepository.getBool( + 'orderFriendsGroupStatus' + ); + await configRepository.remove('orderFriendsGroupStatus'); + const orderFriendsGroupGPS = await configRepository.getBool( + 'orderFriendGroupGPS' + ); + await configRepository.remove('orderFriendGroupGPS'); + + if (orderFriendsGroupGPS) { + $app.data.onlineAndVIPFriendsSortMethod = "Sort by Location"; + } else if (orderFriendsGroupPrivate && orderFriendsGroupStatus) { + $app.data.onlineAndVIPFriendsSortMethod = "Sort by Status and Private to Bottom"; + } else if (orderFriendsGroupPrivate) { + $app.data.onlineAndVIPFriendsSortMethod = "Sort Private to Bottom"; + } else if (orderFriendsGroupStatus) { + $app.data.onlineAndVIPFriendsSortMethod = "Sort by Status" + } + } + $app.methods.saveOrderFriendGroup = async function () { - await configRepository.setBool( - 'orderFriendGroup0', - this.orderFriendsGroup0 + await configRepository.setString( + 'vipFriendsSortMethod', + JSON.stringify(this.vipFriendsSortMethod) ); - await configRepository.setBool( - 'orderFriendGroup1', - this.orderFriendsGroup1 + await configRepository.setString( + 'onlineFriendsSortMethod', + JSON.stringify(this.onlineFriendsSortMethod) ); - await configRepository.setBool( - 'orderFriendGroup2', - this.orderFriendsGroup2 + await configRepository.setString( + 'activeFriendsSortMethod', + JSON.stringify(this.activeFriendsSortMethod) ); - await configRepository.setBool( - 'orderFriendGroup3', - this.orderFriendsGroup3 + await configRepository.setString( + 'offlineFriendsSortMethod', + JSON.stringify(this.offlineFriendsSortMethod) ); - await configRepository.setBool( - 'orderFriendGroupPrivate', - this.orderFriendsGroupPrivate - ); - await configRepository.setBool( - 'orderFriendsGroupStatus', - this.orderFriendsGroupStatus - ); - await configRepository.setBool( - 'orderFriendGroupGPS', - this.orderFriendsGroupGPS - ); - this.sortFriendsGroup0 = true; - this.sortFriendsGroup1 = true; + this.sortVIPFriends = true; + this.sortOnlineFriends = true; }; $app.data.discordActive = await configRepository.getBool( 'discordActive', @@ -20232,7 +20247,7 @@ speechSynthesis.getVoices(); $app.methods.addFavoriteFriendsToInvite = function () { var D = this.inviteDialog; - for (var friend of this.friendsGroup0) { + for (var friend of this.vipFriends) { if (!D.userIds.includes(friend.id)) { D.userIds.push(friend.id); } @@ -21925,11 +21940,11 @@ speechSynthesis.getVoices(); $app.methods.userOnlineFor = function (ctx) { if (ctx.ref.state === 'online' && ctx.ref.$online_for) { - return Date.now() - ctx.ref.$online_for; + return timeToText(Date.now() - ctx.ref.$online_for); } else if (ctx.ref.state === 'active' && ctx.ref.$active_for) { - return Date.now() - ctx.ref.$active_for; + return timeToText(Date.now() - ctx.ref.$active_for); } else if (ctx.ref.$offline_for) { - return Date.now() - ctx.ref.$offline_for; + return timeToText(Date.now() - ctx.ref.$offline_for); } return '-'; }; @@ -28798,17 +28813,13 @@ speechSynthesis.getVoices(); continue; } if (ctx.isVIP) { - removeFromArray(this.friendsGroup1_, ctx); - removeFromArray(this.friendsGroupB_, ctx); - this.friendsGroup0_.push(ctx); - this.friendsGroupA_.unshift(ctx); - this.sortFriendsGroup0 = true; + removeFromArray(this.onlineFriends_, ctx); + this.vipFriends_.push(ctx); + this.sortVIPFriends = true; } else { - removeFromArray(this.friendsGroup0_, ctx); - removeFromArray(this.friendsGroupA_, ctx); - this.friendsGroup1_.push(ctx); - this.friendsGroupB_.unshift(ctx); - this.sortFriendsGroup1 = true; + removeFromArray(this.vipFriends_, ctx); + this.onlineFriends_.push(ctx); + this.sortOnlineFriends = true; } } }; diff --git a/html/src/index.pug b/html/src/index.pug index 4dca5012..fa053dad 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -127,11 +127,11 @@ html location.extra(v-if="isGameRunning && !gameLogDisabled" :location="lastLocation.location" :traveling="lastLocationDestination" :link="false") location.extra(v-else-if="isRealInstance(API.currentUser.$locationTag) || isRealInstance(API.currentUser.$travelingToLocation)" :location="API.currentUser.$locationTag" :traveling="API.currentUser.$travelingToLocation" :link="false") span.extra(v-else v-text="API.currentUser.statusDescription") - .x-friend-group.x-link(@click="isFriendsGroup0 = !isFriendsGroup0; saveFriendsGroupStates()" v-show="friendsGroup0.length") - i.el-icon-arrow-right(:class="{ rotate: isFriendsGroup0 }") - span(style="margin-left:5px") {{ $t('side_panel.favorite') }} ― {{ friendsGroup0.length }} - div(v-show="isFriendsGroup0") - .x-friend-item(v-for="friend in friendsGroup0" :key="friend.id" @click="showUserDialog(friend.id)") + .x-friend-group.x-link(@click="isVIPFriends = !isVIPFriends; saveFriendsGroupStates()" v-show="vipFriends.length") + i.el-icon-arrow-right(:class="{ rotate: isVIPFriends }") + span(style="margin-left:5px") {{ $t('side_panel.favorite') }} ― {{ vipFriends.length }} + div(v-show="isVIPFriends") + .x-friend-item(v-for="friend in vipFriends" :key="friend.id" @click="showUserDialog(friend.id)") template(v-if="friend.ref") .avatar(:class="userStatusClass(friend.ref, friend.pendingOffline)") img(v-lazy="userImage(friend.ref)") @@ -143,11 +143,11 @@ html template(v-else) span(v-text="friend.name || friend.id") el-button(type="text" icon="el-icon-close" size="mini" @click.stop="confirmDeleteFriend(friend.id)" style="margin-left:5px") - .x-friend-group.x-link(@click="isFriendsGroup1 = !isFriendsGroup1; saveFriendsGroupStates()" v-show="friendsGroup1.length") - i.el-icon-arrow-right(:class="{ rotate: isFriendsGroup1 }") - span(style="margin-left:5px") {{ $t('side_panel.online') }} ― {{ friendsGroup1.length }} - div(v-show="isFriendsGroup1") - .x-friend-item(v-for="friend in friendsGroup1" :key="friend.id" @click="showUserDialog(friend.id)") + .x-friend-group.x-link(@click="isOnlineFriends = !isOnlineFriends; saveFriendsGroupStates()" v-show="onlineFriends.length") + i.el-icon-arrow-right(:class="{ rotate: isOnlineFriends }") + span(style="margin-left:5px") {{ $t('side_panel.online') }} ― {{ onlineFriends.length }} + div(v-show="isOnlineFriends") + .x-friend-item(v-for="friend in onlineFriends" :key="friend.id" @click="showUserDialog(friend.id)") template(v-if="friend.ref") .avatar(:class="userStatusClass(friend.ref, friend.pendingOffline)") img(v-lazy="userImage(friend.ref)") @@ -159,11 +159,11 @@ html template(v-else) span(v-text="friend.name || friend.id") el-button(type="text" icon="el-icon-close" size="mini" @click.stop="confirmDeleteFriend(friend.id)" style="margin-left:5px") - .x-friend-group.x-link(@click="isFriendsGroup2 = !isFriendsGroup2; saveFriendsGroupStates()" v-show="friendsGroup2.length") - i.el-icon-arrow-right(:class="{ rotate: isFriendsGroup2 }") - span(style="margin-left:5px") {{ $t('side_panel.active') }} ― {{ friendsGroup2.length }} - div(v-show="isFriendsGroup2") - .x-friend-item(v-for="friend in friendsGroup2" :key="friend.id" @click="showUserDialog(friend.id)") + .x-friend-group.x-link(@click="isActiveFriends = !isActiveFriends; saveFriendsGroupStates()" v-show="activeFriends.length") + i.el-icon-arrow-right(:class="{ rotate: isActiveFriends }") + span(style="margin-left:5px") {{ $t('side_panel.active') }} ― {{ activeFriends.length }} + div(v-show="isActiveFriends") + .x-friend-item(v-for="friend in activeFriends" :key="friend.id" @click="showUserDialog(friend.id)") template(v-if="friend.ref") .avatar img(v-lazy="userImage(friend.ref)") @@ -174,11 +174,11 @@ html template(v-else) span(v-text="friend.name || friend.id") el-button(type="text" icon="el-icon-close" size="mini" @click.stop="confirmDeleteFriend(friend.id)" style="margin-left:5px") - .x-friend-group.x-link(@click="isFriendsGroup3 = !isFriendsGroup3; saveFriendsGroupStates()" v-show="friendsGroup3.length") - i.el-icon-arrow-right(:class="{ rotate: isFriendsGroup3 }") - span(style="margin-left:5px") {{ $t('side_panel.offline') }} ― {{ friendsGroup3.length }} - div(v-show="isFriendsGroup3") - .x-friend-item(v-for="friend in friendsGroup3" :key="friend.id" @click="showUserDialog(friend.id)") + .x-friend-group.x-link(@click="isOfflineFriends = !isOfflineFriends; saveFriendsGroupStates()" v-show="offlineFriends.length") + i.el-icon-arrow-right(:class="{ rotate: isOfflineFriends }") + span(style="margin-left:5px") {{ $t('side_panel.offline') }} ― {{ offlineFriends.length }} + div(v-show="isOfflineFriends") + .x-friend-item(v-for="friend in offlineFriends" :key="friend.id" @click="showUserDialog(friend.id)") template(v-if="friend.ref") .avatar img(v-lazy="userImage(friend.ref)") @@ -1329,7 +1329,7 @@ html br el-button(size="mini" v-text="$t('dialog.invite.add_self')" @click="addSelfToInvite" style="margin-top:10px") el-button(size="mini" v-text="$t('dialog.invite.add_friends_in_instance')" @click="addFriendsInInstanceToInvite" :disabled="inviteDialog.friendsInInstance.length === 0" style="margin-top:10px") - el-button(size="mini" v-text="$t('dialog.invite.add_favorite_friends')" @click="addFavoriteFriendsToInvite" :disabled="friendsGroup0.length === 0" style="margin-top:10px") + el-button(size="mini" v-text="$t('dialog.invite.add_favorite_friends')" @click="addFavoriteFriendsToInvite" :disabled="vipFriends.length === 0" style="margin-top:10px") el-select(v-model="inviteDialog.userIds" multiple clearable :placeholder="$t('dialog.invite.select_placeholder')" filterable :disabled="inviteDialog.loading" style="width:100%;margin-top:15px") el-option-group(v-if="API.currentUser" :label="$t('side_panel.me')") el-option.x-friend-item(:label="API.currentUser.displayName" :value="API.currentUser.id" style="height:auto") @@ -1345,24 +1345,24 @@ html .detail span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span(v-else v-text="friend.id") - el-option-group(v-if="friendsGroup0.length" :label="$t('side_panel.favorite')") - el-option.x-friend-item(v-for="friend in friendsGroup0" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="vipFriends.length" :label="$t('side_panel.favorite')") + el-option.x-friend-item(v-for="friend in vipFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar(:class="userStatusClass(friend.ref)") img(v-lazy="userImage(friend.ref)") .detail span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span(v-else v-text="friend.id") - el-option-group(v-if="friendsGroup1.length" :label="$t('side_panel.online')") - el-option.x-friend-item(v-for="friend in friendsGroup1" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="onlineFriends.length" :label="$t('side_panel.online')") + el-option.x-friend-item(v-for="friend in onlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar(:class="userStatusClass(friend.ref)") img(v-lazy="userImage(friend.ref)") .detail span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span(v-else v-text="friend.id") - el-option-group(v-if="friendsGroup2.length" :label="$t('side_panel.active')") - el-option.x-friend-item(v-for="friend in friendsGroup2" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="activeFriends.length" :label="$t('side_panel.active')") + el-option.x-friend-item(v-for="friend in activeFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar img(v-lazy="userImage(friend.ref)") @@ -1515,32 +1515,32 @@ html img(v-lazy="userImage(API.currentUser)") .detail span.name(v-text="API.currentUser.displayName") - el-option-group(v-if="friendsGroup0.length" :label="$t('side_panel.favorite')") - el-option.x-friend-item(v-for="friend in friendsGroup0" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="vipFriends.length" :label="$t('side_panel.favorite')") + el-option.x-friend-item(v-for="friend in vipFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar(:class="userStatusClass(friend.ref)") img(v-lazy="userImage(friend.ref)") .detail span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span(v-else v-text="friend.id") - el-option-group(v-if="friendsGroup1.length" :label="$t('side_panel.online')") - el-option.x-friend-item(v-for="friend in friendsGroup1" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="onlineFriends.length" :label="$t('side_panel.online')") + el-option.x-friend-item(v-for="friend in onlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar(:class="userStatusClass(friend.ref)") img(v-lazy="userImage(friend.ref)") .detail span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span(v-else v-text="friend.id") - el-option-group(v-if="friendsGroup2.length" :label="$t('side_panel.active')") - el-option.x-friend-item(v-for="friend in friendsGroup2" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="activeFriends.length" :label="$t('side_panel.active')") + el-option.x-friend-item(v-for="friend in activeFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar img(v-lazy="userImage(friend.ref)") .detail span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span(v-else v-text="friend.id") - el-option-group(v-if="friendsGroup3.length" :label="$t('side_panel.offline')") - el-option.x-friend-item(v-for="friend in friendsGroup3" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="offlineFriends.length" :label="$t('side_panel.offline')") + el-option.x-friend-item(v-for="friend in offlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar img(v-lazy="userImage(friend.ref)") @@ -2900,32 +2900,32 @@ html .detail span.name(v-text="inviteGroupDialog.userObject.displayName" :style="{'color':inviteGroupDialog.userObject.$userColour}") span(v-else v-text="inviteGroupDialog.userId") - el-option-group(v-if="friendsGroup0.length" :label="$t('side_panel.favorite')") - el-option.x-friend-item(v-for="friend in friendsGroup0" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="vipFriends.length" :label="$t('side_panel.favorite')") + el-option.x-friend-item(v-for="friend in vipFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar(:class="userStatusClass(friend.ref)") img(v-lazy="userImage(friend.ref)") .detail span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span(v-else v-text="friend.id") - el-option-group(v-if="friendsGroup1.length" :label="$t('side_panel.online')") - el-option.x-friend-item(v-for="friend in friendsGroup1" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="onlineFriends.length" :label="$t('side_panel.online')") + el-option.x-friend-item(v-for="friend in onlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar(:class="userStatusClass(friend.ref)") img(v-lazy="userImage(friend.ref)") .detail span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span(v-else v-text="friend.id") - el-option-group(v-if="friendsGroup2.length" :label="$t('side_panel.active')") - el-option.x-friend-item(v-for="friend in friendsGroup2" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="activeFriends.length" :label="$t('side_panel.active')") + el-option.x-friend-item(v-for="friend in activeFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar img(v-lazy="userImage(friend.ref)") .detail span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span(v-else v-text="friend.id") - el-option-group(v-if="friendsGroup3.length" :label="$t('side_panel.offline')") - el-option.x-friend-item(v-for="friend in friendsGroup3" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="offlineFriends.length" :label="$t('side_panel.offline')") + el-option.x-friend-item(v-for="friend in offlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar img(v-lazy="userImage(friend.ref)") @@ -3325,32 +3325,32 @@ html el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="sendBoopDialog" :visible.sync="sendBoopDialog.visible" :title="$t('dialog.boop_dialog.header')" width="450px") div(v-if="sendBoopDialog.visible") el-select(v-model="sendBoopDialog.userId" :placeholder="$t('dialog.new_instance.instance_creator_placeholder')" filterable style="width:100%") - el-option-group(v-if="friendsGroup0.length" :label="$t('side_panel.favorite')") - el-option.x-friend-item(v-for="friend in friendsGroup0" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="vipFriends.length" :label="$t('side_panel.favorite')") + el-option.x-friend-item(v-for="friend in vipFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar(:class="userStatusClass(friend.ref)") img(v-lazy="userImage(friend.ref)") .detail span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span(v-else v-text="friend.id") - el-option-group(v-if="friendsGroup1.length" :label="$t('side_panel.online')") - el-option.x-friend-item(v-for="friend in friendsGroup1" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="onlineFriends.length" :label="$t('side_panel.online')") + el-option.x-friend-item(v-for="friend in onlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar(:class="userStatusClass(friend.ref)") img(v-lazy="userImage(friend.ref)") .detail span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span(v-else v-text="friend.id") - el-option-group(v-if="friendsGroup2.length" :label="$t('side_panel.active')") - el-option.x-friend-item(v-for="friend in friendsGroup2" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="activeFriends.length" :label="$t('side_panel.active')") + el-option.x-friend-item(v-for="friend in activeFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar img(v-lazy="userImage(friend.ref)") .detail span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span(v-else v-text="friend.id") - el-option-group(v-if="friendsGroup3.length" :label="$t('side_panel.offline')") - el-option.x-friend-item(v-for="friend in friendsGroup3" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + el-option-group(v-if="offlineFriends.length" :label="$t('side_panel.offline')") + el-option.x-friend-item(v-for="friend in offlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") .avatar img(v-lazy="userImage(friend.ref)") diff --git a/html/src/localization/en/en.json b/html/src/localization/en/en.json index 85f15b6a..b6d4c6fe 100644 --- a/html/src/localization/en/en.json +++ b/html/src/localization/en/en.json @@ -293,10 +293,11 @@ "header": "Side Panel", "sorting": { "header": "Sorting", + "sort_default": "Default", "sort_private_to_bottom": "Sort Private to bottom", - "sort_by_status": "Sort by status", - "sort_gps_to_top": "Sort GPS to top", - "sort_gps_to_top_notice": "(online for only)", + "sort_by_status": "Sort by Status", + "sort_by_status_and_private_to_bottom": "Sort by Status and Private to Bottom", + "sort_by_location": "Sort by Location", "sort_favorite_by": "Sort Favorites by", "sort_favorite_by_alphabet": "alphabetical", "sort_favorite_by_online_time": "online for", diff --git a/html/src/localization/es/en.json b/html/src/localization/es/en.json index c20d8051..5d4e9d46 100644 --- a/html/src/localization/es/en.json +++ b/html/src/localization/es/en.json @@ -293,10 +293,11 @@ "header": "Panel Lateral", "sorting": { "header": "Clasificación", + "sort_default": "Default", "sort_private_to_bottom": "Ordenar privados abajo", "sort_by_status": "Ordenar por estado", - "sort_gps_to_top": "Ordenar GPS arriba", - "sort_gps_to_top_notice": "(sólo en línea)", + "sort_by_status_and_private_to_bottom": "Sort by Status and Private to Bottom", + "sort_by_location": "Sort by Location", "sort_favorite_by": "Ordenar Favoritos por", "sort_favorite_by_alphabet": "alfabético", "sort_favorite_by_online_time": "en línea desde", diff --git a/html/src/localization/fr/en.json b/html/src/localization/fr/en.json index d315bf80..87ec8527 100644 --- a/html/src/localization/fr/en.json +++ b/html/src/localization/fr/en.json @@ -293,10 +293,11 @@ "header": "Panneau latéral", "sorting": { "header": "Comportement du tri", + "sort_default": "Default", "sort_private_to_bottom": "Joueurs en privé en fin de liste", "sort_by_status": "Trier par statut", - "sort_gps_to_top": "Trier les GPS vers le haut", - "sort_gps_to_top_notice": "(seulement en ligne)", + "sort_by_status_and_private_to_bottom": "Sort by Status and Private to Bottom", + "sort_by_location": "Sort by Location", "sort_favorite_by": "Trier les favoris par", "sort_favorite_by_alphabet": "alphabétique", "sort_favorite_by_online_time": "en ligne depuis", diff --git a/html/src/localization/hu/en.json b/html/src/localization/hu/en.json index f8255b0f..820d98bc 100644 --- a/html/src/localization/hu/en.json +++ b/html/src/localization/hu/en.json @@ -293,10 +293,11 @@ "header": "Side Panel", "sorting": { "header": "Sorting", + "sort_default": "Default", "sort_private_to_bottom": "Sort Private to bottom", "sort_by_status": "Sort by status", - "sort_gps_to_top": "Sort GPS to top", - "sort_gps_to_top_notice": "(online for only)", + "sort_by_status_and_private_to_bottom": "Sort by Status and Private to Bottom", + "sort_by_location": "Sort by Location", "sort_favorite_by": "Kedvencek rendezése", "sort_favorite_by_alphabet": "betűrend", "sort_favorite_by_online_time": "online for", diff --git a/html/src/localization/ja/en.json b/html/src/localization/ja/en.json index f8027238..1efb068f 100644 --- a/html/src/localization/ja/en.json +++ b/html/src/localization/ja/en.json @@ -293,10 +293,11 @@ "header": "サイドパネル", "sorting": { "header": "並び替え", + "sort_default": "Default", "sort_private_to_bottom": "プライベートを下に並び替え", "sort_by_status": "ステータスで並べ替え", - "sort_gps_to_top": "GPSで並べ替え", - "sort_gps_to_top_notice": "(オンラインのみ)", + "sort_by_status_and_private_to_bottom": "Sort by Status and Private to Bottom", + "sort_by_location": "Sort by Location", "sort_favorite_by": "お気に入り欄の並べ替え:", "sort_favorite_by_alphabet": "アルファベット順", "sort_favorite_by_online_time": "オンライン順", diff --git a/html/src/localization/ko/en.json b/html/src/localization/ko/en.json index 8bd83d7f..4c23c47c 100644 --- a/html/src/localization/ko/en.json +++ b/html/src/localization/ko/en.json @@ -293,10 +293,11 @@ "header": "친구 목록", "sorting": { "header": "정렬", + "sort_default": "Default", "sort_private_to_bottom": "비공개 월드는 마지막에 표시", "sort_by_status": "상태순", - "sort_gps_to_top": "GPS순", - "sort_gps_to_top_notice": "(온라인만 해당)", + "sort_by_status_and_private_to_bottom": "Sort by Status and Private to Bottom", + "sort_by_location": "Sort by Location", "sort_favorite_by": "친한 친구 순서", "sort_favorite_by_alphabet": "이름순", "sort_favorite_by_online_time": "시간순", diff --git a/html/src/localization/pl/en.json b/html/src/localization/pl/en.json index 14aa2ef9..c3374287 100644 --- a/html/src/localization/pl/en.json +++ b/html/src/localization/pl/en.json @@ -293,10 +293,11 @@ "header": "Panel boczny", "sorting": { "header": "Sortowanie", + "sort_default": "Default", "sort_private_to_bottom": "Sortuj prywatne niżej", "sort_by_status": "Sortuj wg statusu", - "sort_gps_to_top": "Sortuj GPS wyżej", - "sort_gps_to_top_notice": "(tylko dla czasu online)", + "sort_by_status_and_private_to_bottom": "Sort by Status and Private to Bottom", + "sort_by_location": "Sort by Location", "sort_favorite_by": "Sortuj ulubione wg", "sort_favorite_by_alphabet": "alfabetycznie", "sort_favorite_by_online_time": "czas online", diff --git a/html/src/localization/pt/en.json b/html/src/localization/pt/en.json index 8fd21bbb..20826940 100644 --- a/html/src/localization/pt/en.json +++ b/html/src/localization/pt/en.json @@ -293,10 +293,11 @@ "header": "Painel lateral", "sorting": { "header": "Ordenação", + "sort_default": "Default", "sort_private_to_bottom": "Ordenar Privado para baixo", "sort_by_status": "Ordenar por status", - "sort_gps_to_top": "Ordenar GPS para cima", - "sort_gps_to_top_notice": "(apenas online)", + "sort_by_status_and_private_to_bottom": "Sort by Status and Private to Bottom", + "sort_by_location": "Sort by Location", "sort_favorite_by": "Ordenar Favoritos por", "sort_favorite_by_alphabet": "alfabético", "sort_favorite_by_online_time": "online para", diff --git a/html/src/localization/ru/en.json b/html/src/localization/ru/en.json index 4a2fce0e..78ca0bee 100644 --- a/html/src/localization/ru/en.json +++ b/html/src/localization/ru/en.json @@ -293,10 +293,11 @@ "header": "Боковая панель", "sorting": { "header": "Сортировка", + "sort_default": "Default", "sort_private_to_bottom": "Упорядочить приватных внизу", "sort_by_status": "Сортировать по статусу", - "sort_gps_to_top": "Сортировать GPS сверху", - "sort_gps_to_top_notice": "(Только онлайн)", + "sort_by_status_and_private_to_bottom": "Sort by Status and Private to Bottom", + "sort_by_location": "Sort by Location", "sort_favorite_by": "Сортировать избранные по", "sort_favorite_by_alphabet": "алфавиту", "sort_favorite_by_online_time": "онлайн", diff --git a/html/src/localization/vi/en.json b/html/src/localization/vi/en.json index 22d03859..db2f4b2e 100644 --- a/html/src/localization/vi/en.json +++ b/html/src/localization/vi/en.json @@ -293,10 +293,11 @@ "header": "Bẳng điều khiển bên cạnh", "sorting": { "header": "Sắp xếp", + "sort_default": "Default", "sort_private_to_bottom": "Sắp xếp Private xuống dưới cùng", "sort_by_status": "Sắp xếp theo status", - "sort_gps_to_top": "Sắp xếp vị trí GPS lên đầu", - "sort_gps_to_top_notice": "(Chỉ bao gồm online trong thời gian)", + "sort_by_status_and_private_to_bottom": "Sort by Status and Private to Bottom", + "sort_by_location": "Sort by Location", "sort_favorite_by": "Sắp xếp mục yêu thích theo", "sort_favorite_by_alphabet": "bảng chữ cái", "sort_favorite_by_online_time": "online trong", diff --git a/html/src/localization/zh-CN/en.json b/html/src/localization/zh-CN/en.json index 526b86f1..e4651d8a 100644 --- a/html/src/localization/zh-CN/en.json +++ b/html/src/localization/zh-CN/en.json @@ -293,10 +293,11 @@ "header": "侧边栏", "sorting": { "header": "排序", + "sort_default": "Default", "sort_private_to_bottom": "将处在私人世界的好友置于底部", "sort_by_status": "按状态排序", - "sort_gps_to_top": "将GPS动态置于顶部", - "sort_gps_to_top_notice": "(仅限在线好友)", + "sort_by_status_and_private_to_bottom": "Sort by Status and Private to Bottom", + "sort_by_location": "Sort by Location", "sort_favorite_by": "星标好友排序规则", "sort_favorite_by_alphabet": "字母顺序", "sort_favorite_by_online_time": "在线时长", diff --git a/html/src/localization/zh-TW/en.json b/html/src/localization/zh-TW/en.json index a7b07323..5b12aaf2 100644 --- a/html/src/localization/zh-TW/en.json +++ b/html/src/localization/zh-TW/en.json @@ -293,10 +293,11 @@ "header": "側板", "sorting": { "header": "排序", + "sort_default": "Default", "sort_private_to_bottom": "將 私人世界 排序到底部", "sort_by_status": "依狀態排序", - "sort_gps_to_top": "將 GPS 排序到頂部", - "sort_gps_to_top_notice": "(僅限上線玩家)", + "sort_by_status_and_private_to_bottom": "Sort by Status and Private to Bottom", + "sort_by_location": "Sort by Location", "sort_favorite_by": "收藏玩家 排序依據", "sort_favorite_by_alphabet": "字母順序", "sort_favorite_by_online_time": "上線時長", diff --git a/html/src/mixins/tabs/settings.pug b/html/src/mixins/tabs/settings.pug index f20df487..2ae59285 100644 --- a/html/src/mixins/tabs/settings.pug +++ b/html/src/mixins/tabs/settings.pug @@ -199,27 +199,24 @@ mixin settingsTab() br span.sub-header {{ $t('view.settings.appearance.side_panel.sorting.header') }} div.options-container-item - span.name {{ $t('view.settings.appearance.side_panel.sorting.sort_private_to_bottom') }} - el-switch(v-model="orderFriendsGroupPrivate" @change="saveOrderFriendGroup") - div.options-container-item - span.name {{ $t('view.settings.appearance.side_panel.sorting.sort_by_status') }} - el-switch(v-model="orderFriendsGroupStatus" @change="saveOrderFriendGroup") - div.options-container-item - span.name {{ $t('view.settings.appearance.side_panel.sorting.sort_gps_to_top') }} - el-switch(v-model="orderFriendsGroupGPS" @change="saveOrderFriendGroup") - span.name(style="margin-left:5px") {{ $t('view.settings.appearance.side_panel.sorting.sort_gps_to_top_notice') }} + el-radio-group(v-model="onlineAndVIPFriendsSortMethod" @change="saveOrderFriendGroup" size="mini") + el-radio-button(label="Default") {{ $t('view.settings.appearance.side_panel.sorting.sort_default') }} + el-radio-button(label="Sort Private to Bottom") {{ $t('view.settings.appearance.side_panel.sorting.sort_private_to_bottom') }} + el-radio-button(label="Sort by Status") {{ $t('view.settings.appearance.side_panel.sorting.sort_by_status') }} + el-radio-button(label="Sort by Status and Private to Bottom") {{ $t('view.settings.appearance.side_panel.sorting.sort_by_status_and_private_to_bottom') }} + el-radio-button(label="Sort by Location") {{ $t('view.settings.appearance.side_panel.sorting.sort_by_location') }} div.options-container-item span.name {{ $t('view.settings.appearance.side_panel.sorting.sort_favorite_by') }} - el-switch(v-model="orderFriendsGroup0" :inactive-text="$t('view.settings.appearance.side_panel.sorting.sort_favorite_by_alphabet')" :active-text="$t('view.settings.appearance.side_panel.sorting.sort_favorite_by_online_time')" @change="saveOrderFriendGroup") + el-switch(v-model="orderVIPFriends" :inactive-text="$t('view.settings.appearance.side_panel.sorting.sort_favorite_by_alphabet')" :active-text="$t('view.settings.appearance.side_panel.sorting.sort_favorite_by_online_time')" @change="saveOrderFriendGroup") div.options-container-item span.name {{ $t('view.settings.appearance.side_panel.sorting.sort_online_by') }} - el-switch(v-model="orderFriendsGroup1" :inactive-text="$t('view.settings.appearance.side_panel.sorting.sort_online_by_alphabet')" :active-text="$t('view.settings.appearance.side_panel.sorting.sort_online_by_online_time')" @change="saveOrderFriendGroup") + el-switch(v-model="orderOnlineFriends" :inactive-text="$t('view.settings.appearance.side_panel.sorting.sort_online_by_alphabet')" :active-text="$t('view.settings.appearance.side_panel.sorting.sort_online_by_online_time')" @change="saveOrderFriendGroup") div.options-container-item span.name {{ $t('view.settings.appearance.side_panel.sorting.sort_active_by') }} - el-switch(v-model="orderFriendsGroup2" :inactive-text="$t('view.settings.appearance.side_panel.sorting.sort_active_by_alphabet')" :active-text="$t('view.settings.appearance.side_panel.sorting.sort_active_by_online_time')" @change="saveOrderFriendGroup") + el-switch(v-model="orderActiveFriends" :inactive-text="$t('view.settings.appearance.side_panel.sorting.sort_active_by_alphabet')" :active-text="$t('view.settings.appearance.side_panel.sorting.sort_active_by_online_time')" @change="saveOrderFriendGroup") div.options-container-item span.name {{ $t('view.settings.appearance.side_panel.sorting.sort_offline_by') }} - el-switch(v-model="orderFriendsGroup3" :inactive-text="$t('view.settings.appearance.side_panel.sorting.sort_offline_by_alphabet')" :active-text="$t('view.settings.appearance.side_panel.sorting.sort_offline_by_offline_time')" @change="saveOrderFriendGroup") + el-switch(v-model="orderOfflineFriends" :inactive-text="$t('view.settings.appearance.side_panel.sorting.sort_offline_by_alphabet')" :active-text="$t('view.settings.appearance.side_panel.sorting.sort_offline_by_offline_time')" @change="saveOrderFriendGroup") span.sub-header {{ $t('view.settings.appearance.side_panel.width') }} div.options-container-item el-slider(v-model="asideWidth" @input="setAsideWidth" :show-tooltip="false" :marks="{300: ''}" :min="200" :max="500" style="width:300px")