void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const std::string& name ) { LLCtrlSelectionInterface *iface = childGetSelectionInterface("friend combo"); if (!iface) return; buildAvatarIDList(); if(iface->setCurrentByID(avatar_id) || gAgent.isGodlike()) { // *HACK: Adjust Z values automatically for liaisons & gods so // they swoop down when they click on the map. Requested // convenience. if(gAgent.isGodlike()) { childSetValue("spin z", LLSD(200.f)); } // Don't re-request info if we already have it or we won't have it in time to teleport if (mTrackedStatus != LLTracker::TRACKING_AVATAR || name != mTrackedAvatarName) { mTrackedStatus = LLTracker::TRACKING_AVATAR; mTrackedAvatarName = name; LLTracker::trackAvatar(avatar_id, name); } } else { LLTracker::stopTracking(NULL); } setDefaultBtn("Teleport"); }
// virtual void LLFloaterWorldMap::onOpen(const LLSD& key) { //MK if (gRRenabled && ( gAgent.mRRInterface.mContainsShowworldmap || gAgent.mRRInterface.mContainsShowloc)) { // return; } //mk bool center_on_target = (key.asString() == "center"); mIsClosing = FALSE; LLWorldMapView* map_panel; map_panel = (LLWorldMapView*)gFloaterWorldMap->mPanel; map_panel->clearLastClick(); { // reset pan on show, so it centers on you again if (!center_on_target) { LLWorldMapView::setPan(0, 0, TRUE); } map_panel->updateVisibleBlocks(); // Reload items as they may have changed LLWorldMap::getInstance()->reloadItems(); // We may already have a bounding box for the regions of the world, // so use that to adjust the view. adjustZoomSliderBounds(); // Could be first show //LLFirstUse::useMap(); // Start speculative download of landmarks const LLUUID landmark_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); LLInventoryModelBackgroundFetch::instance().start(landmark_folder_id); getChild<LLUICtrl>("location")->setFocus( TRUE); gFocusMgr.triggerFocusFlash(); buildAvatarIDList(); buildLandmarkIDLists(); // If nothing is being tracked, set flag so the user position will be found mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); } if (center_on_target) { centerOnTarget(FALSE); } }
void LLFloaterWorldMap::friendsChanged() { LLAvatarTracker& t = LLAvatarTracker::instance(); const LLUUID& avatar_id = t.getAvatarID(); buildAvatarIDList(); if(avatar_id.notNull()) { LLCtrlSelectionInterface *iface = childGetSelectionInterface("friend combo"); if(!iface || !iface->setCurrentByID(avatar_id) || !t.getBuddyInfo(avatar_id)->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION) || gAgent.isGodlike()) { LLTracker::stopTracking(NULL); } } }
// static void LLFloaterWorldMap::onAvatarComboPrearrange( ) { if( mIsClosing ) { return; } LLCtrlListInterface *list = childGetListInterface("friend combo"); if (!list) return; LLUUID current_choice; if( LLAvatarTracker::instance().haveTrackingInfo() ) { current_choice = LLAvatarTracker::instance().getAvatarID(); } buildAvatarIDList(); if( !list->setCurrentByID( current_choice ) || current_choice.isNull() ) { LLTracker::stopTracking(NULL); } }