示例#1
0
// static
void LLPanelPlace::onClickTeleport(void* data)
{
	LLPanelPlace* self = (LLPanelPlace*)data;

	LLView* parent_viewp = self->getParent();
	LLFloater* parent_floaterp = dynamic_cast<LLFloater*>(parent_viewp);
	if (parent_floaterp)
	{
		parent_floaterp->closeFloater();
	}
	// LLFloater* parent_floaterp = (LLFloater*)self->getParent();
	parent_viewp->setVisible(false);
	LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance();
	if(self->mLandmarkAssetID.notNull() && worldmap_instance)
	{
		gAgent.teleportViaLandmark(self->mLandmarkAssetID);
		worldmap_instance->trackLandmark(self->mLandmarkAssetID);

	}
	else if (!self->mPosGlobal.isExactlyZero() && worldmap_instance)
	{
		gAgent.teleportViaLocation(self->mPosGlobal);
		worldmap_instance->trackLocation(self->mPosGlobal);
	}
}
示例#2
0
// static
void LLPanelPlace::onClickTeleport(void* data)
{
	LLPanelPlace* self = (LLPanelPlace*)data;

	LLView* parent_viewp = self->getParent();
	LLFloater* parent_floaterp = dynamic_cast<LLFloater*>(parent_viewp);
	if (parent_floaterp)
	{
		parent_floaterp->close();
	}
	// LLFloater* parent_floaterp = (LLFloater*)self->getParent();
	parent_viewp->setVisible(false);
	if(self->mLandmarkAssetID.notNull())
	{
		gAgent.teleportViaLandmark(self->mLandmarkAssetID);
		// remember this must be an inventory item id, not an asset UUID
		gFloaterWorldMap->trackLandmark(self->mLandmarkItemID); 
	}
	else if (!self->mPosGlobal.isExactlyZero())
	{
		gAgent.teleportViaLocation(self->mPosGlobal);
		gFloaterWorldMap->trackLocation(self->mPosGlobal);
	}
}
示例#3
0
//static 
void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **)
{
	LLUUID	agent_id;
	LLUUID	parcel_id;
	LLUUID	owner_id;
	std::string	name;
	std::string	desc;
	S32		actual_area;
	S32		billable_area;
	U8		flags;
	F32		global_x;
	F32		global_y;
	F32		global_z;
	std::string	sim_name;
	LLUUID	snapshot_id;
	F32		dwell;
	S32		sale_price;
	S32		auction_id;

	msg->getUUID("AgentData", "AgentID", agent_id );
	msg->getUUID("Data", "ParcelID", parcel_id);

	// look up all panels which have this avatar
	for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
	{
		LLPanelPlace* self = *iter;
		if (self->mParcelID != parcel_id)
		{
			continue;
		}

		msg->getUUID	("Data", "OwnerID", owner_id);
		msg->getString	("Data", "Name", name);
		msg->getString	("Data", "Desc", desc);
		msg->getS32		("Data", "ActualArea", actual_area);
		msg->getS32		("Data", "BillableArea", billable_area);
		msg->getU8		("Data", "Flags", flags);
		msg->getF32		("Data", "GlobalX", global_x);
		msg->getF32		("Data", "GlobalY", global_y);
		msg->getF32		("Data", "GlobalZ", global_z);
		msg->getString	("Data", "SimName", sim_name);
		msg->getUUID	("Data", "SnapshotID", snapshot_id);
		msg->getF32		("Data", "Dwell", dwell);
		msg->getS32		("Data", "SalePrice", sale_price);
		msg->getS32		("Data", "AuctionID", auction_id);


		self->mAuctionID = auction_id;

		if(snapshot_id.notNull())
		{
			self->mSnapshotCtrl->setImageAssetID(snapshot_id);
		}

		// Only assign the name and description if they are not empty and there is not a 
		// value present (passed in from a landmark, e.g.)

		if( !name.empty()
		   && self->mNameEditor && self->mNameEditor->getText().empty())
		{
			self->mNameEditor->setText(name);
		}

		if( !desc.empty()
			&& self->mDescEditor && self->mDescEditor->getText().empty())
		{
			self->mDescEditor->setText(desc);
		}

		std::string info_text;
		LLUIString traffic = self->getString("traffic_text");
		traffic.setArg("[TRAFFIC]", llformat("%d ", (int)dwell));
		info_text = traffic;
		LLUIString area = self->getString("area_text");
		area.setArg("[AREA]", llformat("%d", actual_area));
		info_text += area;
		if (flags & DFQ_FOR_SALE)
		{
			LLUIString forsale = self->getString("forsale_text");
			forsale.setArg("[PRICE]", llformat("%d", sale_price));
			info_text += forsale;
		}
		if (auction_id != 0)
		{
			LLUIString auction = self->getString("auction_text");
			auction.setArg("[ID]", llformat("%010d ", auction_id));
			info_text += auction;
		}
		if (self->mInfoEditor)
		{
			self->mInfoEditor->setText(info_text);
		}

		// HACK: Flag 0x1 == mature region, otherwise assume PG
		std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG);
		if (flags & 0x1)
		{
			rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE);
		}

		// Just use given region position for display
		S32 region_x = llround(self->mPosRegion.mV[0]);
		S32 region_y = llround(self->mPosRegion.mV[1]);
		S32 region_z = llround(self->mPosRegion.mV[2]);

		// If the region position is zero, grab position from the global
		if(self->mPosRegion.isExactlyZero())
		{
			region_x = llround(global_x) % REGION_WIDTH_UNITS;
			region_y = llround(global_y) % REGION_WIDTH_UNITS;
			region_z = llround(global_z);
		}

		if(self->mPosGlobal.isExactlyZero())
		{
			self->mPosGlobal.setVec(global_x, global_y, global_z);
		}

		std::string location = llformat("%s %d, %d, %d (%s)",
										sim_name.c_str(), region_x, region_y, region_z, rating.c_str());
		if (self->mLocationEditor)
		{
			self->mLocationEditor->setText(location);
		}

		BOOL show_auction = (auction_id > 0);
		self->mAuctionBtn->setVisible(show_auction);
	}
}