本文整理汇总了C++中LLFloaterSellLandUI类的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterSellLandUI类的具体用法?C++ LLFloaterSellLandUI怎么用?C++ LLFloaterSellLandUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLFloaterSellLandUI类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onChangeValue
// static
void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata)
{
LLFloaterSellLandUI *self = (LLFloaterSellLandUI *)userdata;
std::string sell_to = self->getChild<LLUICtrl>("sell_to")->getValue().asString();
if (sell_to == "user")
{
self->mChoseSellTo = true;
self->mSellToBuyer = true;
if (self->mAuthorizedBuyer.isNull())
{
self->doSelectAgent();
}
}
else if (sell_to == "anyone")
{
self->mChoseSellTo = true;
self->mSellToBuyer = false;
}
self->mParcelPrice = self->getChild<LLUICtrl>("price")->getValue();
if ("yes" == self->getChild<LLUICtrl>("sell_objects")->getValue().asString())
{
self->mParcelSoldWithObjects = true;
}
else
{
self->mParcelSoldWithObjects = false;
}
self->refreshUI();
}
示例2: sellLand
// static
void LLFloaterSellLand::sellLand(
LLViewerRegion* region, LLParcelSelectionHandle parcel)
{
LLFloaterSellLandUI* ui = LLFloaterSellLandUI::soleInstance(true);
if (ui->setParcel(region, parcel))
{
ui->open(); /* Flawfinder: ignore */
}
}
示例3: llformat
// static
void LLFloaterSellLandUI::doSellLand(void *userdata)
{
LLFloaterSellLandUI* self = (LLFloaterSellLandUI*)userdata;
LLParcel* parcel = self->mParcelSelection->getParcel();
// Do a confirmation
S32 sale_price = self->childGetValue("price");
S32 area = parcel->getArea();
std::string authorizedBuyerName = LLTrans::getString("Anyone");
bool sell_to_anyone = true;
if ("user" == self->childGetValue("sell_to").asString())
{
authorizedBuyerName = self->childGetText("sell_to_agent");
sell_to_anyone = false;
}
// must sell to someone if indicating sale to anyone
if (!parcel->getForSale()
&& (sale_price == 0)
&& sell_to_anyone)
{
LLNotificationsUtil::add("SalePriceRestriction");
return;
}
LLSD args;
args["LAND_SIZE"] = llformat("%d",area);
args["SALE_PRICE"] = llformat("%d",sale_price);
args["NAME"] = authorizedBuyerName;
LLNotification::Params params("ConfirmLandSaleChange");
params.substitutions(args)
.functor(boost::bind(&LLFloaterSellLandUI::onConfirmSale, self, _1, _2));
if (sell_to_anyone)
{
params.name("ConfirmLandSaleToAnyoneChange");
}
if (parcel->getForSale())
{
// parcel already for sale, so ignore this question
LLNotifications::instance().forceResponse(params, -1);
}
else
{
// ask away
LLNotifications::instance().add(params);
}
}
示例4:
void LLFloaterSellLandUI::SelectionObserver::changed()
{
LLFloaterSellLandUI* ui = LLFloaterSellLandUI::soleInstance(false);
if (ui)
{
if (LLViewerParcelMgr::getInstance()->selectionEmpty())
{
ui->close();
}
else {
ui->setParcel(
LLViewerParcelMgr::getInstance()->getSelectionRegion(),
LLViewerParcelMgr::getInstance()->getParcelSelection());
}
}
}
示例5: callbackAvatarPick
// static
void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
{
LLFloaterSellLandUI* floaterp = (LLFloaterSellLandUI*)data;
LLParcel* parcel = floaterp->mParcelSelection->getParcel();
if (names.empty() || ids.empty()) return;
LLUUID id = ids[0];
parcel->setAuthorizedBuyerID(id);
floaterp->mAuthorizedBuyer = ids[0];
floaterp->childSetText("sell_to_agent", names[0]);
floaterp->refreshUI();
}
示例6: LLFloaterSellLandUI
// static
LLFloaterSellLandUI* LLFloaterSellLandUI::soleInstance(bool createIfNeeded)
{
if (!sInstance && createIfNeeded)
{
sInstance = new LLFloaterSellLandUI();
LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_sell_land.xml");
sInstance->center();
}
static SelectionObserver* parcelSelectionObserver = NULL;
if (!parcelSelectionObserver)
{
parcelSelectionObserver = new SelectionObserver;
LLViewerParcelMgr::getInstance()->addObserver(parcelSelectionObserver);
}
return sInstance;
}
示例7: doCancel
// static
void LLFloaterSellLandUI::doCancel(void *userdata)
{
LLFloaterSellLandUI* self = (LLFloaterSellLandUI*)userdata;
self->closeFloater();
}
示例8: sellLand
// static
void LLFloaterSellLand::sellLand(
LLViewerRegion* region, LLParcelSelectionHandle parcel)
{
LLFloaterSellLandUI* ui = LLFloaterReg::showTypedInstance<LLFloaterSellLandUI>("sell_land");
ui->setParcel(region, parcel);
}
示例9: doSelectAgent
// static
void LLFloaterSellLandUI::doSelectAgent(void *userdata)
{
LLFloaterSellLandUI* floaterp = (LLFloaterSellLandUI*)userdata;
// grandparent is a floater, in order to set up dependency
floaterp->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterSellLandUI::callbackAvatarPick, floaterp, _1, _2), FALSE, TRUE));
}