Merge branch 'Moap' of git://github.com/Shyotl/SingularityViewer into VoiceUpdate

Conflicts:
	indra/newview/lloverlaybar.cpp - Shyotl did some caching, VoiceUpdate turned LLVoiceClient::voiceEnabled non-static.
	indra/newview/llvoiceclient.cpp - Change actually belongs in llvoicevivox.cpp
This commit is contained in:
Lirusaito
2013-06-26 04:43:46 -04:00
5 changed files with 57 additions and 69 deletions

View File

@@ -263,8 +263,8 @@ void LLLayoutStack::draw()
// only force drawing invisible children if visible amount is non-zero
drawChild(panelp, 0, 0, !clip_rect.isEmpty());
//if (sDebugRects)
/*{
if (sDebugRects)
{
LLUI::pushMatrix();
{
// drawing solids requires texturing be disabled
@@ -280,11 +280,11 @@ void LLLayoutStack::draw()
}
}
LLUI::popMatrix();
}*/
}
}
}
//if (sDebugRects)
/*{
if (sDebugRects)
{
drawDebugRect();
// Check for bogus rectangle
@@ -292,7 +292,7 @@ void LLLayoutStack::draw()
{
llwarns << "Bogus rectangle for " << getName() << " with " << getRect() << llendl;
}
}*/
}
}
void LLLayoutStack::removeChild(LLView* view)

View File

@@ -509,7 +509,7 @@ void LLChatBar::sendChat( EChatType type )
// static
void LLChatBar::startChat(const char* line)
{
gChatBar->setVisible(TRUE);
gChatBar->getParent()->setVisible(TRUE);
gChatBar->setKeyboardFocus(TRUE);
gSavedSettings.setBOOL("ChatVisible", TRUE);
@@ -540,7 +540,7 @@ void LLChatBar::stopChat()
gAgent.stopTyping();
// hide chat bar so it doesn't grab focus back
gChatBar->setVisible(FALSE);
gChatBar->getParent()->setVisible(FALSE);
gSavedSettings.setBOOL("ChatVisible", FALSE);
}

View File

