mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 00:17:25 +02:00
Merge pull request #9064 from birarda/mod-overlay-cleanup
fix kick and mute overlay cleanup
This commit is contained in:
commit
3d5a178a1d
1 changed files with 8 additions and 8 deletions
|
@ -137,10 +137,10 @@ function updateOverlays() {
|
||||||
isFacingAvatar: true,
|
isFacingAvatar: true,
|
||||||
drawInFront: true
|
drawInFront: true
|
||||||
});
|
});
|
||||||
|
|
||||||
modOverlays[avatarID]=[newKickOverlay];
|
modOverlays[avatarID]=[newKickOverlay];
|
||||||
|
|
||||||
if (Users.canKick) {
|
if (Users.canKick) {
|
||||||
var newMuteOverlay = Overlays.addOverlay("image3d", {
|
var newMuteOverlay = Overlays.addOverlay("image3d", {
|
||||||
url: muteOverlayURL(),
|
url: muteOverlayURL(),
|
||||||
position: muteOverlayPosition,
|
position: muteOverlayPosition,
|
||||||
|
@ -166,11 +166,11 @@ AvatarList.avatarRemovedEvent.connect(function(avatarID){
|
||||||
if (isShowingOverlays) {
|
if (isShowingOverlays) {
|
||||||
// we are currently showing overlays and an avatar just went away
|
// we are currently showing overlays and an avatar just went away
|
||||||
|
|
||||||
// first remove the rendered overlay
|
// first remove the rendered overlays
|
||||||
for (var overlay in modOverlays[avatarID]) {
|
for (var j = 0; j < modOverlays[avatarID].length; ++j) {
|
||||||
Overlays.deleteOverlay(overlay);
|
Overlays.deleteOverlay(modOverlays[avatarID][j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete the saved ID of the overlay from our mod overlays object
|
// delete the saved ID of the overlay from our mod overlays object
|
||||||
delete modOverlays[avatarID];
|
delete modOverlays[avatarID];
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ function handleSelectedOverlay(clickedOverlay) {
|
||||||
Users.ignore(avatarID);
|
Users.ignore(avatarID);
|
||||||
}
|
}
|
||||||
// cleanup of the overlay is handled by the connection to avatarRemovedEvent
|
// cleanup of the overlay is handled by the connection to avatarRemovedEvent
|
||||||
|
|
||||||
} else if (muteOverlay && clickedOverlay.overlayID == muteOverlay) {
|
} else if (muteOverlay && clickedOverlay.overlayID == muteOverlay) {
|
||||||
Users.mute(avatarID);
|
Users.mute(avatarID);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue