From 57d48c828cb212989efafc0b5b9411990778bcde Mon Sep 17 00:00:00 2001 From: Natsumi Date: Sun, 4 Sep 2022 10:10:23 +1200 Subject: [PATCH] Small changes and fixes --- LogWatcher.cs | 1 - html/src/app.js | 75 +++++++++++++++++++++++++++++++++------------- html/src/index.pug | 10 +++++-- 3 files changed, 62 insertions(+), 24 deletions(-) diff --git a/LogWatcher.cs b/LogWatcher.cs index c0cdced0..de8158dd 100644 --- a/LogWatcher.cs +++ b/LogWatcher.cs @@ -228,7 +228,6 @@ namespace VRCX ParseLogUsharpVideoPlay(fileInfo, logContext, line, offset) == true || ParseLogUsharpVideoSync(fileInfo, logContext, line, offset) == true || ParseLogWorldVRCX(fileInfo, logContext, line, offset) == true || - ParseLogPhotonId(fileInfo, logContext, line, offset) == true || ParseLogOnAudioConfigurationChanged(fileInfo, logContext, line, offset) == true) { continue; diff --git a/html/src/app.js b/html/src/app.js index faebffdc..2e7f5dc8 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -792,7 +792,7 @@ speechSynthesis.getVoices(); Vue.component('location', { template: - "" + + "" + '' + '{{ text }}' + '', @@ -5795,7 +5795,9 @@ speechSynthesis.getVoices(); for (var userId of friends) { var ref = this.friends.get(userId); var name = (typeof ref !== 'undefined' && ref.name) || ''; - var memo = (typeof ref !== 'undefined' && ref.memo) || ''; + var memo = + (typeof ref !== 'undefined' && ref.memo.replace(/\n/g, ' ')) || + ''; lines.push(`${_(userId)},${_(name)},${_(memo)}`); } this.exportFriendsListContent = lines.join('\n'); @@ -6837,6 +6839,8 @@ speechSynthesis.getVoices(); database.addOnlineOfflineToDatabase(feed); } else if (newState === 'online') { if (ctx.ref !== 'undefined') { + ctx.ref.$previousLocation = ''; + ctx.ref.$travelingToTime = Date.now(); ctx.ref.$location_at = Date.now(); ctx.ref.$online_for = Date.now(); ctx.ref.$offline_for = ''; @@ -7622,21 +7626,29 @@ speechSynthesis.getVoices(); previousLocation = ref.$previousLocation; var travelTime = Date.now() - ref.$travelingToTime; time -= travelTime; + if (time < 0) { + time = 0; + } + } + if (ref.$previousLocation === props.location[0]) { + // location traveled to is the same + ref.$location_at = Date.now() - props.location[2]; + } else { + var worldName = await $app.getWorldName(props.location[0]); + var feed = { + created_at: new Date().toJSON(), + type: 'GPS', + userId: ref.id, + displayName: ref.displayName, + location: props.location[0], + worldName, + previousLocation, + time + }; + $app.addFeed(feed); + database.addGPSToDatabase(feed); + $app.updateFriendGPS(ref.id); } - var worldName = await $app.getWorldName(props.location[0]); - var feed = { - created_at: new Date().toJSON(), - type: 'GPS', - userId: ref.id, - displayName: ref.displayName, - location: props.location[0], - worldName, - previousLocation, - time - }; - $app.addFeed(feed); - database.addGPSToDatabase(feed); - $app.updateFriendGPS(ref.id); } if ( props.location && @@ -13442,6 +13454,24 @@ speechSynthesis.getVoices(); ); } } + // add/remove friends from lastLocation.friendList + if ( + !$app.lastLocation.friendList.has(ref.displayName) && + $app.friends.has(ref.id) + ) { + var userMap = { + displayName: ref.displayName, + userId: ref.id, + joinTime: playerListRef.joinTime + }; + $app.lastLocation.friendList.set(ref.displayName, userMap); + } + if ( + $app.lastLocation.friendList.has(ref.displayName) && + !$app.friends.has(ref.id) + ) { + $app.lastLocation.friendList.delete(ref.displayName); + } $app.photonLobby.forEach((ref1, id) => { if ( typeof ref1 !== 'undefined' && @@ -15734,7 +15764,15 @@ speechSynthesis.getVoices(); this.copyToClipboard(`https://vrchat.com/home/avatar/${avatarId}`); }; - $app.methods.copyWorld = function (worldId) { + $app.methods.copyWorldId = function (worldId) { + this.$message({ + message: 'World ID copied to clipboard', + type: 'success' + }); + this.copyToClipboard(worldId); + }; + + $app.methods.copyWorldUrl = function (worldId) { this.$message({ message: 'World URL copied to clipboard', type: 'success' @@ -16835,9 +16873,6 @@ speechSynthesis.getVoices(); await API.getUser({ userId }); - await new Promise((resolve) => { - setTimeout(resolve, 1000); - }); } this.friendsListLoadingProgress = ''; this.friendsListLoading = false; diff --git a/html/src/index.pug b/html/src/index.pug index dcaef8a7..e78e8c1f 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -139,7 +139,7 @@ html el-table-column(label="Timer" width="80" prop="timer" sortable) template(v-once #default="scope") timer(:epoch="scope.row.timer") - el-table-column(label="Photon Id" width="110" prop="photonId" sortable) + el-table-column(v-if="photonLoggingEnabled" label="Photon Id" width="110" prop="photonId" sortable) template(v-once #default="scope") span(v-text="scope.row.photonId") el-table-column(label="Icons" prop="isMaster" width="100") @@ -1363,7 +1363,7 @@ html .x-friend-list(style="padding-bottom:10px") .x-friend-group i.el-icon-arrow-right(:class="{ rotate: isFriendsGroupMe }") - span.x-link(@click="isFriendsGroupMe = !isFriendsGroupMe" style="margin-left:5px") ME + span.x-link(@click="isFriendsGroupMe = !isFriendsGroupMe" style="margin-left:5px") ME―{{ onlineFriendCount }}/{{ friends.size }} div(v-show="isFriendsGroupMe") .x-friend-item(:key="API.currentUser.id" @click="showUserDialog(API.currentUser.id)") .avatar(:class="userStatusClass(API.currentUser)") @@ -1815,7 +1815,11 @@ html span.name World ID span.extra {{ worldDialog.id }} el-tooltip(placement="top" content="Copy to clipboard" :disabled="hideTooltips") - el-button(@click="copyWorld(worldDialog.id)" size="mini" icon="el-icon-s-order" style="margin-left:5px" circle) + el-dropdown(trigger="click" @click.native.stop size="mini" style="margin-left:5px") + el-button(type="default" icon="el-icon-s-order" size="mini" circle) + el-dropdown-menu(#default="dropdown") + el-dropdown-item(@click.native="copyWorldId(worldDialog.id)") Copy ID + el-dropdown-item(@click.native="copyWorldUrl(worldDialog.id)") Copy URL .x-friend-item(v-if="worldDialog.ref.previewYoutubeId" style="width:350px" @click="openExternalLink(`https://www.youtube.com/watch?v=${worldDialog.ref.previewYoutubeId}`)") .detail span.name YouTube Preview