@@ -87,11 +87,6 @@
LLOverlayBar *gOverlayBar = NULL;
extern S32 MENU_BAR_HEIGHT;
extern ImportTracker gImportTracker;
BOOL LLOverlayBar::sChatVisible;
//
// Functions
//
@@ -153,33 +148,30 @@ LLOverlayBar::LLOverlayBar()
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml", &factory_map);
}
bool LLOverlayBar::updateAdvSettingsPopup()
bool LLOverlayBar::updateAdvSettingsPopup(const LLSD &data)
{
bool wfl_adv_settings_popup = gSavedSettings.getBOOL("wlfAdvSettingsPopup");
bool wfl_adv_settings_popup = data.asBoolean();
wlfPanel_AdvSettings::updateClass();
if(LLLayoutStack* layout_stack = findChild<LLLayoutStack>("overlay_layout_panel"))
LLLayoutPanel* layout_panel = dynamic_cast<LLLayoutPanel*>((LLPanel*)mAdvSettingsContainer);
if(layout_panel)
{
LLLayoutPanel* layout_panel = layout_stack->findChild<LLLayoutPanel>("AdvSettings_container");
if(layout_panel)
{
layout_stack->collapsePanel(layout_panel,!wfl_adv_settings_popup);
if(wfl_adv_settings_popup)
layout_panel->setTargetDim(layout_panel->getChild<LLView>("Adv_Settings")->getBoundingRect().getWidth());
}
((LLLayoutStack*)layout_panel->getParent())->collapsePanel(layout_panel,!wfl_adv_settings_popup);
if(wfl_adv_settings_popup)
layout_panel->setTargetDim(layout_panel->getChild<LLView>("Adv_Settings")->getBoundingRect().getWidth());
}
return true;
}
bool updateChatVisible(const LLSD &data)
bool LLOverlayBar::updateChatVisible(const LLSD &data)
{
LLOverlayBar::sChatVisible = data.asBoolean();
mChatBar->getParent()->setVisible(data.asBoolean());
return true;
}
bool updateAORemote(const LLSD &data)
bool LLOverlayBar::updateAORemoteVisible(const LLSD &data)
{
gOverlayBar->childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote"));
mAORemoteContainer->setVisible(data.asBoolean());
return true;
}
@@ -189,6 +181,7 @@ bool updateNearbyMediaFloater(const LLSD &data)
return true;
}
BOOL LLOverlayBar::postBuild()
{
childSetAction("New IM",onClickIMReceived,this);
@@ -197,12 +190,13 @@ BOOL LLOverlayBar::postBuild()
childSetAction("Stand Up",onClickStandUp,this);
childSetAction("Cancel TP",onClickCancelTP,this);
childSetAction("Flycam",onClickFlycam,this);
childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible"));
mCancelBtn = getChild<LLButton>("Cancel TP");
setFocusRoot(TRUE);
mBuilt = true;
mUnreadCountStringPlural = getString("unread_count_string_plural");
mChatbarAndButtons.connect(this,"chatbar_and_buttons");
mNewIM.connect(this,"New IM");
mNotBusy.connect(this,"Set Not Busy");
@@ -211,21 +205,27 @@ BOOL LLOverlayBar::postBuild()
mFlyCam.connect(this,"Flycam");
mChatBar.connect(this,"chat_bar");
mVoiceRemoteContainer.connect(this,"voice_remote_container");
mStateManagementContainer.connect(this,"state_management_buttons_container");
mAORemoteContainer.connect(this,"ao_remote_container");
mAdvSettingsContainer.connect(this,"AdvSettings_container");
mMediaRemoteContainer.connect(this,"media_remote_container");
updateAdvSettingsPopup(gSavedSettings.getBOOL("wlfAdvSettingsPopup"));
updateChatVisible(gSavedSettings.getBOOL("ChatVisible"));
updateAORemoteVisible(gSavedSettings.getBOOL("EnableAORemote"));
mOriginalIMLabel = mNewIM->getLabelSelected();
layoutButtons();
sChatVisible = gSavedSettings.getBOOL("ChatVisible");
gSavedSettings.getControl("wlfAdvSettingsPopup")->getSignal()->connect(boost::bind(&LLOverlayBar::updateAdvSettingsPopup,this));
gSavedSettings.getControl("ChatVisible")->getSignal()->connect(boost::bind(&updateChatVisible,_2));
gSavedSettings.getControl("EnableAORemote")->getSignal()->connect(boost::bind(&updateAORemote,_2));
gSavedSettings.getControl("wlfAdvSettingsPopup")->getSignal()->connect(boost::bind(&LLOverlayBar::updateAdvSettingsPopup,this,_2));
gSavedSettings.getControl("ChatVisible")->getSignal()->connect(boost::bind(&LLOverlayBar::updateChatVisible,this,_2));
gSavedSettings.getControl("EnableAORemote")->getSignal()->connect(boost::bind(&LLOverlayBar::updateAORemoteVisible,this,_2));
gSavedSettings.getControl("ShowNearbyMediaFloater")->getSignal()->connect(boost::bind(&updateNearbyMediaFloater,_2));
childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote"));
mAORemoteContainer->setVisible(gSavedSettings.getBOOL("EnableAORemote"));
updateAdvSettingsPopup();
return TRUE;
}
@@ -254,12 +254,10 @@ void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent)
void LLOverlayBar::layoutButtons()
{
LLView* state_buttons_panel = getChildView("state_management_buttons_container");
if (state_buttons_panel->getVisible())
if (mStateManagementContainer->getVisible())
{
U32 button_count = 0;
const child_list_t& view_list = *(state_buttons_panel->getChildList());
const child_list_t& view_list = *(mStateManagementContainer->getChildList());
BOOST_FOREACH(LLView* viewp, view_list)
{
if(!viewp->getEnabled())
@@ -267,7 +265,7 @@ void LLOverlayBar::layoutButtons()
++button_count;
}
const S32 MAX_BAR_WIDTH = 600;
S32 bar_width = llclamp(state_buttons_panel->getRect().getWidth(), 0, MAX_BAR_WIDTH);
S32 bar_width = llclamp(mStateManagementContainer->getRect().getWidth(), 0, MAX_BAR_WIDTH);
// calculate button widths
const S32 MAX_BUTTON_WIDTH = 150;
@@ -318,7 +316,7 @@ void LLOverlayBar::refresh()
if (unread_count > 1)
{
std::stringstream ss;
ss << unread_count << " " << getString("unread_count_string_plural");
ss << unread_count << " " << mUnreadCountStringPlural;
button->setLabel(ss.str());
}
else
@@ -349,31 +347,17 @@ void LLOverlayBar::refresh()
if(last_mouselook != in_mouselook)
{
last_mouselook = in_mouselook;
if (in_mouselook)
{
childSetVisible("media_remote_container", FALSE);
childSetVisible("voice_remote_container", FALSE);
childSetVisible("AdvSettings_container", FALSE);
childSetVisible("ao_remote_container", FALSE);
childSetVisible("state_management_buttons_container", FALSE);
}
else
{
// update "remotes"
childSetVisible("media_remote_container", TRUE);
childSetVisible("voice_remote_container", LLVoiceClient::getInstance()->voiceEnabled());
childSetVisible("AdvSettings_container", TRUE);
childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote"));
childSetVisible("state_management_buttons_container", TRUE);
}
static const LLCachedControl<bool> enable_ao_remote("EnableAORemote", true);
mMediaRemoteContainer->setVisible(!in_mouselook);
mVoiceRemoteContainer->setVisible(!in_mouselook && LLVoiceClient::getInstance()->voiceEnabled());
mAdvSettingsContainer->setVisible(!in_mouselook);
mAORemoteContainer->setVisible(!in_mouselook && enable_ao_remote);
mStateManagementContainer->setVisible(!in_mouselook);
}
if(!in_mouselook)
mVoiceRemoteContainer->setVisible(LLVoiceClient::getInstance()->voiceEnabled());
// always let user toggle into and out of chatbar
static const LLCachedControl<bool> chat_visible("ChatVisible",true);
mChatBar->setVisible(chat_visible);
if (buttons_changed)
{
layoutButtons();

View File

@@ -98,7 +98,6 @@ public:
void setCancelTPButtonVisible(BOOL b, const std::string& label);
static BOOL sChatVisible;
protected:
static void* createMediaRemote(void* userdata);
static void* createVoiceRemote(void* userdata);
@@ -118,6 +117,7 @@ protected:
enum { STOPPED=0, PLAYING=1, PAUSED=2 };
S32 mMusicState;
std::string mOriginalIMLabel;
std::string mUnreadCountStringPlural;
CachedUICtrl<LLView> mChatbarAndButtons;
CachedUICtrl<LLButton> mNewIM;
@@ -127,12 +127,14 @@ protected:
CachedUICtrl<LLButton> mFlyCam;
CachedUICtrl<LLChatBar> mChatBar;
CachedUICtrl<LLPanel> mVoiceRemoteContainer;
CachedUICtrl<LLPanel> mStateManagementContainer;
CachedUICtrl<LLPanel> mAORemoteContainer;
CachedUICtrl<LLPanel> mAdvSettingsContainer;
CachedUICtrl<LLPanel> mMediaRemoteContainer;
private:
bool updateAdvSettingsPopup();
//static void updateChatVisible(const LLSD &data);
bool updateChatVisible(const LLSD &data);
bool updateAORemoteVisible(const LLSD &data);
bool updateAdvSettingsPopup(const LLSD &data);
};
extern LLOverlayBar* gOverlayBar;

View File

@@ -5320,7 +5320,9 @@ void LLVivoxVoiceClient::setVoiceEnabled(bool enabled)
bool LLVivoxVoiceClient::voiceEnabled()
{
return gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice");
static const LLCachedControl<bool> enable_voice_chat("EnableVoiceChat",true);
static const LLCachedControl<bool> cmdline_disable_voice("CmdLineDisableVoice",false);
return enable_voice_chat && !cmdline_disable_voice;
}
void LLVivoxVoiceClient::setLipSyncEnabled(BOOL enabled)