Пример #1
0
// static 
void LLFloaterWorldMap::onAvatarComboPrearrange( LLUICtrl* ctrl, void* userdata )
{
	LLFloaterWorldMap* self = gFloaterWorldMap;
	if( !self || self->mIsClosing )
	{
		return;
	}

	LLCtrlListInterface *list = self->childGetListInterface("friend combo");
	if (!list) return;

	LLUUID current_choice;

	if( LLAvatarTracker::instance().haveTrackingInfo() )
	{
		current_choice = LLAvatarTracker::instance().getAvatarID();
	}

	self->buildAvatarIDList();

	if( !list->setCurrentByID( current_choice ) || current_choice.isNull() )
	{
		LLTracker::stopTracking(NULL);
	}
}
Пример #2
0
// static 
void LLFloaterWorldMap::onAvatarComboCommit( LLUICtrl* ctrl, void* userdata )
{
	LLFloaterWorldMap* self = gFloaterWorldMap;
	if( !self || self->mIsClosing )
	{
		return;
	}

	LLCtrlListInterface *list = gFloaterWorldMap->childGetListInterface("friend combo");
	if (!list) return;

	const LLUUID& new_avatar_id = list->getCurrentID();
	if (new_avatar_id.notNull())
	{
		std::string name;
		LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo");
		if (combo) name = combo->getSimple();
		self->trackAvatar(new_avatar_id, name);
		onShowTargetBtn(self);
	}
	else
	{	// Reset to user postion if nothing is tracked
		self->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING );
	}
}
Пример #3
0
void LLFloaterWorldMap::onCheckEvents(LLUICtrl*, void* data)
{
	LLFloaterWorldMap* self = (LLFloaterWorldMap*)data;
	if(!self) return;
	self->childSetEnabled("event_mature_chk", self->childGetValue("event_chk"));
	self->childSetEnabled("event_adult_chk", self->childGetValue("event_chk"));
}
Пример #4
0
/* static */
void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport)
{
	std::string sim_string = LLSLURL::stripProtocol(url);
	std::string region_name;
	S32 x = 128;
	S32 y = 128;
	S32 z = 0;
	LLURLSimString::parse(sim_string, &region_name, &x, &y, &z);

	// remap x and y to local coordinates
	S32 local_x = x % REGION_WIDTH_UNITS;
	S32 local_y = y % REGION_WIDTH_UNITS;
	if (local_x < 0)
		local_x += REGION_WIDTH_UNITS;
	if (local_y < 0)
		local_y += REGION_WIDTH_UNITS;
	
	LLVector3 local_pos;
	local_pos.mV[VX] = (F32)local_x;
	local_pos.mV[VY] = (F32)local_y;
	local_pos.mV[VZ] = (F32)z;

	LLVector3d global_pos = from_region_handle(region_handle);
	global_pos += LLVector3d(local_pos);
	
	if (teleport)
	{	
		gAgent.teleportViaLocation(global_pos);
		LLFloaterWorldMap* instance = LLFloaterWorldMap::getInstance();
		if(instance)
		{
			instance->trackLocation(global_pos);
		}
	}
	else
	{
		LLSD key;
		key["type"] = "remote_place";
		key["x"] = global_pos.mdV[VX];
		key["y"] = global_pos.mdV[VY];
		key["z"] = global_pos.mdV[VZ];

		LLSideTray::getInstance()->showPanel("panel_places", key);

		// LLFloaterURLDisplay functionality moved to LLPanelPlaces in Side Tray.

//		// display informational floater, allow user to click teleport btn
//		LLFloaterURLDisplay* url_displayp = LLFloaterReg::getTypedInstance<LLFloaterURLDisplay>("preview_url",LLSD());
//		if(url_displayp)
//		{
//			url_displayp->displayParcelInfo(region_handle, local_pos);
//			if(snapshot_id.notNull())
//			{
//				url_displayp->setSnapshotDisplay(snapshot_id);
//			}
//			std::string locationString = llformat("%s %d, %d, %d", region_name.c_str(), x, y, z);
//			url_displayp->setLocationString(locationString);
//		}
	}
}
Пример #5
0
// static 
void LLFloaterWorldMap::updateSearchEnabled( LLUICtrl* ctrl, void* userdata )
{
	LLFloaterWorldMap *self = gFloaterWorldMap;
	if (self->childHasKeyboardFocus("location") && 
		self->childGetValue("location").asString().length() > 0)
	{
		self->setDefaultBtn("DoSearch");
	}
	else
	{
		self->setDefaultBtn(NULL);
	}
}
Пример #6
0
/* static */
void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& slurl, const LLUUID& snapshot_id, bool teleport)
{

  // we can't teleport cross grid at this point
	if((!LLGridManager::getInstance()->isSystemGrid(slurl.getGrid()) || !LLGridManager::getInstance()->isSystemGrid()) &&
	   (slurl.getGrid() != LLGridManager::getInstance()->getGrid()))
	{
		LLSD args;
		args["SLURL"] = slurl.getLocationString();
		args["CURRENT_GRID"] = LLGridManager::getInstance()->getGridLabel();
		LLSD grid_info;
		LLGridManager::getInstance()->getGridInfo(slurl.getGrid(), grid_info);
		
		if(grid_info.has(GRID_LABEL_VALUE))
		{
			args["GRID"] = grid_info[GRID_LABEL_VALUE].asString();
		}
		else 
		{
			args["GRID"] = slurl.getGrid();
		}
		LLNotificationsUtil::add("CantTeleportToGrid", args);
		return;
	}
	
	LLVector3d global_pos = from_region_handle(region_handle);
	global_pos += LLVector3d(slurl.getPosition());
	
	if (teleport)
	{	
		gAgent.teleportViaLocation(global_pos);
		LLFloaterWorldMap* instance = LLFloaterWorldMap::getInstance();
		if(instance)
		{
			instance->trackLocation(global_pos);
		}
	}
	else
	{
		LLSD key;
		key["type"] = "remote_place";
		key["x"] = global_pos.mdV[VX];
		key["y"] = global_pos.mdV[VY];
		key["z"] = global_pos.mdV[VZ];

		LLFloaterSidePanelContainer::showPanel("places", key);
	}
}
Пример #7
0
// static
void LLFloaterWorldMap::onCommitLocation(LLUICtrl* ctrl, void* userdata)
{
	LLFloaterWorldMap* self = (LLFloaterWorldMap*) userdata;
	LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus();
	if ( LLTracker::TRACKING_LOCATION == tracking_status)
	{
		LLVector3d pos_global = LLTracker::getTrackedPositionGlobal();
		F64 local_x = self->childGetValue("spin x");
		F64 local_y = self->childGetValue("spin y");
		F64 local_z = self->childGetValue("spin z");
		pos_global.mdV[VX] += -fmod(pos_global.mdV[VX], 256.0) + local_x;
		pos_global.mdV[VY] += -fmod(pos_global.mdV[VY], 256.0) + local_y;
		pos_global.mdV[VZ] = local_z;
		self->trackLocation(pos_global);
	}
}
Пример #8
0
// static
void LLFloaterWorldMap::onGoToLandmarkDialog( S32 option, void* userdata )
{
	LLFloaterWorldMap* self = (LLFloaterWorldMap*) userdata;
	switch( option )
	{
	case 0:
		self->teleportToLandmark();
		break;
	case 1:
		self->flyToLandmark();
		break;
	default:
		// nothing
		break;
	}
}
Пример #9
0
// static 
void LLFloaterWorldMap::onLandmarkComboCommit( LLUICtrl* ctrl, void* userdata )
{
	LLFloaterWorldMap* self = gFloaterWorldMap;

	if( !self || self->mIsClosing )
	{
		return;
	}

	LLCtrlListInterface *list = gFloaterWorldMap->childGetListInterface("landmark combo");
	if (!list) return;

	LLUUID asset_id;
	LLUUID item_id = list->getCurrentID();

	LLTracker::stopTracking(NULL);

	//RN: stopTracking() clears current combobox selection, need to reassert it here
	list->setCurrentByID(item_id);

	if( item_id.isNull() )
	{
	}
	else if( item_id == sHomeID )
	{
		asset_id = sHomeID;
	}
	else
	{
		LLInventoryItem* item = gInventory.getItem( item_id );
		if( item )
		{
			asset_id = item->getAssetUUID();
		}
		else
		{
			// Something went wrong, so revert to a safe value.
			item_id.setNull();
		}
	}
	
	self->trackLandmark( item_id);
	onShowTargetBtn(self);

	// Reset to user postion if nothing is tracked
	self->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING );
}
Пример #10
0
/* static */
void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& slurl, const LLUUID& snapshot_id, bool teleport)
{
 // <FS:AW optional opensim support>
#ifndef HAS_OPENSIM_SUPPORT
  // we can't teleport cross grid at this point
	if(   LLGridManager::getInstance()->getGrid(slurl.getGrid())
	   != LLGridManager::getInstance()->getGrid())
	{
		LLSD args;
		args["SLURL"] = slurl.getLocationString();
		args["CURRENT_GRID"] = LLGridManager::getInstance()->getGridLabel();
		args["GRID"] = LLGridManager::getInstance()->getGridLabel(slurl.getGrid());
		LLNotificationsUtil::add("CantTeleportToGrid", args);
		return;
	}

#endif // HAS_OPENSIM_SUPPORT
// </FS:AW optional opensim support>

	LLVector3d global_pos = from_region_handle(region_handle);
	global_pos += LLVector3d(slurl.getPosition());

	if (teleport)
	{	
		gAgent.teleportViaLocation(global_pos);
		LLFloaterWorldMap* instance = LLFloaterWorldMap::getInstance();
		if(instance)
		{
			instance->trackLocation(global_pos);
		}
	}
	else
	{
		LLSD key;
		key["type"] = "remote_place";
		key["x"] = global_pos.mdV[VX];
		key["y"] = global_pos.mdV[VY];
		key["z"] = global_pos.mdV[VZ];

		LLFloaterSidePanelContainer::showPanel("places", key);
	}
}
Пример #11
0
// static 
void LLFloaterWorldMap::onLandmarkComboPrearrange(LLUICtrl* ctrl, void* userdata)
{
	LLFloaterWorldMap* self = gFloaterWorldMap;
	if (!self || self->mIsClosing)
	{
		return;
	}

	LLCtrlListInterface *list = self->childGetListInterface("landmark combo");
	if (!list) return;

	LLUUID current_choice = list->getCurrentID();

	gFloaterWorldMap->buildLandmarkIDLists();

	if (current_choice.isNull() || !list->setCurrentByID(current_choice))
	{
		LLTracker::stopTracking(NULL);
	}
}
Пример #12
0
// static 
void LLFloaterWorldMap::onLocationCommit( void* userdata )
{
	LLFloaterWorldMap *self = gFloaterWorldMap;
	if( !self || self->mIsClosing )
	{
		return;
	}

	self->clearLocationSelection(FALSE);
	self->mCompletingRegionName = "";
	self->mLastRegionName = "";

	std::string str = self->childGetValue("location").asString();

	// Trim any leading and trailing spaces in the search target
	std::string saved_str = str;
	LLStringUtil::trim( str );
	if ( str != saved_str )
	{	// Set the value in the UI if any spaces were removed
		self->childSetValue("location", str);
	}

	LLStringUtil::toLower(str);
	gFloaterWorldMap->mCompletingRegionName = str;
	LLWorldMap::getInstance()->mIsTrackingCommit = TRUE;
	self->mExactMatch = FALSE;
	if (str.length() >= 3)
	{
		LLWorldMap::getInstance()->sendNamedRegionRequest(str);
	}
	else
	{
		str += "#";
		LLWorldMap::getInstance()->sendNamedRegionRequest(str);
	}
}
Пример #13
0
// static
void LLFloaterWorldMap::onCommitSearchResult(LLUICtrl*, void* userdata)
{
	LLFloaterWorldMap* self = (LLFloaterWorldMap*) userdata;

	LLCtrlListInterface *list = self->childGetListInterface("search_results");
	if (!list) return;

	LLSD selected_value = list->getSelectedValue();
	std::string sim_name = selected_value.asString();
	if (sim_name.empty())
	{
		return;
	}
	LLStringUtil::toLower(sim_name);

	std::map<U64, LLSimInfo*>::const_iterator it;
	for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
	{
		LLSimInfo* info = (*it).second;
		std::string info_sim_name = info->mName;
		LLStringUtil::toLower(info_sim_name);

		if (sim_name == info_sim_name)
		{
			LLVector3d pos_global = from_region_handle( info->mHandle );
			F64 local_x = self->childGetValue("spin x");
			F64 local_y = self->childGetValue("spin y");
			F64 local_z = self->childGetValue("spin z");
			pos_global.mdV[VX] += local_x;
			pos_global.mdV[VY] += local_y;
			pos_global.mdV[VZ] = local_z;

			self->childSetValue("location", sim_name);
			self->trackLocation(pos_global);
			self->setDefaultBtn("Teleport");
			break;
		}
	}

	onShowTargetBtn(self);
}
Пример #14
0
// static
void LLFloaterWorldMap::onClickTeleportBtn(void* data)
{
	LLFloaterWorldMap* self = (LLFloaterWorldMap*)data;
	self->teleport();
}
Пример #15
0
void LLFloaterWorldMap::onShowTargetBtn(void* data)
{
	LLFloaterWorldMap* self = (LLFloaterWorldMap*)data;
	self->centerOnTarget(TRUE);
}
Пример #16
0
// static
void LLFloaterWorldMap::onFlyBtn(void* data)
{
	LLFloaterWorldMap* self = (LLFloaterWorldMap*)data;
	self->fly();
}