本文整理汇总了C++中LLParcel类的典型用法代码示例。如果您正苦于以下问题:C++ LLParcel类的具体用法?C++ LLParcel怎么用?C++ LLParcel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLParcel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onClickSellToAnyone
// static - 'Sell to Anyone' clicked, throw up a confirmation dialog
void LLFloaterAuction::onClickSellToAnyone(void* data)
{
LLFloaterAuction* self = (LLFloaterAuction*)(data);
if (self)
{
LLParcel* parcelp = self->mParcelp->getParcel();
// Do a confirmation
S32 sale_price = parcelp->getArea(); // Selling for L$1 per meter
S32 area = parcelp->getArea();
LLSD args;
args["LAND_SIZE"] = llformat("%d", area);
args["SALE_PRICE"] = llformat("%d", sale_price);
args["NAME"] = LLTrans::getString("Anyone");
LLNotification::Params params("ConfirmLandSaleChange"); // Re-use existing dialog
params.substitutions(args)
.functor.function(boost::bind(&LLFloaterAuction::onSellToAnyoneConfirmed, self, _1, _2));
params.name("ConfirmLandSaleToAnyoneChange");
// ask away
LLNotifications::instance().add(params);
}
}
示例2: initNewClassified
// Fill in some reasonable defaults for a new classified.
void LLPanelClassified::initNewClassified()
{
// TODO: Don't generate this on the client.
mClassifiedID.generate();
mCreatorID = gAgent.getID();
mPosGlobal = gAgent.getPositionGlobal();
mPaidFor = FALSE;
// Try to fill in the current parcel
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (parcel)
{
mNameEditor->setText(parcel->getName());
//mDescEditor->setText(parcel->getDesc());
mSnapshotCtrl->setImageAssetID(parcel->getSnapshotID());
//mPriceEditor->setText("0");
mCategoryCombo->setCurrentByIndex(0);
}
mUpdateBtn->setLabel(getString("publish_txt"));
// simulate clicking the "location" button
LLPanelClassified::onClickSet(this);
}
示例3: initialize
void LLFloaterAuction::initialize()
{
mParcelp = gParcelMgr->getParcelSelection();
LLViewerRegion* region = gParcelMgr->getSelectionRegion();
LLParcel* parcelp = mParcelp->getParcel();
if(parcelp && region && !parcelp->getForSale())
{
mParcelHost = region->getHost();
mParcelID = parcelp->getLocalID();
childSetText("parcel_text", parcelp->getName());
childEnable("snapshot_btn");
childEnable("ok_btn");
}
else
{
mParcelHost.invalidate();
if(parcelp && parcelp->getForSale())
{
childSetText("parcel_text", childGetText("already for sale"));
}
else
{
childSetText("parcel_text", LLString::null);
}
mParcelID = -1;
childSetEnabled("snapshot_btn", false);
childSetEnabled("ok_btn", false);
}
mImageID.setNull();
mImage = NULL;
}
示例4: updateNames
void LLFloaterBuyLandUI::updateNames()
{
LLParcel* parcelp = mParcel->getParcel();
if (!parcelp)
{
mParcelSellerName = LLStringUtil::null;
return;
}
if (mIsClaim)
{
mParcelSellerName = "Linden Lab";
}
else if (parcelp->getIsGroupOwned())
{
mParcelSellerName = "(Loading...)";
gCacheName->getGroup(parcelp->getGroupID(),
boost::bind(&LLFloaterBuyLandUI::updateName, this,
_1, _2, _3));
}
else
{
mParcelSellerName = "(Loading...)";
gCacheName->get(parcelp->getOwnerID(), false,
boost::bind(&LLFloaterBuyLandUI::updateName, this,
_1, _2, _3));
}
}
示例5: onClickWLStatusButton
void KCWindlightInterface::onClickWLStatusButton()
{
//clear the last notification if its still open
if (mClearWLNotification && !mClearWLNotification->isRespondedTo())
{
LLSD response = mClearWLNotification->getResponseTemplate();
response["Ignore"] = true;
mClearWLNotification->respond(response);
}
if (WLset)
{
LLParcel *parcel = NULL;
parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (parcel)
{
//TODO: this could be better
LLSD payload;
payload["local_id"] = parcel->getLocalID();
payload["land_owner"] = getOwnerID(parcel);
LLSD args;
args["PARCEL_NAME"] = parcel->getName();
mClearWLNotification = LLNotifications::instance().add("PhoenixWLClear", args, payload, boost::bind(&KCWindlightInterface::callbackParcelWLClear, this, _1, _2));
}
}
}
示例6: onForSaleBannerClick
void LLPanelPlaceProfile::onForSaleBannerClick()
{
LLViewerParcelMgr* mgr = LLViewerParcelMgr::getInstance();
LLParcel* parcel = mgr->getFloatingParcelSelection()->getParcel();
LLViewerRegion* selected_region = mgr->getSelectionRegion();
if(parcel && selected_region)
{
if(parcel->getLocalID() == mSelectedParcelID &&
mLastSelectedRegionID ==selected_region->getRegionID())
{
S32 price = parcel->getSalePrice();
if(price - gStatusBar->getBalance() > 0)
{
LLStringUtil::format_map_t args;
args["AMOUNT"] = llformat("%d", price);
LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("buying_selected_land", args), price );
}
else
{
LLViewerParcelMgr::getInstance()->startBuyLand();
}
}
else
{
LL_WARNS("Places") << "User is trying to buy remote parcel.Operation is not supported"<< LL_ENDL;
}
}
}
示例7: setPosGlobal
void LLPanelPickEdit::onClickSetLocation()
{
// Save location for later use.
setPosGlobal(gAgent.getPositionGlobal());
std::string parcel_name, region_name;
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (parcel)
{
mParcelId = parcel->getID();
parcel_name = parcel->getName();
}
LLViewerRegion* region = gAgent.getRegion();
if(region)
{
region_name = region->getName();
}
setPickLocation(createLocationText(getLocationNotice(), parcel_name, region_name, getPosGlobal()));
mLocationChanged = true;
enableSaveButton(TRUE);
}
示例8: handle_click_action_open_media
static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp)
{
//FIXME: how do we handle object in different parcel than us?
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (!parcel) return;
// did we hit an object?
if (objectp.isNull()) return;
// did we hit a valid face on the object?
S32 face = LLToolPie::getInstance()->getPick().mObjectFace;
if( face < 0 || face >= objectp->getNumTEs() ) return;
// is media playing on this face?
if (LLViewerMedia::getMediaImplFromTextureID(objectp->getTE(face)->getID()) != NULL)
{
handle_click_action_play();
return;
}
std::string media_url = std::string ( parcel->getMediaURL () );
std::string media_type = std::string ( parcel->getMediaType() );
LLStringUtil::trim(media_url);
LLWeb::loadURL(media_url);
}
示例9: cursor_from_parcel_media
static ECursorType cursor_from_parcel_media(U8 click_action)
{
// HACK: This is directly referencing an impl name. BAD!
// This can be removed when we have a truly generic media browser that only
// builds an impl based on the type of url it is passed.
//FIXME: how do we handle object in different parcel than us?
ECursorType open_cursor = UI_CURSOR_ARROW;
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (!parcel) return open_cursor;
std::string media_url = std::string ( parcel->getMediaURL () );
std::string media_type = std::string ( parcel->getMediaType() );
LLStringUtil::trim(media_url);
open_cursor = UI_CURSOR_TOOLMEDIAOPEN;
LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getStatus();
switch(status)
{
case LLViewerMediaImpl::MEDIA_PLAYING:
return click_action == CLICK_ACTION_PLAY ? UI_CURSOR_TOOLPAUSE : open_cursor;
default:
return UI_CURSOR_TOOLPLAY;
}
}
示例10: handle_click_action_open_media
static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp)
{
//FIXME: how do we handle object in different parcel than us?
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (!parcel) return;
// did we hit an object?
if (objectp.isNull()) return;
// did we hit a valid face on the object?
S32 face = LLToolPie::getInstance()->getPick().mObjectFace;
if( face < 0 || face >= objectp->getNumTEs() ) return;
// is media playing on this face?
if (LLViewerMedia::getMediaImplFromTextureID(objectp->getTE(face)->getID()) != NULL)
{
handle_click_action_play();
return;
}
std::string media_url = std::string ( parcel->getMediaURL () );
std::string media_type = std::string ( parcel->getMediaType() );
LLStringUtil::trim(media_url);
// Get the scheme, see if that is handled as well.
LLURI uri(media_url);
std::string media_scheme = uri.scheme() != "" ? uri.scheme() : "http";
// HACK: This is directly referencing an impl name. BAD!
// This can be removed when we have a truly generic media browser that only
// builds an impl based on the type of url it is passed.
LLWeb::loadURL(media_url);
}
示例11: cursor_from_parcel_media
static ECursorType cursor_from_parcel_media(U8 click_action)
{
// HACK: This is directly referencing an impl name. BAD!
// This can be removed when we have a truly generic media browser that only
// builds an impl based on the type of url it is passed.
//FIXME: how do we handle object in different parcel than us?
ECursorType open_cursor = UI_CURSOR_ARROW;
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (!parcel) return open_cursor;
std::string media_url = std::string ( parcel->getMediaURL () );
std::string media_type = std::string ( parcel->getMediaType() );
LLStringUtil::trim(media_url);
// Get the scheme, see if that is handled as well.
LLURI uri(media_url);
std::string media_scheme = uri.scheme() != "" ? uri.scheme() : "http";
if( LLMediaManager::getInstance()->supportsMediaType( "LLMediaImplLLMozLib", media_scheme, media_type ) )
{
open_cursor = UI_CURSOR_TOOLMEDIAOPEN;
}
LLMediaBase::EStatus status = LLViewerParcelMedia::getStatus();
switch(status)
{
case LLMediaBase::STATUS_STARTED:
return click_action == CLICK_ACTION_PLAY ? UI_CURSOR_TOOLPAUSE : open_cursor;
default:
return UI_CURSOR_TOOLPLAY;
}
}
示例12: updateNames
void LLFloaterBuyLandUI::updateNames()
{
LLParcel* parcelp = mParcel->getParcel();
if (!parcelp)
{
mParcelSellerName = LLStringUtil::null;
return;
}
if (mIsClaim)
{
mParcelSellerName = "Linden Lab";
}
else if (parcelp->getIsGroupOwned())
{
gCacheName->getGroup(parcelp->getGroupID(),
boost::bind(&LLFloaterBuyLandUI::updateGroupName, this,
_1, _2, _3));
}
else
{
mParcelSellerName = LLSLURL("agent", parcelp->getOwnerID(), "completename").getSLURLString();
}
}
示例13: onClickRemoveURLFilter
// static
void LLPanelLandMedia::onClickRemoveURLFilter(void *data)
{
LLPanelLandMedia* panelp = (LLPanelLandMedia*)data;
if (panelp && panelp->mURLFilterList)
{
LLParcel* parcel = panelp->mParcel->getParcel();
if (parcel)
{
LLSD list = parcel->getMediaURLFilterList();
std::vector<LLScrollListItem*> domains = panelp->mURLFilterList->getAllSelected();
for (std::vector<LLScrollListItem*>::iterator iter = domains.begin(); iter != domains.end(); iter++)
{
LLScrollListItem* item = *iter;
const std::string domain = item->getValue().asString();
for(S32 i = 0; i < list.size(); i++)
{
if (list[i].asString() == domain)
{
list.erase(i);
break;
}
}
}
parcel->setMediaURLFilterList(list);
LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );
panelp->refresh();
}
}
}
示例14: doSellLand
// static
void LLFloaterSellLandUI::doSellLand(void *userdata)
{
LLFloaterSellLandUI* self = (LLFloaterSellLandUI*)userdata;
LLParcel* parcel = self->mParcelSelection->getParcel();
// Do a confirmation
S32 sale_price = self->getChild<LLUICtrl>("price")->getValue();
S32 area = parcel->getArea();
std::string authorizedBuyerName = LLTrans::getString("Anyone");
bool sell_to_anyone = true;
if ("user" == self->getChild<LLUICtrl>("sell_to")->getValue().asString())
{
authorizedBuyerName = self->getChild<LLUICtrl>("sell_to_agent")->getValue().asString();
sell_to_anyone = false;
}
// must sell to someone if indicating sale to anyone
if (!parcel->getForSale()
&& (sale_price == 0)
&& sell_to_anyone)
{
LLSD args;
std::string type_currency = LLGridManager::getInstance()->getCurrency();
args["CUR"] = type_currency;
LLNotificationsUtil::add("SalePriceRestriction", args);
return;
}
std::string type_currency = LLGridManager::getInstance()->getCurrency();
LLSD args;
args["LAND_SIZE"] = llformat("%d",area);
args["SALE_PRICE"] = llformat("%d",sale_price);
args["NAME"] = authorizedBuyerName;
args["CUR"] = type_currency;
LLNotification::Params params("ConfirmLandSaleChange");
params.substitutions(args)
.functor.function(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);
}
}
示例15: setMediaType
void LLPanelLandMedia::setMediaType(const std::string& mime_type)
{
LLParcel *parcel = mParcel->getParcel();
if(parcel)
parcel->setMediaType(mime_type);
std::string media_key = LLMIMETypes::widgetType(mime_type);
mMediaTypeCombo->setValue(media_key);
childSetText("mime_type", mime_type);
}