Small changes and fixes

This commit is contained in:
Natsumi
2022-09-04 10:10:23 +12:00
parent c4e138250e
commit 57d48c828c
3 changed files with 62 additions and 24 deletions

View File

@@ -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;

View File

@@ -792,7 +792,7 @@ speechSynthesis.getVoices();
Vue.component('location', {
template:
"<span @click=\"showWorldDialog\" :class=\"{ 'x-link': link && this.location !== 'private' && this.location !== 'traveling' && this.location !== 'offline'}\">" +
"<span @click=\"showWorldDialog\" :class=\"{ 'x-link': link && this.location !== 'private' && this.location !== 'offline'}\">" +
'<i v-if="isTraveling" class="el-icon el-icon-loading" style="display:inline-block;margin-right:5px"></i>' +
'<span style="margin-right:5px">{{ text }}</span><span class="flags" :class="region" style="display:inline-block"></span>' +
'<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
@@ -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;

View File

@@ -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&horbar;{{ 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