mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
preserve audio data during pal refresh
This commit is contained in:
parent
aaec6ce9f7
commit
15d680d4f9
1 changed files with 9 additions and 4 deletions
|
@ -248,12 +248,16 @@ function fromQml(message) { // messages are {method, params}, like json-rpc. See
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'refresh':
|
case 'refresh':
|
||||||
|
data = {};
|
||||||
|
ExtendedOverlay.some(function (overlay) { // capture the audio data
|
||||||
|
data[overlay.key] = overlay;
|
||||||
|
});
|
||||||
removeOverlays();
|
removeOverlays();
|
||||||
// If filter is specified from .qml instead of through settings, update the settings.
|
// If filter is specified from .qml instead of through settings, update the settings.
|
||||||
if (message.params.filter !== undefined) {
|
if (message.params.filter !== undefined) {
|
||||||
Settings.setValue('pal/filtered', !!message.params.filter);
|
Settings.setValue('pal/filtered', !!message.params.filter);
|
||||||
}
|
}
|
||||||
populateUserList(message.params.selected);
|
populateUserList(message.params.selected, data);
|
||||||
UserActivityLogger.palAction("refresh", "");
|
UserActivityLogger.palAction("refresh", "");
|
||||||
break;
|
break;
|
||||||
case 'displayNameUpdate':
|
case 'displayNameUpdate':
|
||||||
|
@ -285,7 +289,7 @@ function addAvatarNode(id) {
|
||||||
}
|
}
|
||||||
// Each open/refresh will capture a stable set of avatarsOfInterest, within the specified filter.
|
// Each open/refresh will capture a stable set of avatarsOfInterest, within the specified filter.
|
||||||
var avatarsOfInterest = {};
|
var avatarsOfInterest = {};
|
||||||
function populateUserList(selectData) {
|
function populateUserList(selectData, oldAudioData) {
|
||||||
var filter = Settings.getValue('pal/filtered') && {distance: Settings.getValue('pal/nearDistance')};
|
var filter = Settings.getValue('pal/filtered') && {distance: Settings.getValue('pal/nearDistance')};
|
||||||
var data = [], avatars = AvatarList.getAvatarIdentifiers();
|
var data = [], avatars = AvatarList.getAvatarIdentifiers();
|
||||||
avatarsOfInterest = {};
|
avatarsOfInterest = {};
|
||||||
|
@ -317,12 +321,13 @@ function populateUserList(selectData) {
|
||||||
if (id && filter && ((Math.abs(horizontal) > horizontalHalfAngle) || (Math.abs(vertical) > verticalHalfAngle))) {
|
if (id && filter && ((Math.abs(horizontal) > horizontalHalfAngle) || (Math.abs(vertical) > verticalHalfAngle))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var oldAudio = oldAudioData && oldAudioData[id];
|
||||||
var avatarPalDatum = {
|
var avatarPalDatum = {
|
||||||
displayName: name,
|
displayName: name,
|
||||||
userName: '',
|
userName: '',
|
||||||
sessionId: id || '',
|
sessionId: id || '',
|
||||||
audioLevel: 0.0,
|
audioLevel: (oldAudio && oldAudio.audioLevel) || 0.0,
|
||||||
avgAudioLevel: 0.0,
|
avgAudioLevel: (oldAudio && oldAudio.avgAudioLevel) || 0.0,
|
||||||
admin: false,
|
admin: false,
|
||||||
personalMute: !!id && Users.getPersonalMuteStatus(id), // expects proper boolean, not null
|
personalMute: !!id && Users.getPersonalMuteStatus(id), // expects proper boolean, not null
|
||||||
ignore: !!id && Users.getIgnoreStatus(id) // ditto
|
ignore: !!id && Users.getIgnoreStatus(id) // ditto
|
||||||
|
|
Loading…
Reference in a new issue