From fc7b5186944412d3f2125923aebf921730a79d20 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 23 Sep 2020 12:28:34 +0300 Subject: Revert "SL-13814 Clarify dialog for insufficient L$ balance" This reverts commit f150600ffb17232bfa88a6225aab437460fc9520. --- indra/newview/llcurrencyuimanager.cpp | 7 +- indra/newview/llfloaterbuycurrency.cpp | 61 +- .../skins/default/xui/en/floater_buy_currency.xml | 624 +++++++++------------ 3 files changed, 276 insertions(+), 416 deletions(-) diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index cd7332c4d4..df94e337da 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -454,7 +454,7 @@ void LLCurrencyUIManager::Impl::updateUI() if (!mUserEnteredCurrencyBuy) { - if (mUserCurrencyBuy == 0) + if (!mZeroMessage.empty() && mUserCurrencyBuy == 0) { lindenAmount->setText(LLStringUtil::null); } @@ -467,9 +467,8 @@ void LLCurrencyUIManager::Impl::updateUI() } } - std::string estimated = (mUserCurrencyBuy == 0) ? mPanel.getString("estimated_zero") : getLocalEstimate(); - mPanel.getChild("currency_est")->setTextArg("[LOCALAMOUNT]", estimated); - mPanel.getChildView("currency_est")->setVisible( hasEstimate() || mUserCurrencyBuy == 0); + mPanel.getChild("currency_est")->setTextArg("[LOCALAMOUNT]", getLocalEstimate()); + mPanel.getChildView("currency_est")->setVisible( hasEstimate() && mUserCurrencyBuy > 0); mPanel.getChildView("currency_links")->setVisible( mSupportsInternationalBilling); mPanel.getChildView("exchange_rate_note")->setVisible( mSupportsInternationalBilling); diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index b039475389..25348474a1 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -32,8 +32,6 @@ #include "llcurrencyuimanager.h" #include "llfloater.h" #include "llfloaterreg.h" -#include "lllayoutstack.h" -#include "lliconctrl.h" #include "llnotificationsutil.h" #include "llstatusbar.h" #include "lltextbox.h" @@ -62,7 +60,6 @@ public: bool mHasTarget; std::string mTargetName; S32 mTargetPrice; - S32 mRequiredAmount; public: void noTarget(); @@ -71,7 +68,6 @@ public: virtual BOOL postBuild(); void updateUI(); - void collapsePanels(bool collapse); virtual void draw(); virtual BOOL canClose(); @@ -96,9 +92,7 @@ LLFloater* LLFloaterBuyCurrency::buildFloater(const LLSD& key) LLFloaterBuyCurrencyUI::LLFloaterBuyCurrencyUI(const LLSD& key) : LLFloater(key), mChildren(*this), - mManager(*this), - mHasTarget(false), - mTargetPrice(0) + mManager(*this) { } @@ -110,8 +104,7 @@ LLFloaterBuyCurrencyUI::~LLFloaterBuyCurrencyUI() void LLFloaterBuyCurrencyUI::noTarget() { mHasTarget = false; - mTargetPrice = 0; - mManager.setAmount(0); + mManager.setAmount(STANDARD_BUY_AMOUNT); } void LLFloaterBuyCurrencyUI::target(const std::string& name, S32 price) @@ -127,8 +120,7 @@ void LLFloaterBuyCurrencyUI::target(const std::string& name, S32 price) need = 0; } - mRequiredAmount = need + MINIMUM_BALANCE_AMOUNT; - mManager.setAmount(0); + mManager.setAmount(need + MINIMUM_BALANCE_AMOUNT); } @@ -183,6 +175,7 @@ void LLFloaterBuyCurrencyUI::updateUI() getChildView("purchase_warning_repurchase")->setVisible(FALSE); getChildView("purchase_warning_notenough")->setVisible(FALSE); getChildView("contacting")->setVisible(FALSE); + getChildView("buy_action")->setVisible(FALSE); if (hasError) { @@ -215,8 +208,8 @@ void LLFloaterBuyCurrencyUI::updateUI() { if (mHasTarget) { - getChild("target_price")->setTextArg("[AMT]", llformat("%d", mTargetPrice)); - getChild("required_amount")->setTextArg("[AMT]", llformat("%d", mRequiredAmount)); + getChildView("buy_action")->setVisible( true); + getChild("buy_action")->setTextArg("[ACTION]", mTargetName); } } @@ -237,40 +230,18 @@ void LLFloaterBuyCurrencyUI::updateUI() if (mHasTarget) { - getChildView("purchase_warning_repurchase")->setVisible( !getChildView("currency_links")->getVisible()); + if (total >= mTargetPrice) + { + getChildView("purchase_warning_repurchase")->setVisible( true); + } + else + { + getChildView("purchase_warning_notenough")->setVisible( true); + } } } - getChildView("getting_data")->setVisible( !mManager.canBuy() && !hasError && !getChildView("currency_est")->getVisible()); -} - -void LLFloaterBuyCurrencyUI::collapsePanels(bool collapse) -{ - LLLayoutPanel* price_panel = getChild("layout_panel_price"); - - if (price_panel->isCollapsed() == collapse) - return; - - LLLayoutStack* outer_stack = getChild("outer_stack"); - LLLayoutPanel* required_panel = getChild("layout_panel_required"); - LLLayoutPanel* msg_panel = getChild("layout_panel_msg"); - - S32 delta_height = price_panel->getRect().getHeight() + required_panel->getRect().getHeight() + msg_panel->getRect().getHeight(); - delta_height *= (collapse ? -1 : 1); - - LLIconCtrl* icon = getChild("normal_background"); - LLRect rect = icon->getRect(); - icon->setRect(rect.setOriginAndSize(rect.mLeft, rect.mBottom - delta_height, rect.getWidth(), rect.getHeight() + delta_height)); - - outer_stack->collapsePanel(price_panel, collapse); - outer_stack->collapsePanel(required_panel, collapse); - outer_stack->collapsePanel(msg_panel, collapse); - - outer_stack->updateLayout(); - - LLRect floater_rect = getRect(); - floater_rect.mBottom -= delta_height; - setShape(floater_rect, false); + getChildView("getting_data")->setVisible( !mManager.canBuy() && !hasError); } void LLFloaterBuyCurrencyUI::onClickBuy() @@ -294,7 +265,6 @@ void LLFloaterBuyCurrency::buyCurrency() LLFloaterBuyCurrencyUI* ui = LLFloaterReg::showTypedInstance("buy_currency"); ui->noTarget(); ui->updateUI(); - ui->collapsePanels(true); } // static @@ -303,7 +273,6 @@ void LLFloaterBuyCurrency::buyCurrency(const std::string& name, S32 price) LLFloaterBuyCurrencyUI* ui = LLFloaterReg::showTypedInstance("buy_currency"); ui->target(name, price); ui->updateUI(); - ui->collapsePanels(false); } diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml index e8e83301be..061af1b67c 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml @@ -1,8 +1,8 @@ Unable to Buy - - US$ 0.00 - - - + You need more L$ + + - - You need more L$ - - - Buy L$ - - - - + Contacting LindeX... + + - - You need - - - L$ [AMT] - - - + Buy L$ + + - - You now have - - + left="20" + name="balance_label" + top="65" + width="210"> + I have + + L$ [AMT] - - - + + I want to buy + + + L$ + + + 1234 + + + For the price + + - - You should buy at least - - + left="150" + name="currency_est" + width="170"> + approx. [LOCALAMOUNT] + + + Estimating... + + + [ACTION] + + + My new balance will be + + L$ [AMT] - - - + - - - Choose amount to buy - - - L$ - - - 1234 - - - Approx. [LOCALAMOUNT] - - - Estimating... - - - Your new balance will be - - - L$ [AMT] - - - + [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] + + - - - [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] - - + halign="right" + top="202" + left="20" + width="300" + height="30" + name="exchange_rate_note"> Re-enter amount to see the latest exchange rate. - - -After you receive your L$, you should try your -purchase again. - - - + + Confirming this purchase only buys L$, not the object. + + + You aren't buying enough L$. Please increase the amount. + + +