From 4bef4f94c0ec89ef7b14bc267f52ba00a6dcdc2b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 4 Aug 2023 00:44:07 +0300 Subject: SL-18049 Part 3; Better indication when voice is muted --- indra/newview/llstatusbar.cpp | 24 +++++++++++++++++++++ indra/newview/llstatusbar.h | 2 +- .../skins/default/textures/icons/VoiceMute_Off.png | Bin 0 -> 753 bytes indra/newview/skins/default/textures/textures.xml | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 indra/newview/skins/default/textures/icons/VoiceMute_Off.png (limited to 'indra') diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 0a87b14e17..a9ec4ffbb4 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -66,6 +66,7 @@ #include "llviewermenu.h" // for gMenuBarView #include "llviewerparcelmgr.h" #include "llviewerthrottle.h" +#include "llvoiceclient.h" #include "lluictrlfactory.h" #include "lltoolmgr.h" @@ -190,6 +191,16 @@ BOOL LLStatusBar::postBuild() LLHints::getInstance()->registerHintTarget("linden_balance", getChild("balance_bg")->getHandle()); gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); + gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&LLStatusBar::onVoiceChanged, this, _2)); + + if (gSavedSettings.getBOOL("EnableVoiceChat") && !LLVoiceClient::isMutedVoiceInstance()) + { + mBtnVolume->setImageUnselected(LLUI::getUIImage("Audio_Off")); + } + else + { + mBtnVolume->setImageUnselected(LLUI::getUIImage("VoiceMute_Off")); + } // Adding Net Stat Graph S32 x = getRect().getWidth() - 2; @@ -640,6 +651,19 @@ void LLStatusBar::onVolumeChanged(const LLSD& newvalue) refresh(); } +void LLStatusBar::onVoiceChanged(const LLSD& newvalue) +{ + if (newvalue.asBoolean() && !LLVoiceClient::isMutedVoiceInstance()) + { + mBtnVolume->setImageUnselected(LLUI::getUIImage("Audio_Off")); + } + else + { + mBtnVolume->setImageUnselected(LLUI::getUIImage("VoiceMute_Off")); + } + refresh(); +} + void LLStatusBar::onUpdateFilterTerm() { LLWString searchValue = utf8str_to_wstring( mFilterEdit->getValue() ); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 3002b91c10..3e9190652d 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -99,12 +99,12 @@ private: void onClickBuyCurrency(); void onVolumeChanged(const LLSD& newvalue); + void onVoiceChanged(const LLSD& newvalue); void onMouseEnterPresetsCamera(); void onMouseEnterPresets(); void onMouseEnterVolume(); void onMouseEnterNearbyMedia(); - void onClickScreen(S32 x, S32 y); static void onClickMediaToggle(void* data); static void onClickBalance(void* data); diff --git a/indra/newview/skins/default/textures/icons/VoiceMute_Off.png b/indra/newview/skins/default/textures/icons/VoiceMute_Off.png new file mode 100644 index 0000000000..425ba267a5 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/VoiceMute_Off.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 21335bf6c3..d237ddd518 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -63,6 +63,7 @@ with the same filename but different name + -- cgit v1.2.3