aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterworldmap.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llfloaterworldmap.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llfloaterworldmap.cpp')
-rw-r--r--linden/indra/newview/llfloaterworldmap.cpp69
1 files changed, 37 insertions, 32 deletions
diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp
index 75fbff2..b56bfcb 100644
--- a/linden/indra/newview/llfloaterworldmap.cpp
+++ b/linden/indra/newview/llfloaterworldmap.cpp
@@ -150,7 +150,7 @@ const LLUUID LLFloaterWorldMap::sHomeID( "10000000-0000-0000-0000-000000000001"
150 150
151 151
152LLFloaterWorldMap::LLFloaterWorldMap() 152LLFloaterWorldMap::LLFloaterWorldMap()
153: LLFloater("worldmap"), 153: LLFloater(std::string("worldmap")),
154 mInventory(NULL), 154 mInventory(NULL),
155 mInventoryObserver(NULL), 155 mInventoryObserver(NULL),
156 mFriendObserver(NULL), 156 mFriendObserver(NULL),
@@ -171,7 +171,7 @@ LLFloaterWorldMap::LLFloaterWorldMap()
171// static 171// static
172void* LLFloaterWorldMap::createWorldMapView(void* data) 172void* LLFloaterWorldMap::createWorldMapView(void* data)
173{ 173{
174 return new LLWorldMapView("mapview", LLRect(0,300,400,0)); 174 return new LLWorldMapView(std::string("mapview"), LLRect(0,300,400,0));
175} 175}
176 176
177BOOL LLFloaterWorldMap::postBuild() 177BOOL LLFloaterWorldMap::postBuild()
@@ -398,12 +398,18 @@ BOOL LLFloaterWorldMap::handleScrollWheel(S32 x, S32 y, S32 clicks)
398{ 398{
399 if (!isMinimized() && isFrontmost()) 399 if (!isMinimized() && isFrontmost())
400 { 400 {
401 F32 slider_value = (F32)childGetValue("zoom slider").asReal(); 401 LLRect area;
402 slider_value += ((F32)clicks * -0.3333f); 402 childGetRect("search_results", area);
403 childSetValue("zoom slider", LLSD(slider_value)); 403 if(!area.pointInRect(x, y))
404 return TRUE; 404 {
405 F32 slider_value = (F32)childGetValue("zoom slider").asReal();
406 slider_value += ((F32)clicks * -0.3333f);
407 childSetValue("zoom slider", LLSD(slider_value));
408 return TRUE;
409 }
405 } 410 }
406 return FALSE; 411
412 return LLFloater::handleScrollWheel(x, y, clicks);
407} 413}
408 414
409 415
@@ -515,7 +521,7 @@ void LLFloaterWorldMap::draw()
515//------------------------------------------------------------------------- 521//-------------------------------------------------------------------------
516 522
517 523
518void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const LLString& name ) 524void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const std::string& name )
519{ 525{
520 LLCtrlSelectionInterface *iface = childGetSelectionInterface("friend combo"); 526 LLCtrlSelectionInterface *iface = childGetSelectionInterface("friend combo");
521 if (!iface) return; 527 if (!iface) return;
@@ -565,7 +571,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
565 if (found && iface->setCurrentByID( landmark_item_id ) ) 571 if (found && iface->setCurrentByID( landmark_item_id ) )
566 { 572 {
567 LLUUID asset_id = mLandmarkAssetIDList.get( idx ); 573 LLUUID asset_id = mLandmarkAssetIDList.get( idx );
568 LLString name; 574 std::string name;
569 LLComboBox* combo = getChild<LLComboBox>( "landmark combo"); 575 LLComboBox* combo = getChild<LLComboBox>( "landmark combo");
570 if (combo) name = combo->getSimple(); 576 if (combo) name = combo->getSimple();
571 mTrackedStatus = LLTracker::TRACKING_LANDMARK; 577 mTrackedStatus = LLTracker::TRACKING_LANDMARK;
@@ -630,17 +636,17 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
630 return; 636 return;
631 } 637 }
632 638
633 LLString sim_name; 639 std::string sim_name;
634 LLWorldMap::getInstance()->simNameFromPosGlobal( pos_global, sim_name ); 640 LLWorldMap::getInstance()->simNameFromPosGlobal( pos_global, sim_name );
635 F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); 641 F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS );
636 F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); 642 F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS );
637 LLString full_name = llformat("%s (%d, %d, %d)", 643 std::string full_name = llformat("%s (%d, %d, %d)",
638 sim_name.c_str(), 644 sim_name.c_str(),
639 llround(region_x), 645 llround(region_x),
640 llround(region_y), 646 llround(region_y),
641 llround((F32)pos_global.mdV[VZ])); 647 llround((F32)pos_global.mdV[VZ]));
642 648
643 LLString tooltip(""); 649 std::string tooltip("");
644 mTrackedStatus = LLTracker::TRACKING_LOCATION; 650 mTrackedStatus = LLTracker::TRACKING_LOCATION;
645 LLTracker::trackLocation(pos_global, full_name, tooltip); 651 LLTracker::trackLocation(pos_global, full_name, tooltip);
646 LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE; 652 LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE;
@@ -667,7 +673,7 @@ void LLFloaterWorldMap::updateLocation()
667 if ( status == LLTracker::TRACKING_NOTHING && mSetToUserPosition ) 673 if ( status == LLTracker::TRACKING_NOTHING && mSetToUserPosition )
668 { 674 {
669 // Make sure we know where we are before setting the current user position 675 // Make sure we know where we are before setting the current user position
670 LLString agent_sim_name; 676 std::string agent_sim_name;
671 gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( agentPos, agent_sim_name ); 677 gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( agentPos, agent_sim_name );
672 if ( gotSimName ) 678 if ( gotSimName )
673 { 679 {
@@ -694,7 +700,7 @@ void LLFloaterWorldMap::updateLocation()
694 700
695 return; // invalid location 701 return; // invalid location
696 } 702 }
697 LLString sim_name; 703 std::string sim_name;
698 gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( pos_global, sim_name ); 704 gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( pos_global, sim_name );
699 if ((status != LLTracker::TRACKING_NOTHING) && 705 if ((status != LLTracker::TRACKING_NOTHING) &&
700 (status != mTrackedStatus || pos_global != mTrackedLocation || sim_name != mTrackedSimName)) 706 (status != mTrackedStatus || pos_global != mTrackedLocation || sim_name != mTrackedSimName))
@@ -734,7 +740,7 @@ void LLFloaterWorldMap::updateLocation()
734 } 740 }
735} 741}
736 742
737void LLFloaterWorldMap::trackURL(const LLString& region_name, S32 x_coord, S32 y_coord, S32 z_coord) 743void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord)
738{ 744{
739 LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name); 745 LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name);
740 z_coord = llclamp(z_coord, 0, 1000); 746 z_coord = llclamp(z_coord, 0, 1000);
@@ -759,7 +765,7 @@ void LLFloaterWorldMap::trackURL(const LLString& region_name, S32 x_coord, S32 y
759 // pass sim name to combo box 765 // pass sim name to combo box
760 gFloaterWorldMap->mCompletingRegionName = region_name; 766 gFloaterWorldMap->mCompletingRegionName = region_name;
761 LLWorldMap::getInstance()->sendNamedRegionRequest(region_name); 767 LLWorldMap::getInstance()->sendNamedRegionRequest(region_name);
762 LLString::toLower(gFloaterWorldMap->mCompletingRegionName); 768 LLStringUtil::toLower(gFloaterWorldMap->mCompletingRegionName);
763 LLWorldMap::getInstance()->mIsTrackingCommit = TRUE; 769 LLWorldMap::getInstance()->mIsTrackingCommit = TRUE;
764 } 770 }
765} 771}
@@ -904,8 +910,7 @@ void LLFloaterWorldMap::buildLandmarkIDLists()
904 mLandmarkAssetIDList.put( item->getAssetUUID() ); 910 mLandmarkAssetIDList.put( item->getAssetUUID() );
905 mLandmarkItemIDList.put( item->getUUID() ); 911 mLandmarkItemIDList.put( item->getUUID() );
906 } 912 }
907 913 list->sortByColumn(std::string("landmark name"), TRUE);
908 list->sortByColumn("landmark name", TRUE);
909 914
910 list->selectFirstItem(); 915 list->selectFirstItem();
911} 916}
@@ -1182,7 +1187,7 @@ void LLFloaterWorldMap::onAvatarComboCommit( LLUICtrl* ctrl, void* userdata )
1182 const LLUUID& new_avatar_id = list->getCurrentID(); 1187 const LLUUID& new_avatar_id = list->getCurrentID();
1183 if (new_avatar_id.notNull()) 1188 if (new_avatar_id.notNull())
1184 { 1189 {
1185 LLString name; 1190 std::string name;
1186 LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo"); 1191 LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo");
1187 if (combo) name = combo->getSimple(); 1192 if (combo) name = combo->getSimple();
1188 self->trackAvatar(new_avatar_id, name); 1193 self->trackAvatar(new_avatar_id, name);
@@ -1228,17 +1233,17 @@ void LLFloaterWorldMap::onLocationCommit( void* userdata )
1228 self->mCompletingRegionName = ""; 1233 self->mCompletingRegionName = "";
1229 self->mLastRegionName = ""; 1234 self->mLastRegionName = "";
1230 1235
1231 LLString str = self->childGetValue("location").asString(); 1236 std::string str = self->childGetValue("location").asString();
1232 1237
1233 // Trim any leading and trailing spaces in the search target 1238 // Trim any leading and trailing spaces in the search target
1234 LLString saved_str = str; 1239 std::string saved_str = str;
1235 LLString::trim( str ); 1240 LLStringUtil::trim( str );
1236 if ( str != saved_str ) 1241 if ( str != saved_str )
1237 { // Set the value in the UI if any spaces were removed 1242 { // Set the value in the UI if any spaces were removed
1238 self->childSetValue("location", str); 1243 self->childSetValue("location", str);
1239 } 1244 }
1240 1245
1241 LLString::toLower(str); 1246 LLStringUtil::toLower(str);
1242 gFloaterWorldMap->mCompletingRegionName = str; 1247 gFloaterWorldMap->mCompletingRegionName = str;
1243 LLWorldMap::getInstance()->mIsTrackingCommit = TRUE; 1248 LLWorldMap::getInstance()->mIsTrackingCommit = TRUE;
1244 self->mExactMatch = FALSE; 1249 self->mExactMatch = FALSE;
@@ -1300,7 +1305,7 @@ void LLFloaterWorldMap::onCopySLURL(void* data)
1300 LLFloaterWorldMap* self = (LLFloaterWorldMap*)data; 1305 LLFloaterWorldMap* self = (LLFloaterWorldMap*)data;
1301 gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(self->mSLURL)); 1306 gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(self->mSLURL));
1302 1307
1303 LLString::format_map_t args; 1308 LLStringUtil::format_map_t args;
1304 args["[SLURL]"] = self->mSLURL; 1309 args["[SLURL]"] = self->mSLURL;
1305 1310
1306 LLAlertDialog::showXml("CopySLURL", args); 1311 LLAlertDialog::showXml("CopySLURL", args);
@@ -1552,9 +1557,9 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
1552 for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it) 1557 for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
1553 { 1558 {
1554 LLSimInfo* info = (*it).second; 1559 LLSimInfo* info = (*it).second;
1555 LLString sim_name = info->mName; 1560 std::string sim_name = info->mName;
1556 LLString sim_name_lower = sim_name; 1561 std::string sim_name_lower = sim_name;
1557 LLString::toLower(sim_name_lower); 1562 LLStringUtil::toLower(sim_name_lower);
1558 1563
1559 if (sim_name_lower.substr(0, name_length) == mCompletingRegionName) 1564 if (sim_name_lower.substr(0, name_length) == mCompletingRegionName)
1560 { 1565 {
@@ -1597,7 +1602,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
1597 } 1602 }
1598 else 1603 else
1599 { 1604 {
1600 list->addCommentText("None found."); 1605 list->addCommentText(std::string("None found."));
1601 list->operateOnAll(LLCtrlListInterface::OP_DESELECT); 1606 list->operateOnAll(LLCtrlListInterface::OP_DESELECT);
1602 } 1607 }
1603} 1608}
@@ -1629,19 +1634,19 @@ void LLFloaterWorldMap::onCommitSearchResult(LLUICtrl*, void* userdata)
1629 if (!list) return; 1634 if (!list) return;
1630 1635
1631 LLSD selected_value = list->getSelectedValue(); 1636 LLSD selected_value = list->getSelectedValue();
1632 LLString sim_name = selected_value.asString(); 1637 std::string sim_name = selected_value.asString();
1633 if (sim_name.empty()) 1638 if (sim_name.empty())
1634 { 1639 {
1635 return; 1640 return;
1636 } 1641 }
1637 LLString::toLower(sim_name); 1642 LLStringUtil::toLower(sim_name);
1638 1643
1639 std::map<U64, LLSimInfo*>::const_iterator it; 1644 std::map<U64, LLSimInfo*>::const_iterator it;
1640 for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it) 1645 for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
1641 { 1646 {
1642 LLSimInfo* info = (*it).second; 1647 LLSimInfo* info = (*it).second;
1643 LLString info_sim_name = info->mName; 1648 std::string info_sim_name = info->mName;
1644 LLString::toLower(info_sim_name); 1649 LLStringUtil::toLower(info_sim_name);
1645 1650
1646 if (sim_name == info_sim_name) 1651 if (sim_name == info_sim_name)
1647 { 1652 {