本文整理汇总了C++中LLCurrencyUIManager::getAmount方法的典型用法代码示例。如果您正苦于以下问题:C++ LLCurrencyUIManager::getAmount方法的具体用法?C++ LLCurrencyUIManager::getAmount怎么用?C++ LLCurrencyUIManager::getAmount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLCurrencyUIManager
的用法示例。
在下文中一共展示了LLCurrencyUIManager::getAmount方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runWebSitePrep
void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password)
{
if (!mCanBuy)
{
return;
}
BOOL remove_contribution = getChild<LLUICtrl>("remove_contribution")->getValue().asBoolean();
mParcelBuyInfo = LLViewerParcelMgr::getInstance()->setupParcelBuy(gAgent.getID(), gAgent.getSessionID(),
gAgent.getGroupID(), mIsForGroup, mIsClaim, remove_contribution);
if (mParcelBuyInfo
&& !mSiteMembershipUpgrade
&& !mSiteLandUseUpgrade
&& mCurrency.getAmount() == 0
&& mSiteConfirm != "password")
{
sendBuyLand();
return;
}
std::string newLevel = "noChange";
if (mSiteMembershipUpgrade)
{
LLComboBox* levels = getChild<LLComboBox>( "account_level");
if (levels)
{
mUserPlanChoice = levels->getCurrentIndex();
newLevel = mSiteMembershipPlanIDs[mUserPlanChoice];
}
}
LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
keywordArgs.appendString("agentId", gAgent.getID().asString());
keywordArgs.appendString(
"secureSessionId",
gAgent.getSecureSessionID().asString());
keywordArgs.appendString("language", LLUI::getLanguage());
keywordArgs.appendString("levelId", newLevel);
keywordArgs.appendInt("billableArea",
mIsForGroup ? 0 : mParcelBillableArea);
keywordArgs.appendInt("currencyBuy", mCurrency.getAmount());
keywordArgs.appendInt("estimatedCost", mCurrency.getUSDEstimate());
keywordArgs.appendString("estimatedLocalCost", mCurrency.getLocalEstimate());
keywordArgs.appendString("confirm", mSiteConfirm);
if (!password.empty())
{
keywordArgs.appendString("password", password);
}
LLXMLRPCValue params = LLXMLRPCValue::createArray();
params.append(keywordArgs);
startTransaction(TransactionBuy, params);
}
示例2: startBuyPreConfirm
void LLFloaterBuyLandUI::startBuyPreConfirm()
{
std::string action;
std::string type_currency = LLGridManager::getInstance()->getCurrency();
if (mSiteMembershipUpgrade)
{
action += mSiteMembershipAction;
action += "\n";
LLComboBox* levels = getChild<LLComboBox>( "account_level");
if (levels)
{
action += " * ";
action += mSiteMembershipPlanNames[levels->getCurrentIndex()];
action += "\n";
}
}
if (mSiteLandUseUpgrade)
{
action += mSiteLandUseAction;
action += "\n";
}
if (mCurrency.getAmount() > 0)
{
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mCurrency.getAmount());
string_args["[LOCAL_AMOUNT]"] = mCurrency.getLocalEstimate();
string_args["[CUR]"] = type_currency;
action += getString("buy_for_US", string_args);
}
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mParcelPrice);
string_args["[SELLER]"] = mParcelSellerName;
string_args["[CUR]"] = type_currency;
action += getString("pay_to_for_land", string_args);
LLConfirmationManager::confirm(mSiteConfirm,
action,
*this,
&LLFloaterBuyLandUI::startBuyPostConfirm);
}
示例3: startBuyPreConfirm
void LLFloaterBuyLandUI::startBuyPreConfirm()
{
std::string action;
if (mSiteMembershipUpgrade)
{
action += mSiteMembershipAction;
action += "\n";
LLComboBox* levels = getChild<LLComboBox>( "account_level");
if (levels)
{
action += " * ";
action += mSiteMembershipPlanNames[levels->getCurrentIndex()];
action += "\n";
}
}
if (mSiteLandUseUpgrade)
{
action += mSiteLandUseAction;
action += "\n";
}
if (mCurrency.getAmount() > 0)
{
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mCurrency.getAmount());
string_args["[AMOUNT2]"] = llformat("%#.2f", mCurrency.getEstimate() / 100.0);
string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
action += getString("buy_for_US", string_args);
}
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mParcelPrice);
string_args["[SELLER]"] = mParcelSellerName;
string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
action += getString("pay_to_for_land", string_args);
LLConfirmationManager::confirm(mSiteConfirm,
action,
*this,
&LLFloaterBuyLandUI::startBuyPostConfirm);
}
示例4: updateWebSiteInfo
void LLFloaterBuyLandUI::updateWebSiteInfo()
{
S32 askBillableArea = mIsForGroup ? 0 : mParcelBillableArea;
S32 askCurrencyBuy = mCurrency.getAmount();
if (mTransaction && mTransactionType == TransactionPreflight
&& mPreflightAskBillableArea == askBillableArea
&& mPreflightAskCurrencyBuy == askCurrencyBuy)
{
return;
}
mPreflightAskBillableArea = askBillableArea;
mPreflightAskCurrencyBuy = askCurrencyBuy;
#if 0
// enable this code if you want the details to blank while we're talking
// to the web site... it's kind of jarring
mSiteValid = false;
mSiteMembershipUpgrade = false;
mSiteMembershipAction = "(waiting)";
mSiteMembershipPlanIDs.clear();
mSiteMembershipPlanNames.clear();
mSiteLandUseUpgrade = false;
mSiteLandUseAction = "(waiting)";
mSiteCurrencyEstimated = false;
mSiteCurrencyEstimatedCost = 0;
#endif
LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
keywordArgs.appendString("agentId", gAgent.getID().asString());
keywordArgs.appendString(
"secureSessionId",
gAgent.getSecureSessionID().asString());
keywordArgs.appendString("language", LLUI::getLanguage());
keywordArgs.appendInt("billableArea", mPreflightAskBillableArea);
keywordArgs.appendInt("currencyBuy", mPreflightAskCurrencyBuy);
LLXMLRPCValue params = LLXMLRPCValue::createArray();
params.append(keywordArgs);
startTransaction(TransactionPreflight, params);
}
示例5: updateUI
void LLFloaterBuyCurrencyUI::updateUI()
{
bool hasError = mManager.hasError();
mManager.updateUI(!hasError && !mManager.buying());
// hide most widgets - we'll turn them on as needed next
getChildView("info_buying")->setVisible(FALSE);
getChildView("info_cannot_buy")->setVisible(FALSE);
getChildView("info_need_more")->setVisible(FALSE);
getChildView("purchase_warning_repurchase")->setVisible(FALSE);
getChildView("purchase_warning_notenough")->setVisible(FALSE);
getChildView("contacting")->setVisible(FALSE);
getChildView("buy_action")->setVisible(FALSE);
if (hasError)
{
// display an error from the server
getChildView("normal_background")->setVisible(FALSE);
getChildView("error_background")->setVisible(TRUE);
getChildView("info_cannot_buy")->setVisible(TRUE);
getChildView("cannot_buy_message")->setVisible(TRUE);
getChildView("balance_label")->setVisible(FALSE);
getChildView("balance_amount")->setVisible(FALSE);
getChildView("buying_label")->setVisible(FALSE);
getChildView("buying_amount")->setVisible(FALSE);
getChildView("total_label")->setVisible(FALSE);
getChildView("total_amount")->setVisible(FALSE);
LLTextBox* message = getChild<LLTextBox>("cannot_buy_message");
if (message)
{
message->setText(mManager.errorMessage());
}
getChildView("error_web")->setVisible( !mManager.errorURI().empty());
}
else
{
// display the main Buy L$ interface
getChildView("normal_background")->setVisible(TRUE);
getChildView("error_background")->setVisible(FALSE);
getChildView("cannot_buy_message")->setVisible(FALSE);
getChildView("error_web")->setVisible(FALSE);
if (mHasTarget)
{
getChildView("info_need_more")->setVisible(TRUE);
}
else
{
getChildView("info_buying")->setVisible(TRUE);
}
if (mManager.buying())
{
getChildView("contacting")->setVisible( true);
}
else
{
if (mHasTarget)
{
getChildView("buy_action")->setVisible( true);
getChild<LLUICtrl>("buy_action")->setTextArg("[ACTION]", mTargetName);
}
}
S32 balance = gStatusBar->getBalance();
getChildView("balance_label")->setVisible(TRUE);
getChildView("balance_amount")->setVisible(TRUE);
getChild<LLUICtrl>("balance_amount")->setTextArg("[AMT]", llformat("%d", balance));
S32 buying = mManager.getAmount();
getChildView("buying_label")->setVisible(TRUE);
getChildView("buying_amount")->setVisible(TRUE);
getChild<LLUICtrl>("buying_amount")->setTextArg("[AMT]", llformat("%d", buying));
S32 total = balance + buying;
getChildView("total_label")->setVisible(TRUE);
getChildView("total_amount")->setVisible(TRUE);
getChild<LLUICtrl>("total_amount")->setTextArg("[AMT]", llformat("%d", total));
if (mHasTarget)
{
if (total >= mTargetPrice)
{
getChildView("purchase_warning_repurchase")->setVisible( true);
}
else
{
getChildView("purchase_warning_notenough")->setVisible( true);
}
}
}
getChildView("getting_data")->setVisible( !mManager.canBuy() && !hasError);
}
示例6: refreshUI
//.........这里部分代码省略.........
message += LLTrans::getString("sentences_separator") + getString("parcel_meters", string_args);
}
else
{
if (mParcelBillableArea > mParcelActualArea)
{
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d ", mParcelBillableArea);
message += LLTrans::getString("sentences_separator") + getString("premium_land", string_args);
}
else
{
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d ", mParcelBillableArea);
message += LLTrans::getString("sentences_separator") + getString("discounted_land", string_args);
}
}
getChild<LLUICtrl>("land_use_reason")->setValue(message);
getChildView("step_2")->setVisible(TRUE);
getChildView("land_use_action")->setVisible(TRUE);
getChildView("land_use_reason")->setVisible(TRUE);
}
else
{
getChildView("step_2")->setVisible(FALSE);
getChildView("land_use_action")->setVisible(FALSE);
getChildView("land_use_reason")->setVisible(FALSE);
}
// section three: purchase & currency
S32 finalBalance = mAgentCashBalance + mCurrency.getAmount() - mParcelPrice;
bool willHaveEnough = finalBalance >= 0;
bool haveEnough = mAgentCashBalance >= mParcelPrice;
S32 minContribution = llceil((F32)mParcelBillableArea / GROUP_LAND_BONUS_FACTOR);
bool groupContributionEnough = mParcelGroupContribution >= minContribution;
mCurrency.updateUI(!showingError && !haveEnough);
if (!showingError)
{
mChildren.setBadge(std::string("step_3"),
!willHaveEnough
? LLViewChildren::BADGE_WARN
: mCurrency.getAmount() > 0
? LLViewChildren::BADGE_NOTE
: LLViewChildren::BADGE_OK);
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mParcelPrice);
string_args["[SELLER]"] = mParcelSellerName;
getChild<LLUICtrl>("purchase_action")->setValue(getString("pay_to_for_land", string_args));
getChildView("purchase_action")->setVisible( mParcelValid);
std::string reasonString;
if (haveEnough)
{
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mAgentCashBalance);
getChild<LLUICtrl>("currency_reason")->setValue(getString("have_enough_lindens", string_args));
}
else
示例7: updateUI
void LLFloaterBuyCurrencyUI::updateUI()
{
bool hasError = mManager.hasError();
mManager.updateUI(!hasError && !mManager.buying());
// section zero: title area
{
childSetVisible("info_buying", false);
childSetVisible("info_cannot_buy", false);
childSetVisible("info_need_more", false);
if (hasError)
{
childSetVisible("info_cannot_buy", true);
}
else if (mHasTarget)
{
childSetVisible("info_need_more", true);
}
else
{
childSetVisible("info_buying", true);
}
}
// error section
if (hasError)
{
mChildren.setBadge(std::string("step_error"), LLViewChildren::BADGE_ERROR);
LLTextBox* message = getChild<LLTextBox>("error_message");
if (message)
{
message->setVisible(true);
message->setWrappedText(mManager.errorMessage());
}
childSetVisible("error_web", !mManager.errorURI().empty());
if (!mManager.errorURI().empty())
{
childHide("getting_data");
}
}
else
{
childHide("step_error");
childHide("error_message");
childHide("error_web");
}
// currency
childSetVisible("contacting", false);
childSetVisible("buy_action", false);
childSetVisible("buy_action_unknown", false);
if (!hasError)
{
mChildren.setBadge(std::string("step_1"), LLViewChildren::BADGE_NOTE);
if (mManager.buying())
{
childSetVisible("contacting", true);
}
else
{
if (mHasTarget)
{
childSetVisible("buy_action", true);
childSetTextArg("buy_action", "[NAME]", mTargetName);
childSetTextArg("buy_action", "[PRICE]", llformat("%d",mTargetPrice));
}
else
{
childSetVisible("buy_action_unknown", true);
}
}
S32 balance = gStatusBar->getBalance();
childShow("balance_label");
childShow("balance_amount");
childSetTextArg("balance_amount", "[AMT]", llformat("%d", balance));
S32 buying = mManager.getAmount();
childShow("buying_label");
childShow("buying_amount");
childSetTextArg("buying_amount", "[AMT]", llformat("%d", buying));
S32 total = balance + buying;
childShow("total_label");
childShow("total_amount");
childSetTextArg("total_amount", "[AMT]", llformat("%d", total));
childSetVisible("purchase_warning_repurchase", false);
childSetVisible("purchase_warning_notenough", false);
if (mHasTarget)
{
if (total >= mTargetPrice)
{
childSetVisible("purchase_warning_repurchase", true);
}
//.........这里部分代码省略.........