Skip to content
Snippets Groups Projects
Commit 4813b8b9 authored by James Cook's avatar James Cook
Browse files

EXT-4304 Clicking on "Buy L$" in nav bar does nothing

Now it buys currency.
Also fixes EXT-4176, same issue
Reviewed with Richard.
parent 402d2e7c
No related branches found
No related tags found
No related merge requests found
...@@ -122,7 +122,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect) ...@@ -122,7 +122,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
mTextTime(NULL), mTextTime(NULL),
mSGBandwidth(NULL), mSGBandwidth(NULL),
mSGPacketLoss(NULL), mSGPacketLoss(NULL),
mBtnBuyCurrency(NULL),
mBtnVolume(NULL), mBtnVolume(NULL),
mBalance(0), mBalance(0),
mHealth(100), mHealth(100),
...@@ -153,8 +152,10 @@ LLStatusBar::LLStatusBar(const LLRect& rect) ...@@ -153,8 +152,10 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
mTextHealth = getChild<LLTextBox>("HealthText" ); mTextHealth = getChild<LLTextBox>("HealthText" );
mTextTime = getChild<LLTextBox>("TimeText" ); mTextTime = getChild<LLTextBox>("TimeText" );
mBtnBuyCurrency = getChild<LLButton>( "buycurrency" ); getChild<LLUICtrl>("buycurrency")->setCommitCallback(
mBtnBuyCurrency->setClickedCallback( onClickBuyCurrency, this ); boost::bind(&LLStatusBar::onClickBuyCurrency, this));
getChild<LLUICtrl>("buyL")->setCommitCallback(
boost::bind(&LLStatusBar::onClickBuyCurrency, this));
mBtnVolume = getChild<LLButton>( "volume_btn" ); mBtnVolume = getChild<LLButton>( "volume_btn" );
mBtnVolume->setClickedCallback( onClickVolume, this ); mBtnVolume->setClickedCallback( onClickVolume, this );
...@@ -362,7 +363,8 @@ void LLStatusBar::refresh() ...@@ -362,7 +363,8 @@ void LLStatusBar::refresh()
void LLStatusBar::setVisibleForMouselook(bool visible) void LLStatusBar::setVisibleForMouselook(bool visible)
{ {
mTextTime->setVisible(visible); mTextTime->setVisible(visible);
mBtnBuyCurrency->setVisible(visible); getChild<LLUICtrl>("buycurrency")->setVisible(visible);
getChild<LLUICtrl>("buyL")->setVisible(visible);
mSGBandwidth->setVisible(visible); mSGBandwidth->setVisible(visible);
mSGPacketLoss->setVisible(visible); mSGPacketLoss->setVisible(visible);
setBackgroundVisible(visible); setBackgroundVisible(visible);
...@@ -382,17 +384,18 @@ void LLStatusBar::setBalance(S32 balance) ...@@ -382,17 +384,18 @@ void LLStatusBar::setBalance(S32 balance)
{ {
std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance ); std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance );
LLButton* btn_buy_currency = getChild<LLButton>("buycurrency");
LLStringUtil::format_map_t string_args; LLStringUtil::format_map_t string_args;
string_args["[AMT]"] = llformat("%s", money_str.c_str()); string_args["[AMT]"] = llformat("%s", money_str.c_str());
std::string labe_str = getString("buycurrencylabel", string_args); std::string labe_str = getString("buycurrencylabel", string_args);
mBtnBuyCurrency->setLabel(labe_str); btn_buy_currency->setLabel(labe_str);
// Resize the balance button so that the label fits it, and the button expands to the left. // 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. // *TODO: LLButton should have an option where to expand.
{ {
S32 saved_right = mBtnBuyCurrency->getRect().mRight; S32 saved_right = btn_buy_currency->getRect().mRight;
mBtnBuyCurrency->autoResize(); btn_buy_currency->autoResize();
mBtnBuyCurrency->translate(saved_right - mBtnBuyCurrency->getRect().mRight, 0); btn_buy_currency->translate(saved_right - btn_buy_currency->getRect().mRight, 0);
} }
if (mBalance && (fabs((F32)(mBalance - balance)) > gSavedSettings.getF32("UISndMoneyChangeThreshold"))) if (mBalance && (fabs((F32)(mBalance - balance)) > gSavedSettings.getF32("UISndMoneyChangeThreshold")))
...@@ -497,7 +500,7 @@ S32 LLStatusBar::getSquareMetersLeft() const ...@@ -497,7 +500,7 @@ S32 LLStatusBar::getSquareMetersLeft() const
return mSquareMetersCredit - mSquareMetersCommitted; return mSquareMetersCredit - mSquareMetersCommitted;
} }
static void onClickBuyCurrency(void* data) void LLStatusBar::onClickBuyCurrency()
{ {
LLFloaterBuyCurrency::buyCurrency(); LLFloaterBuyCurrency::buyCurrency();
} }
......
...@@ -91,6 +91,7 @@ class LLStatusBar ...@@ -91,6 +91,7 @@ class LLStatusBar
// simple method to setup the part that holds the date // simple method to setup the part that holds the date
void setupDate(); void setupDate();
void onClickBuyCurrency();
void onVolumeChanged(const LLSD& newvalue); void onVolumeChanged(const LLSD& newvalue);
static void onMouseEnterVolume(LLUICtrl* ctrl); static void onMouseEnterVolume(LLUICtrl* ctrl);
...@@ -103,7 +104,6 @@ class LLStatusBar ...@@ -103,7 +104,6 @@ class LLStatusBar
LLStatGraph *mSGBandwidth; LLStatGraph *mSGBandwidth;
LLStatGraph *mSGPacketLoss; LLStatGraph *mSGPacketLoss;
LLButton *mBtnBuyCurrency;
LLButton *mBtnVolume; LLButton *mBtnVolume;
S32 mBalance; S32 mBalance;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment