mirror of
https://github.com/overte-org/overte.git
synced 2025-04-17 14:46:40 +02:00
Only update gain if it really changed
and only fire UserActivity if we really do change the gain
This commit is contained in:
parent
90b0bd333f
commit
3b7d1cb6cf
1 changed files with 9 additions and 4 deletions
|
@ -526,12 +526,15 @@ Item {
|
|||
anchors.left: nameCardVUMeter.left;
|
||||
// Properties
|
||||
visible: (isMyCard || (selected && pal.activeTab == "nearbyTab")) && isPresent;
|
||||
value: Users.getAvatarGain(uuid)
|
||||
minimumValue: -60.0
|
||||
maximumValue: 20.0
|
||||
stepSize: 5
|
||||
updateValueWhileDragging: true
|
||||
Component.onCompleted: {
|
||||
value = Users.getAvatarGain(uuid);
|
||||
}
|
||||
onValueChanged: {
|
||||
console.log("onValueChanged:" + uuid + ", value="+value);
|
||||
updateGainFromQML(uuid, value, false);
|
||||
}
|
||||
onPressedChanged: {
|
||||
|
@ -587,9 +590,11 @@ Item {
|
|||
}
|
||||
|
||||
function updateGainFromQML(avatarUuid, sliderValue, isReleased) {
|
||||
Users.setAvatarGain(avatarUuid, sliderValue);
|
||||
if (isReleased) {
|
||||
UserActivityLogger.palAction("avatar_gain_changed", avatarUuid);
|
||||
if (Users.getAvatarGain(avatarUuid) != sliderValue) {
|
||||
Users.setAvatarGain(avatarUuid, sliderValue);
|
||||
if (isReleased) {
|
||||
UserActivityLogger.palAction("avatar_gain_changed", avatarUuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue