本文整理汇总了C++中LLTextureCtrl::setImageAssetID方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTextureCtrl::setImageAssetID方法的具体用法?C++ LLTextureCtrl::setImageAssetID怎么用?C++ LLTextureCtrl::setImageAssetID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLTextureCtrl
的用法示例。
在下文中一共展示了LLTextureCtrl::setImageAssetID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refreshUI
void LLFloaterBuyLandUI::refreshUI()
{
// section zero: title area
{
LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image");
if (snapshot)
{
snapshot->setImageAssetID(
mParcelValid ? mParcelSnapshot : LLUUID::null);
}
if (mParcelValid)
{
childSetText("info_parcel", mParcelLocation);
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mParcelActualArea);
string_args["[AMOUNT2]"] = llformat("%d", mParcelSupportedObjects);
string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
childSetText("info_size", getString("meters_supports_object", string_args));
F32 cost_per_sqm = 0.0f;
if (mParcelActualArea > 0)
{
cost_per_sqm = (F32)mParcelPrice / (F32)mParcelActualArea;
}
LLStringUtil::format_map_t info_price_args;
info_price_args["[PRICE]"] = llformat("%d", mParcelPrice);
info_price_args["[PRICE_PER_SQM]"] = llformat("%.1f", cost_per_sqm);
if (mParcelSoldWithObjects)
{
info_price_args["[SOLD_WITH_OBJECTS]"] = getString("sold_with_objects");
}
else
{
info_price_args["[SOLD_WITH_OBJECTS]"] = getString("sold_without_objects");
}
childSetText("info_price", getString("info_price_string", info_price_args));
childSetVisible("info_price", mParcelIsForSale);
}
else
{
childSetText("info_parcel", getString("no_parcel_selected"));
childSetText("info_size", LLStringUtil::null);
childSetText("info_price", LLStringUtil::null);
}
childSetText("info_action",
mCanBuy
?
mIsForGroup
? getString("buying_for_group")//"Buying land for group:"
: getString("buying_will")//"Buying this land will:"
:
mCannotBuyIsError
? getString("cannot_buy_now")//"Cannot buy now:"
: getString("not_for_sale")//"Not for sale:"
);
}
bool showingError = !mCanBuy || !mSiteValid;
// error section
if (showingError)
{
mChildren.setBadge(std::string("step_error"),
mCannotBuyIsError
? LLViewChildren::BADGE_ERROR
: LLViewChildren::BADGE_WARN);
LLTextBox* message = getChild<LLTextBox>("error_message");
if (message)
{
message->setVisible(true);
message->setWrappedText(
!mCanBuy ? mCannotBuyReason : "(waiting for data)"
);
}
childSetVisible("error_web",
mCannotBuyIsError && !mCannotBuyURI.empty());
}
else
{
childHide("step_error");
childHide("error_message");
childHide("error_web");
}
// section one: account
if (!showingError)
{
mChildren.setBadge(std::string("step_1"),
mSiteMembershipUpgrade
? LLViewChildren::BADGE_NOTE
: LLViewChildren::BADGE_OK);
//.........这里部分代码省略.........
示例2: syncMenu
void LLFloaterWater::syncMenu()
{
bool err;
LLWaterParamManager * param_mgr = LLWaterParamManager::instance();
LLWaterParamSet & current_params = param_mgr->mCurParams;
LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo");
if (comboBox->getSelectedItemLabel() != current_params.mName)
{
comboBox->setSimple(current_params.mName);
}
// blue horizon
param_mgr->mFogColor = current_params.getVector4(param_mgr->mFogColor.mName, err);
LLColor4 col = param_mgr->getFogColor();
childSetValue("WaterGlow", col.mV[3]);
col.mV[3] = 1.0f;
LLColorSwatchCtrl* colCtrl = sWaterMenu->getChild<LLColorSwatchCtrl>("WaterFogColor");
colCtrl->set(col);
// fog and wavelets
param_mgr->mFogDensity.mExp =
log(current_params.getFloat(param_mgr->mFogDensity.mName, err)) /
log(param_mgr->mFogDensity.mBase);
param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp);
childSetValue("WaterFogDensity", param_mgr->mFogDensity.mExp);
param_mgr->mUnderWaterFogMod.mX =
current_params.getFloat(param_mgr->mUnderWaterFogMod.mName, err);
childSetValue("WaterUnderWaterFogMod", param_mgr->mUnderWaterFogMod.mX);
param_mgr->mNormalScale = current_params.getVector3(param_mgr->mNormalScale.mName, err);
childSetValue("WaterNormalScaleX", param_mgr->mNormalScale.mX);
childSetValue("WaterNormalScaleY", param_mgr->mNormalScale.mY);
childSetValue("WaterNormalScaleZ", param_mgr->mNormalScale.mZ);
// Fresnel
param_mgr->mFresnelScale.mX = current_params.getFloat(param_mgr->mFresnelScale.mName, err);
childSetValue("WaterFresnelScale", param_mgr->mFresnelScale.mX);
param_mgr->mFresnelOffset.mX = current_params.getFloat(param_mgr->mFresnelOffset.mName, err);
childSetValue("WaterFresnelOffset", param_mgr->mFresnelOffset.mX);
// Scale Above/Below
param_mgr->mScaleAbove.mX = current_params.getFloat(param_mgr->mScaleAbove.mName, err);
childSetValue("WaterScaleAbove", param_mgr->mScaleAbove.mX);
param_mgr->mScaleBelow.mX = current_params.getFloat(param_mgr->mScaleBelow.mName, err);
childSetValue("WaterScaleBelow", param_mgr->mScaleBelow.mX);
// blur mult
param_mgr->mBlurMultiplier.mX = current_params.getFloat(param_mgr->mBlurMultiplier.mName, err);
childSetValue("WaterBlurMult", param_mgr->mBlurMultiplier.mX);
// wave directions
param_mgr->mWave1Dir = current_params.getVector2(param_mgr->mWave1Dir.mName, err);
childSetValue("WaterWave1DirX", param_mgr->mWave1Dir.mX);
childSetValue("WaterWave1DirY", param_mgr->mWave1Dir.mY);
param_mgr->mWave2Dir = current_params.getVector2(param_mgr->mWave2Dir.mName, err);
childSetValue("WaterWave2DirX", param_mgr->mWave2Dir.mX);
childSetValue("WaterWave2DirY", param_mgr->mWave2Dir.mY);
LLTextureCtrl* textCtrl = sWaterMenu->getChild<LLTextureCtrl>("WaterNormalMap");
textCtrl->setImageAssetID(param_mgr->getNormalMapID());
}
示例3: refreshUI
void LLFloaterSellLandUI::refreshUI()
{
LLParcel* parcelp = mParcelSelection->getParcel();
if (!parcelp) return;
LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image");
snapshot->setImageAssetID(mParcelSnapshot);
getChild<LLUICtrl>("info_parcel")->setValue(parcelp->getName());
getChild<LLUICtrl>("info_size")->setTextArg("[AREA]", llformat("%d", mParcelActualArea));
std::string price_str = getChild<LLUICtrl>("price")->getValue().asString();
bool valid_price = false;
valid_price = (price_str != "") && LLTextValidate::validateNonNegativeS32(utf8str_to_wstring(price_str));
if (valid_price && mParcelActualArea > 0)
{
F32 per_meter_price = 0;
per_meter_price = F32(mParcelPrice) / F32(mParcelActualArea);
getChild<LLUICtrl>("price_per_m")->setTextArg("[PER_METER]", llformat("%0.2f", per_meter_price));
getChildView("price_per_m")->setVisible(TRUE);
setBadge("step_price", BADGE_OK);
}
else
{
getChildView("price_per_m")->setVisible(FALSE);
if ("" == price_str)
{
setBadge("step_price", BADGE_NOTE);
}
else
{
setBadge("step_price", BADGE_ERROR);
}
}
if (mSellToBuyer)
{
getChild<LLUICtrl>("sell_to")->setValue("user");
getChildView("sell_to_agent")->setVisible(TRUE);
getChildView("sell_to_select_agent")->setVisible(TRUE);
}
else
{
if (mChoseSellTo)
{
getChild<LLUICtrl>("sell_to")->setValue("anyone");
}
else
{
getChild<LLUICtrl>("sell_to")->setValue("select");
}
getChildView("sell_to_agent")->setVisible(FALSE);
getChildView("sell_to_select_agent")->setVisible(FALSE);
}
// Must select Sell To: Anybody, or User (with a specified username)
std::string sell_to = getChild<LLUICtrl>("sell_to")->getValue().asString();
bool valid_sell_to = "select" != sell_to &&
("user" != sell_to || mAuthorizedBuyer.notNull());
if (!valid_sell_to)
{
setBadge("step_sell_to", BADGE_NOTE);
}
else
{
setBadge("step_sell_to", BADGE_OK);
}
bool valid_sell_objects = ("none" != getChild<LLUICtrl>("sell_objects")->getValue().asString());
if (!valid_sell_objects)
{
setBadge("step_sell_objects", BADGE_NOTE);
}
else
{
setBadge("step_sell_objects", BADGE_OK);
}
if (valid_sell_to && valid_price && valid_sell_objects)
{
getChildView("sell_btn")->setEnabled(TRUE);
}
else
{
getChildView("sell_btn")->setEnabled(FALSE);
}
}