on Location change remove OnPlayerJoined no longer time based

This commit is contained in:
Natsumi
2021-05-29 03:39:56 +12:00
parent fd484e3f16
commit 0ed46f293b
2 changed files with 27 additions and 32 deletions

View File

@@ -3944,6 +3944,7 @@ speechSynthesis.getVoices();
var playerCountIndex = 0;
var playerList = [];
var friendList = [];
var currentUserJoinTime = '';
var currentUserLeaveTime = '';
for (var i = data.length - 1; i > -1; i--) {
var ctx = data[i];
@@ -3982,6 +3983,32 @@ speechSynthesis.getVoices();
continue;
}
}
// on Location change remove OnPlayerJoined
if (ctx.type === 'OnPlayerJoined') {
if (ctx.created_at === currentUserJoinTime) {
continue;
}
if (ctx.data === API.currentUser.displayName) {
currentUserJoinTime = ctx.created_at;
for (var k = w - 1; k > -1; k--) {
var feedItem = wristArr[k];
if ((feedItem.created_at === currentUserJoinTime) &&
(feedItem.type === 'OnPlayerJoined')) {
wristArr.splice(k, 1);
w--;
}
}
for (var k = n - 1; k > -1; k--) {
var feedItem = notyArr[k];
if ((feedItem.created_at === currentUserJoinTime) &&
(feedItem.type === 'OnPlayerJoined')) {
notyArr.splice(k, 1);
n--;
}
}
continue;
}
}
// remove current user
if (((ctx.type === 'OnPlayerJoined') ||
(ctx.type === 'OnPlayerLeft') ||
@@ -3989,32 +4016,6 @@ speechSynthesis.getVoices();
(ctx.data === API.currentUser.displayName)) {
continue;
}
// on Location change remove OnPlayerJoined
if (ctx.type === 'Location') {
var locationBias = new Date(Date.parse(ctx.created_at) + 15000).toJSON(); //15 seconds
if (this.hideOnPlayerJoined) {
for (var k = w - 1; k > -1; k--) {
var feedItem = wristArr[k];
if ((feedItem.created_at > locationBias) || (feedItem.type === 'Location')) {
break;
}
if (feedItem.type === 'OnPlayerJoined') {
wristArr.splice(k, 1);
w--;
}
}
}
for (var k = n - 1; k > -1; k--) {
var feedItem = notyArr[k];
if (feedItem.created_at > locationBias) {
break;
}
if (feedItem.type === 'OnPlayerJoined') {
notyArr.splice(k, 1);
n--;
}
}
}
var isFriend = false;
var isFavorite = false;
if ((ctx.type === 'OnPlayerJoined') ||
@@ -7129,7 +7130,6 @@ speechSynthesis.getVoices();
$app.data.openVRAlways = configRepository.getBool('openVRAlways');
$app.data.overlaybutton = configRepository.getBool('VRCX_overlaybutton');
$app.data.hidePrivateFromFeed = configRepository.getBool('VRCX_hidePrivateFromFeed');
$app.data.hideOnPlayerJoined = configRepository.getBool('VRCX_hideOnPlayerJoined');
$app.data.hideDevicesFromFeed = configRepository.getBool('VRCX_hideDevicesFromFeed');
$app.data.overlayNotifications = configRepository.getBool('VRCX_overlayNotifications');
$app.data.overlayWrist = configRepository.getBool('VRCX_overlayWrist');
@@ -7150,7 +7150,6 @@ speechSynthesis.getVoices();
configRepository.setBool('openVRAlways', this.openVRAlways);
configRepository.setBool('VRCX_overlaybutton', this.overlaybutton);
configRepository.setBool('VRCX_hidePrivateFromFeed', this.hidePrivateFromFeed);
configRepository.setBool('VRCX_hideOnPlayerJoined', this.hideOnPlayerJoined);
configRepository.setBool('VRCX_hideDevicesFromFeed', this.hideDevicesFromFeed);
configRepository.setBool('VRCX_overlayNotifications', this.overlayNotifications);
configRepository.setBool('VRCX_overlayWrist', this.overlayWrist);
@@ -7178,7 +7177,6 @@ speechSynthesis.getVoices();
$app.watch.openVRAlways = saveOpenVROption;
$app.watch.overlaybutton = saveOpenVROption;
$app.watch.hidePrivateFromFeed = saveOpenVROption;
$app.watch.hideOnPlayerJoined = saveOpenVROption;
$app.watch.hideDevicesFromFeed = saveOpenVROption;
$app.watch.overlayNotifications = saveOpenVROption;
$app.watch.overlayWrist = saveOpenVROption;

View File

@@ -838,9 +838,6 @@ html
div.options-container-item
span.name Hide VR Devices
el-switch(v-model="hideDevicesFromFeed" :disabled="!openVR || !overlayWrist")
div.options-container-item
span.name Hide Joins When Joining
el-switch(v-model="hideOnPlayerJoined" :disabled="!openVR || !overlayWrist")
div.options-container-item
el-button(size="small" icon="el-icon-notebook-2" @click="showWristFeedFiltersDialog()" :disabled="!openVR || !overlayWrist") Wrist Feed Filters
br