summaryrefslogtreecommitdiff
path: root/indra/newview/llstatusbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
-rw-r--r--indra/newview/llstatusbar.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 9206b4a43a..ac419d8dc7 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -36,10 +36,12 @@
// viewer includes
#include "llagent.h"
+#include "llagentcamera.h"
#include "llbutton.h"
#include "llcommandhandler.h"
#include "llviewercontrol.h"
#include "llfloaterbuycurrency.h"
+#include "llbuycurrencyhtml.h"
#include "llfloaterlagmeter.h"
#include "llpanelnearbymedia.h"
#include "llpanelvolumepulldown.h"
@@ -313,7 +315,7 @@ void LLStatusBar::refresh()
childSetVisible("scriptout", false);
}
- if (gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK &&
+ if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK &&
((region && region->getAllowDamage()) || (parcel && parcel->getAllowDamage())))
{
// set visibility based on flashing
@@ -371,6 +373,8 @@ void LLStatusBar::setVisibleForMouselook(bool visible)
mTextTime->setVisible(visible);
getChild<LLUICtrl>("buycurrency")->setVisible(visible);
getChild<LLUICtrl>("buyL")->setVisible(visible);
+ mBtnVolume->setVisible(visible);
+ mMediaToggle->setVisible(visible);
mSGBandwidth->setVisible(visible);
mSGPacketLoss->setVisible(visible);
setBackgroundVisible(visible);
@@ -390,18 +394,21 @@ void LLStatusBar::setBalance(S32 balance)
{
std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance );
- LLButton* btn_buy_currency = getChild<LLButton>("buycurrency");
+ LLTextBox* balance_box = getChild<LLTextBox>("balance");
LLStringUtil::format_map_t string_args;
string_args["[AMT]"] = llformat("%s", money_str.c_str());
std::string label_str = getString("buycurrencylabel", string_args);
- btn_buy_currency->setLabel(label_str);
+ balance_box->setValue(label_str);
- // Resize the balance button so that the label fits it, and the button expands to the left.
- // *TODO: LLButton should have an option where to expand.
+ // Resize the L$ balance background to be wide enough for your balance plus the buy button
{
- S32 saved_right = btn_buy_currency->getRect().mRight;
- btn_buy_currency->autoResize();
- btn_buy_currency->translate(saved_right - btn_buy_currency->getRect().mRight, 0);
+ const S32 HPAD = 24;
+ LLRect balance_rect = balance_box->getTextBoundingRect();
+ LLRect buy_rect = getChildView("buyL")->getRect();
+ LLView* balance_bg_view = getChildView("balance_bg");
+ LLRect balance_bg_rect = balance_bg_view->getRect();
+ balance_bg_rect.mLeft = balance_bg_rect.mRight - (buy_rect.getWidth() + balance_rect.getWidth() + HPAD);
+ balance_bg_view->setShape(balance_bg_rect);
}
if (mBalance && (fabs((F32)(mBalance - balance)) > gSavedSettings.getF32("UISndMoneyChangeThreshold")))
@@ -444,11 +451,9 @@ void LLStatusBar::setHealth(S32 health)
{
if (mHealth > (health + gSavedSettings.getF32("UISndHealthReductionThreshold")))
{
- LLVOAvatar *me;
-
- if ((me = gAgent.getAvatarObject()))
+ if (isAgentAvatarValid())
{
- if (me->getSex() == SEX_FEMALE)
+ if (gAgentAvatarp->getSex() == SEX_FEMALE)
{
make_ui_sound("UISndHealthReductionF");
}
@@ -508,7 +513,9 @@ S32 LLStatusBar::getSquareMetersLeft() const
void LLStatusBar::onClickBuyCurrency()
{
- LLFloaterBuyCurrency::buyCurrency();
+ // open a currency floater - actual one open depends on
+ // value specified in settings.xml
+ LLBuyCurrencyHTML::openCurrencyFloater();
}
static void onClickHealth(void* )