mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:37:17 +02:00
cr feedback, plus something I missed
This commit is contained in:
parent
678020fed6
commit
efe44425a6
4 changed files with 9 additions and 25 deletions
|
@ -345,7 +345,7 @@ Item {
|
||||||
anchors.verticalCenter: nameCardVUMeter.verticalCenter
|
anchors.verticalCenter: nameCardVUMeter.verticalCenter
|
||||||
// Properties
|
// Properties
|
||||||
visible: !isMyCard && selected
|
visible: !isMyCard && selected
|
||||||
value: pal.gainSliderValueDB[uuid] ? pal.gainSliderValueDB[uuid] : Users.getAvatarGain(uuid)
|
value: Users.getAvatarGain(uuid)
|
||||||
minimumValue: -60.0
|
minimumValue: -60.0
|
||||||
maximumValue: 20.0
|
maximumValue: 20.0
|
||||||
stepSize: 5
|
stepSize: 5
|
||||||
|
@ -393,14 +393,9 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateGainFromQML(avatarUuid, sliderValue, isReleased) {
|
function updateGainFromQML(avatarUuid, sliderValue, isReleased) {
|
||||||
if (isReleased || pal.gainSliderValueDB[avatarUuid] !== sliderValue) {
|
Users.setAvatarGain(avatarUuid, sliderValue);
|
||||||
pal.gainSliderValueDB[avatarUuid] = sliderValue;
|
if (isReleased) {
|
||||||
var data = {
|
UserActivityLogger.palAction("avatar_gain_changed", avatarUuid);
|
||||||
sessionId: avatarUuid,
|
|
||||||
gain: sliderValue,
|
|
||||||
isReleased: isReleased
|
|
||||||
};
|
|
||||||
pal.sendToScript({method: 'updateGain', params: data});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,9 +37,6 @@ Rectangle {
|
||||||
property var ignored: ({}); // Keep a local list of ignored avatars & their data. Necessary because HashMap is slow to respond after ignoring.
|
property var ignored: ({}); // Keep a local list of ignored avatars & their data. Necessary because HashMap is slow to respond after ignoring.
|
||||||
property var userModelData: [] // This simple list is essentially a mirror of the userModel listModel without all the extra complexities.
|
property var userModelData: [] // This simple list is essentially a mirror of the userModel listModel without all the extra complexities.
|
||||||
property bool iAmAdmin: false
|
property bool iAmAdmin: false
|
||||||
// Keep a local list of per-avatar gainSliderValueDBs. Far faster than fetching this data from the server.
|
|
||||||
// NOTE: if another script modifies the per-avatar gain, this value won't be accurate!
|
|
||||||
property var gainSliderValueDB: ({});
|
|
||||||
|
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
|
@ -556,7 +553,6 @@ Rectangle {
|
||||||
break;
|
break;
|
||||||
case 'clearLocalQMLData':
|
case 'clearLocalQMLData':
|
||||||
ignored = {};
|
ignored = {};
|
||||||
gainSliderValueDB = {};
|
|
||||||
break;
|
break;
|
||||||
case 'avatarDisconnected':
|
case 'avatarDisconnected':
|
||||||
var sessionID = message.params[0];
|
var sessionID = message.params[0];
|
||||||
|
|
|
@ -252,6 +252,11 @@ void NodeList::reset() {
|
||||||
_personalMutedNodeIDs.clear();
|
_personalMutedNodeIDs.clear();
|
||||||
_personalMutedSetLock.unlock();
|
_personalMutedSetLock.unlock();
|
||||||
|
|
||||||
|
// lock and clear out set of avatarGains
|
||||||
|
_avatarGainMapLock.lockForWrite();
|
||||||
|
_avatarGainMap.clear();
|
||||||
|
_avatarGainMapLock.unlock();
|
||||||
|
|
||||||
// refresh the owner UUID to the NULL UUID
|
// refresh the owner UUID to the NULL UUID
|
||||||
setSessionUUID(QUuid());
|
setSessionUUID(QUuid());
|
||||||
|
|
||||||
|
|
|
@ -245,18 +245,6 @@ function fromQml(message) { // messages are {method, params}, like json-rpc. See
|
||||||
populateUserList(message.params.selected);
|
populateUserList(message.params.selected);
|
||||||
UserActivityLogger.palAction("refresh", "");
|
UserActivityLogger.palAction("refresh", "");
|
||||||
break;
|
break;
|
||||||
case 'updateGain':
|
|
||||||
data = message.params;
|
|
||||||
if (data['isReleased']) {
|
|
||||||
// isReleased=true happens once at the end of a cycle of dragging
|
|
||||||
// the slider about, but with same gain as last isReleased=false so
|
|
||||||
// we don't set the gain in that case, and only here do we want to
|
|
||||||
// send an analytic event.
|
|
||||||
UserActivityLogger.palAction("avatar_gain_changed", data['sessionId']);
|
|
||||||
} else {
|
|
||||||
Users.setAvatarGain(data['sessionId'], data['gain']);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'displayNameUpdate':
|
case 'displayNameUpdate':
|
||||||
if (MyAvatar.displayName !== message.params) {
|
if (MyAvatar.displayName !== message.params) {
|
||||||
MyAvatar.displayName = message.params;
|
MyAvatar.displayName = message.params;
|
||||||
|
|
Loading…
Reference in a new issue