summaryrefslogtreecommitdiff
path: root/indra/newview/llinspectavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinspectavatar.cpp')
-rw-r--r--indra/newview/llinspectavatar.cpp77
1 files changed, 45 insertions, 32 deletions
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp
index a2b3a54f51..8f4fba244d 100644
--- a/indra/newview/llinspectavatar.cpp
+++ b/indra/newview/llinspectavatar.cpp
@@ -403,7 +403,8 @@ void LLInspectAvatar::updateModeratorPanel()
{
bool enable_moderator_panel = false;
- if (LLVoiceChannel::getCurrentVoiceChannel())
+ if (LLVoiceChannel::getCurrentVoiceChannel() &&
+ mAvatarID != gAgent.getID())
{
LLUUID session_id = LLVoiceChannel::getCurrentVoiceChannel()->getSessionID();
@@ -514,46 +515,58 @@ void LLInspectAvatar::toggleSelectedVoice(bool enabled)
void LLInspectAvatar::updateVolumeSlider()
{
- // By convention, we only display and toggle voice mutes, not all mutes
- bool is_muted = LLMuteList::getInstance()->
- isMuted(mAvatarID, LLMute::flagVoiceChat);
- bool voice_enabled = gVoiceClient->getVoiceEnabled(mAvatarID);
- bool is_self = (mAvatarID == gAgent.getID());
-
- LLUICtrl* mute_btn = getChild<LLUICtrl>("mute_btn");
- mute_btn->setEnabled( voice_enabled );
- mute_btn->setValue( is_muted );
- mute_btn->setVisible( voice_enabled && !is_self );
- LLUICtrl* volume_slider = getChild<LLUICtrl>("volume_slider");
- volume_slider->setEnabled( voice_enabled && !is_muted );
- volume_slider->setVisible( voice_enabled && !is_self );
+ bool voice_enabled = gVoiceClient->getVoiceEnabled(mAvatarID);
- const F32 DEFAULT_VOLUME = 0.5f;
- F32 volume;
- if (is_muted)
- {
- // it's clearer to display their volume as zero
- volume = 0.f;
- }
- else if (!voice_enabled)
+ // Do not display volume slider and mute button if it
+ // is ourself or we are not in a voice channel together
+ if (!voice_enabled || (mAvatarID == gAgent.getID()))
{
- // use nominal value rather than 0
- volume = DEFAULT_VOLUME;
+ getChild<LLUICtrl>("mute_btn")->setVisible(false);
+ getChild<LLUICtrl>("volume_slider")->setVisible(false);
}
- else
+
+ else
{
- // actual volume
- volume = gVoiceClient->getUserVolume(mAvatarID);
+ getChild<LLUICtrl>("mute_btn")->setVisible(true);
+ getChild<LLUICtrl>("volume_slider")->setVisible(true);
+
+ // By convention, we only display and toggle voice mutes, not all mutes
+ bool is_muted = LLMuteList::getInstance()->
+ isMuted(mAvatarID, LLMute::flagVoiceChat);
- // *HACK: Voice client doesn't have any data until user actually
- // says something.
- if (volume == 0.f)
+ LLUICtrl* mute_btn = getChild<LLUICtrl>("mute_btn");
+
+ bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden");
+
+ mute_btn->setEnabled( !is_linden);
+ mute_btn->setValue( is_muted );
+
+ LLUICtrl* volume_slider = getChild<LLUICtrl>("volume_slider");
+ volume_slider->setEnabled( !is_muted );
+
+ const F32 DEFAULT_VOLUME = 0.5f;
+ F32 volume;
+ if (is_muted)
+ {
+ // it's clearer to display their volume as zero
+ volume = 0.f;
+ }
+ else
{
- volume = DEFAULT_VOLUME;
+ // actual volume
+ volume = gVoiceClient->getUserVolume(mAvatarID);
+
+ // *HACK: Voice client doesn't have any data until user actually
+ // says something.
+ if (volume == 0.f)
+ {
+ volume = DEFAULT_VOLUME;
+ }
}
+ volume_slider->setValue( (F64)volume );
}
- volume_slider->setValue( (F64)volume );
+
}
void LLInspectAvatar::onClickMuteVolume()