mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-04 05:46:07 +02:00
Traveling fixes, update instance user count, update timers
and worldId being same as instanceId jank fix
This commit is contained in:
+43
-20
@@ -2005,7 +2005,7 @@ speechSynthesis.getVoices();
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var D = $app.userDialog;
|
var D = $app.userDialog;
|
||||||
if ($app.userDialog.visible && D.ref.location === json.id) {
|
if ($app.userDialog.visible && D.ref.$location.tag === json.id) {
|
||||||
D.instance.occupants = json.n_users;
|
D.instance.occupants = json.n_users;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -4408,12 +4408,8 @@ speechSynthesis.getVoices();
|
|||||||
'wristFeedUpdate',
|
'wristFeedUpdate',
|
||||||
JSON.stringify(wristFeed)
|
JSON.stringify(wristFeed)
|
||||||
);
|
);
|
||||||
if (this.userDialog.visible) {
|
this.applyUserDialogLocation();
|
||||||
this.applyUserDialogLocation();
|
this.applyWorldDialogInstances();
|
||||||
}
|
|
||||||
if (this.worldDialog.visible) {
|
|
||||||
this.applyWorldDialogInstances();
|
|
||||||
}
|
|
||||||
feeds.pendingUpdate = false;
|
feeds.pendingUpdate = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -7474,7 +7470,6 @@ speechSynthesis.getVoices();
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.updateCurrentInstanceWorld();
|
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
for (var i = length + 1; i < data.length; i++) {
|
for (var i = length + 1; i < data.length; i++) {
|
||||||
var ctx = data[i];
|
var ctx = data[i];
|
||||||
@@ -7511,8 +7506,12 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.updateCurrentUserLocation();
|
||||||
|
this.updateCurrentInstanceWorld();
|
||||||
this.updateVRLastLocation();
|
this.updateVRLastLocation();
|
||||||
this.getCurrentInstanceUserList();
|
this.getCurrentInstanceUserList();
|
||||||
|
this.applyUserDialogLocation();
|
||||||
|
this.applyWorldDialogInstances();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -7523,6 +7522,10 @@ speechSynthesis.getVoices();
|
|||||||
if ($app.friends.has(ref.id) === false) {
|
if ($app.friends.has(ref.id) === false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (props.location && ref.id === $app.userDialog.id) {
|
||||||
|
// update user dialog instance occupants
|
||||||
|
$app.applyUserDialogLocation(true);
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
props.location &&
|
props.location &&
|
||||||
props.location[0] !== 'offline' &&
|
props.location[0] !== 'offline' &&
|
||||||
@@ -7813,6 +7816,8 @@ speechSynthesis.getVoices();
|
|||||||
this.updateVRLastLocation();
|
this.updateVRLastLocation();
|
||||||
this.getCurrentInstanceUserList();
|
this.getCurrentInstanceUserList();
|
||||||
this.lastVideoUrl = '';
|
this.lastVideoUrl = '';
|
||||||
|
this.applyUserDialogLocation();
|
||||||
|
this.applyWorldDialogInstances();
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.data.lastLocation$ = {
|
$app.data.lastLocation$ = {
|
||||||
@@ -8071,6 +8076,8 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
this.clearNowPlaying();
|
this.clearNowPlaying();
|
||||||
this.updateCurrentInstanceWorld();
|
this.updateCurrentInstanceWorld();
|
||||||
|
this.applyUserDialogLocation();
|
||||||
|
this.applyWorldDialogInstances();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'location':
|
case 'location':
|
||||||
@@ -8087,6 +8094,8 @@ speechSynthesis.getVoices();
|
|||||||
this.updateCurrentUserLocation();
|
this.updateCurrentUserLocation();
|
||||||
this.updateVRLastLocation();
|
this.updateVRLastLocation();
|
||||||
this.updateCurrentInstanceWorld();
|
this.updateCurrentInstanceWorld();
|
||||||
|
this.applyUserDialogLocation();
|
||||||
|
this.applyWorldDialogInstances();
|
||||||
}
|
}
|
||||||
var L = API.parseLocation(gameLog.location);
|
var L = API.parseLocation(gameLog.location);
|
||||||
var entry = {
|
var entry = {
|
||||||
@@ -12855,7 +12864,6 @@ speechSynthesis.getVoices();
|
|||||||
} else if (D.ref.friendRequestStatus === 'outgoing') {
|
} else if (D.ref.friendRequestStatus === 'outgoing') {
|
||||||
D.outgoingRequest = true;
|
D.outgoingRequest = true;
|
||||||
}
|
}
|
||||||
$app.applyUserDialogLocation();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
API.$on('WORLD', function (args) {
|
API.$on('WORLD', function (args) {
|
||||||
@@ -13095,7 +13103,7 @@ speechSynthesis.getVoices();
|
|||||||
} else if (D.ref.friendRequestStatus === 'outgoing') {
|
} else if (D.ref.friendRequestStatus === 'outgoing') {
|
||||||
D.outgoingRequest = true;
|
D.outgoingRequest = true;
|
||||||
}
|
}
|
||||||
this.applyUserDialogLocation();
|
this.applyUserDialogLocation(true);
|
||||||
if (this.$refs.userDialogTabs.currentName === '0') {
|
if (this.$refs.userDialogTabs.currentName === '0') {
|
||||||
this.userDialogLastActiveTab = 'Info';
|
this.userDialogLastActiveTab = 'Info';
|
||||||
} else if (this.$refs.userDialogTabs.currentName === '1') {
|
} else if (this.$refs.userDialogTabs.currentName === '1') {
|
||||||
@@ -13129,13 +13137,6 @@ speechSynthesis.getVoices();
|
|||||||
if (args.cache) {
|
if (args.cache) {
|
||||||
API.getUser(args.params);
|
API.getUser(args.params);
|
||||||
}
|
}
|
||||||
var L = API.parseLocation(D.ref.location);
|
|
||||||
if (L.worldId && this.lastLocation.location !== L.tag) {
|
|
||||||
API.getInstance({
|
|
||||||
worldId: L.worldId,
|
|
||||||
instanceId: L.instanceId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var inCurrentWorld = false;
|
var inCurrentWorld = false;
|
||||||
if (this.lastLocation.playerList.has(D.ref.displayName)) {
|
if (this.lastLocation.playerList.has(D.ref.displayName)) {
|
||||||
inCurrentWorld = true;
|
inCurrentWorld = true;
|
||||||
@@ -13189,10 +13190,22 @@ speechSynthesis.getVoices();
|
|||||||
this.showUserDialogHistory.add(userId);
|
this.showUserDialogHistory.add(userId);
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.applyUserDialogLocation = function () {
|
$app.methods.applyUserDialogLocation = function (updateInstanceOccupants) {
|
||||||
var D = this.userDialog;
|
var D = this.userDialog;
|
||||||
|
if (!D.visible) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var L = API.parseLocation(D.ref.$location.tag);
|
var L = API.parseLocation(D.ref.$location.tag);
|
||||||
D.$location = L;
|
if (L.tag !== this.lastLocation.location && updateInstanceOccupants) {
|
||||||
|
this.userDialog.instance.occupants = 0;
|
||||||
|
if (this.isRealInstance(L.tag)) {
|
||||||
|
API.getInstance({
|
||||||
|
worldId: L.worldId,
|
||||||
|
instanceId: L.instanceId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
D.$location = L;
|
||||||
|
}
|
||||||
if (L.userId) {
|
if (L.userId) {
|
||||||
var ref = API.cachedUsers.get(L.userId);
|
var ref = API.cachedUsers.get(L.userId);
|
||||||
if (typeof ref === 'undefined') {
|
if (typeof ref === 'undefined') {
|
||||||
@@ -13277,6 +13290,7 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
D.instance.friendCount = friendCount;
|
D.instance.friendCount = friendCount;
|
||||||
|
this.updateTimers();
|
||||||
};
|
};
|
||||||
|
|
||||||
// App: player list
|
// App: player list
|
||||||
@@ -14148,6 +14162,11 @@ speechSynthesis.getVoices();
|
|||||||
if (L.worldId === '') {
|
if (L.worldId === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (L.worldId === L.instanceId) {
|
||||||
|
// very janky fix for removing empty worldId instance
|
||||||
|
L.instanceId = '';
|
||||||
|
L.instanceName = '';
|
||||||
|
}
|
||||||
D.id = L.worldId;
|
D.id = L.worldId;
|
||||||
D.$location = L;
|
D.$location = L;
|
||||||
D.treeData = [];
|
D.treeData = [];
|
||||||
@@ -14227,6 +14246,9 @@ speechSynthesis.getVoices();
|
|||||||
|
|
||||||
$app.methods.applyWorldDialogInstances = function () {
|
$app.methods.applyWorldDialogInstances = function () {
|
||||||
var D = this.worldDialog;
|
var D = this.worldDialog;
|
||||||
|
if (!D.visible) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var instances = {};
|
var instances = {};
|
||||||
for (var [id, occupants] of D.ref.instances) {
|
for (var [id, occupants] of D.ref.instances) {
|
||||||
instances[id] = {
|
instances[id] = {
|
||||||
@@ -14350,6 +14372,7 @@ speechSynthesis.getVoices();
|
|||||||
return b.users.length - a.users.length || b.occupants - a.occupants;
|
return b.users.length - a.users.length || b.occupants - a.occupants;
|
||||||
});
|
});
|
||||||
D.rooms = rooms;
|
D.rooms = rooms;
|
||||||
|
this.updateTimers();
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.worldDialogCommand = function (command) {
|
$app.methods.worldDialogCommand = function (command) {
|
||||||
@@ -18395,7 +18418,7 @@ speechSynthesis.getVoices();
|
|||||||
|
|
||||||
$app.methods.refreshInstancePlayerCount = function (instance) {
|
$app.methods.refreshInstancePlayerCount = function (instance) {
|
||||||
var L = API.parseLocation(instance);
|
var L = API.parseLocation(instance);
|
||||||
if (L.worldId) {
|
if (L.worldId && L.tag !== this.lastLocation.location) {
|
||||||
API.getInstance({
|
API.getInstance({
|
||||||
worldId: L.worldId,
|
worldId: L.worldId,
|
||||||
instanceId: L.instanceId
|
instanceId: L.instanceId
|
||||||
|
|||||||
+2
-2
@@ -1538,7 +1538,7 @@ html
|
|||||||
el-tooltip(placement="top" content="Invite yourself" :disabled="hideTooltips")
|
el-tooltip(placement="top" content="Invite yourself" :disabled="hideTooltips")
|
||||||
invite-yourself(:location="userDialog.ref.$location.tag" style="margin-left:5px")
|
invite-yourself(:location="userDialog.ref.$location.tag" style="margin-left:5px")
|
||||||
el-tooltip(placement="top" content="Refresh player count" :disabled="hideTooltips")
|
el-tooltip(placement="top" content="Refresh player count" :disabled="hideTooltips")
|
||||||
el-button(@click="refreshInstancePlayerCount(userDialog.ref.$location.tag)" size="mini" icon="el-icon-refresh" style="margin-left:5px" circle)
|
el-button(v-if="userDialog.ref.$location.tag !== lastLocation.location" @click="refreshInstancePlayerCount(userDialog.ref.$location.tag)" size="mini" icon="el-icon-refresh" style="margin-left:5px" circle)
|
||||||
span(v-if="userDialog.instance.occupants" style="margin-left:5px") {{ userDialog.instance.occupants }} #[template(v-if="userDialog.instance.friendCount > 0") ({{ userDialog.instance.friendCount }})]
|
span(v-if="userDialog.instance.occupants" style="margin-left:5px") {{ userDialog.instance.occupants }} #[template(v-if="userDialog.instance.friendCount > 0") ({{ userDialog.instance.friendCount }})]
|
||||||
.x-friend-list(style="flex:1;margin-top:10px;max-height:150px")
|
.x-friend-list(style="flex:1;margin-top:10px;max-height:150px")
|
||||||
.x-friend-item(v-if="userDialog.$location.userId" @click="showUserDialog(userDialog.$location.userId)" class="x-friend-item-border")
|
.x-friend-item(v-if="userDialog.$location.userId" @click="showUserDialog(userDialog.$location.userId)" class="x-friend-item-border")
|
||||||
@@ -1781,7 +1781,7 @@ html
|
|||||||
el-tooltip(placement="top" content="Invite yourself" :disabled="hideTooltips")
|
el-tooltip(placement="top" content="Invite yourself" :disabled="hideTooltips")
|
||||||
invite-yourself(:location="room.$location.tag" style="margin-left:5px")
|
invite-yourself(:location="room.$location.tag" style="margin-left:5px")
|
||||||
el-tooltip(placement="top" content="Refresh player count" :disabled="hideTooltips")
|
el-tooltip(placement="top" content="Refresh player count" :disabled="hideTooltips")
|
||||||
el-button(@click="refreshInstancePlayerCount(room.$location.tag)" size="mini" icon="el-icon-refresh" style="margin-left:5px" circle)
|
el-button(v-if="room.$location.tag !== lastLocation.location" @click="refreshInstancePlayerCount(room.$location.tag)" size="mini" icon="el-icon-refresh" style="margin-left:5px" circle)
|
||||||
span(v-if="room.occupants" style="margin-left:5px") {{ room.occupants }} #[template(v-if="room.friendCount > 0") ({{ room.friendCount }})]
|
span(v-if="room.occupants" style="margin-left:5px") {{ room.occupants }} #[template(v-if="room.friendCount > 0") ({{ room.friendCount }})]
|
||||||
.x-friend-list(style="margin:10px 0;max-height:unset" v-if="room.$location.userId || room.users.length")
|
.x-friend-list(style="margin:10px 0;max-height:unset" v-if="room.$location.userId || room.users.length")
|
||||||
.x-friend-item(v-if="room.$location.userId" @click="showUserDialog(room.$location.userId)" class="x-friend-item-border")
|
.x-friend-item(v-if="room.$location.userId" @click="showUserDialog(room.$location.userId)" class="x-friend-item-border")
|
||||||
|
|||||||
Reference in New Issue
Block a user