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()) { getChild<LLUICtrl>("spin z")->setValue(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); centerOnTarget(TRUE); } } 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); } }
// virtual void LLFloaterWorldMap::draw() { // Hide/Show Mature Events controls childSetVisible("events_mature_icon", !gAgent.isTeen()); childSetVisible("events_mature_label", !gAgent.isTeen()); childSetVisible("event_mature_chk", !gAgent.isTeen()); // On orientation island, users don't have a home location yet, so don't // let them teleport "home". It dumps them in an often-crowed welcome // area (infohub) and they get confused. JC LLViewerRegion* regionp = gAgent.getRegion(); bool agent_on_prelude = (regionp && regionp->isPrelude()); bool enable_go_home = gAgent.isGodlike() || !agent_on_prelude; childSetEnabled("Go Home", enable_go_home); updateLocation(); LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); if (LLTracker::TRACKING_AVATAR == tracking_status) { childSetColor("avatar_icon", gTrackColor); } else { childSetColor("avatar_icon", gDisabledTrackColor); } if (LLTracker::TRACKING_LANDMARK == tracking_status) { childSetColor("landmark_icon", gTrackColor); } else { childSetColor("landmark_icon", gDisabledTrackColor); } if (LLTracker::TRACKING_LOCATION == tracking_status) { childSetColor("location_icon", gTrackColor); } else { if (mCompletingRegionName != "") { F64 seconds = LLTimer::getElapsedSeconds(); double value = fmod(seconds, 2); value = 0.5 + 0.5*cos(value * 3.14159f); LLColor4 loading_color(0.0, F32(value/2), F32(value), 1.0); childSetColor("location_icon", loading_color); } else { childSetColor("location_icon", gDisabledTrackColor); } } // check for completion of tracking data if (mWaitingForTracker) { centerOnTarget(TRUE); } // childSetEnabled("Clear", (BOOL)tracking_status); childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation); childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); setMouseOpaque(TRUE); getDragHandle()->setMouseOpaque(TRUE); //RN: snaps to zoom value because interpolation caused jitter in the text rendering if (!mZoomTimer.getStarted() && mCurZoomVal != (F32)childGetValue("zoom slider").asReal()) { mZoomTimer.start(); } F32 interp = mZoomTimer.getElapsedTimeF32() / MAP_ZOOM_TIME; if (interp > 1.f) { interp = 1.f; mZoomTimer.stop(); } mCurZoomVal = lerp(mCurZoomVal, (F32)childGetValue("zoom slider").asReal(), interp); F32 map_scale = 256.f*pow(2.f, mCurZoomVal); LLWorldMapView::setScale( map_scale ); LLFloater::draw(); }
// virtual void LLFloaterWorldMap::draw() { static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white); static LLUIColor map_track_disabled_color = LLUIColorTable::instance().getColor("MapTrackDisabledColor", LLColor4::white); // Hide/Show Mature Events controls childSetVisible("events_mature_icon", gAgent.canAccessMature()); childSetVisible("events_mature_label", gAgent.canAccessMature()); childSetVisible("event_mature_chk", gAgent.canAccessMature()); childSetVisible("events_adult_icon", gAgent.canAccessMature()); childSetVisible("events_adult_label", gAgent.canAccessMature()); childSetVisible("event_adult_chk", gAgent.canAccessMature()); bool adult_enabled = gAgent.canAccessAdult(); if (!adult_enabled) { childSetValue("event_adult_chk", FALSE); } childSetEnabled("event_adult_chk", adult_enabled); // On orientation island, users don't have a home location yet, so don't // let them teleport "home". It dumps them in an often-crowed welcome // area (infohub) and they get confused. JC LLViewerRegion* regionp = gAgent.getRegion(); bool agent_on_prelude = (regionp && regionp->isPrelude()); bool enable_go_home = gAgent.isGodlike() || !agent_on_prelude; childSetEnabled("Go Home", enable_go_home); updateLocation(); LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); if (LLTracker::TRACKING_AVATAR == tracking_status) { childSetColor("avatar_icon", map_track_color); } else { childSetColor("avatar_icon", map_track_disabled_color); } if (LLTracker::TRACKING_LANDMARK == tracking_status) { childSetColor("landmark_icon", map_track_color); } else { childSetColor("landmark_icon", map_track_disabled_color); } if (LLTracker::TRACKING_LOCATION == tracking_status) { childSetColor("location_icon", map_track_color); } else { if (mCompletingRegionName != "") { F64 seconds = LLTimer::getElapsedSeconds(); double value = fmod(seconds, 2); value = 0.5 + 0.5*cos(value * F_PI); LLColor4 loading_color(0.0, F32(value/2), F32(value), 1.0); childSetColor("location_icon", loading_color); } else { childSetColor("location_icon", map_track_disabled_color); } } // check for completion of tracking data if (mWaitingForTracker) { centerOnTarget(TRUE); } childSetEnabled("Teleport", (BOOL)tracking_status); // childSetEnabled("Clear", (BOOL)tracking_status); childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->isTracking()); childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); setMouseOpaque(TRUE); getDragHandle()->setMouseOpaque(TRUE); //RN: snaps to zoom value because interpolation caused jitter in the text rendering if (!mZoomTimer.getStarted() && mCurZoomVal != (F32)childGetValue("zoom slider").asReal()) { mZoomTimer.start(); } F32 interp = mZoomTimer.getElapsedTimeF32() / MAP_ZOOM_TIME; if (interp > 1.f) { interp = 1.f; mZoomTimer.stop(); } mCurZoomVal = lerp(mCurZoomVal, (F32)childGetValue("zoom slider").asReal(), interp); F32 map_scale = 256.f*pow(2.f, mCurZoomVal); LLWorldMapView::setScale( map_scale ); // Enable/disable checkboxes depending on the zoom level // If above threshold level (i.e. low res) -> Disable all checkboxes // If under threshold level (i.e. high res) -> Enable all checkboxes bool enable = LLWorldMapView::showRegionInfo(); childSetEnabled("people_chk", enable); childSetEnabled("infohub_chk", enable); childSetEnabled("telehub_chk", enable); childSetEnabled("land_for_sale_chk", enable); childSetEnabled("event_chk", enable); childSetEnabled("event_mature_chk", enable); childSetEnabled("event_adult_chk", enable); LLFloater::draw(); }
void LLFloaterWorldMap::onShowTargetBtn() { centerOnTarget(TRUE); }