aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterworldmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloaterworldmap.cpp137
1 files changed, 65 insertions, 72 deletions
diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp
index 9ac3133..75fbff2 100644
--- a/linden/indra/newview/llfloaterworldmap.cpp
+++ b/linden/indra/newview/llfloaterworldmap.cpp
@@ -64,7 +64,7 @@
64#include "llviewerstats.h" 64#include "llviewerstats.h"
65#include "llworldmap.h" 65#include "llworldmap.h"
66#include "llworldmapview.h" 66#include "llworldmapview.h"
67#include "llvieweruictrlfactory.h" 67#include "lluictrlfactory.h"
68#include "llappviewer.h" 68#include "llappviewer.h"
69#include "llmapimagetype.h" 69#include "llmapimagetype.h"
70#include "llweb.h" 70#include "llweb.h"
@@ -165,7 +165,7 @@ LLFloaterWorldMap::LLFloaterWorldMap()
165 LLCallbackMap::map_t factory_map; 165 LLCallbackMap::map_t factory_map;
166 factory_map["objects_mapview"] = LLCallbackMap(createWorldMapView, NULL); 166 factory_map["objects_mapview"] = LLCallbackMap(createWorldMapView, NULL);
167 factory_map["terrain_mapview"] = LLCallbackMap(createWorldMapView, NULL); 167 factory_map["terrain_mapview"] = LLCallbackMap(createWorldMapView, NULL);
168 gUICtrlFactory->buildFloater(this, "floater_world_map.xml", &factory_map); 168 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_world_map.xml", &factory_map);
169} 169}
170 170
171// static 171// static
@@ -176,29 +176,34 @@ void* LLFloaterWorldMap::createWorldMapView(void* data)
176 176
177BOOL LLFloaterWorldMap::postBuild() 177BOOL LLFloaterWorldMap::postBuild()
178{ 178{
179 mTabs = LLUICtrlFactory::getTabContainerByName(this, "maptab"); 179 mTabs = getChild<LLTabContainer>("maptab");
180 if (!mTabs) return FALSE; 180 if (!mTabs) return FALSE;
181 181
182 LLPanel *panel; 182 LLPanel *panel;
183 183
184 panel = LLUICtrlFactory::getPanelByName(mTabs, "objects_mapview"); 184 panel = mTabs->getChild<LLPanel>("objects_mapview");
185 if (panel) 185 if (panel)
186 { 186 {
187 mTabs->setTabChangeCallback(panel, onCommitBackground); 187 mTabs->setTabChangeCallback(panel, onCommitBackground);
188 mTabs->setTabUserData(panel, this); 188 mTabs->setTabUserData(panel, this);
189 } 189 }
190 panel = LLUICtrlFactory::getPanelByName(mTabs, "terrain_mapview"); 190 panel = mTabs->getChild<LLPanel>("terrain_mapview");
191 if (panel) 191 if (panel)
192 { 192 {
193 mTabs->setTabChangeCallback(panel, onCommitBackground); 193 mTabs->setTabChangeCallback(panel, onCommitBackground);
194 mTabs->setTabUserData(panel, this); 194 mTabs->setTabUserData(panel, this);
195 } 195 }
196 196
197 onCommitBackground((void*)this, false); 197 // The following callback syncs the worlmap tabs with the images.
198 // Commented out since it was crashing when LLWorldMap became a singleton.
199 // We should be fine without it but override the onOpen method and put it
200 // there if it turns out to be needed. -MG
201 //
202 //onCommitBackground((void*)this, false);
198 203
199 childSetCommitCallback("friend combo", onAvatarComboCommit, this); 204 childSetCommitCallback("friend combo", onAvatarComboCommit, this);
200 205
201 LLComboBox *avatar_combo = LLUICtrlFactory::getComboBoxByName(this, "friend combo"); 206 LLComboBox *avatar_combo = getChild<LLComboBox>("friend combo");
202 if (avatar_combo) 207 if (avatar_combo)
203 { 208 {
204 avatar_combo->selectFirstItem(); 209 avatar_combo->selectFirstItem();
@@ -210,7 +215,7 @@ BOOL LLFloaterWorldMap::postBuild()
210 215
211 childSetFocusChangedCallback("location", onLocationFocusChanged, this); 216 childSetFocusChangedCallback("location", onLocationFocusChanged, this);
212 217
213 LLLineEditor *location_editor = LLUICtrlFactory::getLineEditorByName(this, "location"); 218 LLLineEditor *location_editor = getChild<LLLineEditor>("location");
214 if (location_editor) 219 if (location_editor)
215 { 220 {
216 location_editor->setKeystrokeCallback( onSearchTextEntry ); 221 location_editor->setKeystrokeCallback( onSearchTextEntry );
@@ -224,7 +229,7 @@ BOOL LLFloaterWorldMap::postBuild()
224 229
225 childSetCommitCallback("landmark combo", onLandmarkComboCommit, this); 230 childSetCommitCallback("landmark combo", onLandmarkComboCommit, this);
226 231
227 LLComboBox *landmark_combo = LLUICtrlFactory::getComboBoxByName(this, "landmark combo"); 232 LLComboBox *landmark_combo = getChild<LLComboBox>( "landmark combo");
228 if (landmark_combo) 233 if (landmark_combo)
229 { 234 {
230 landmark_combo->selectFirstItem(); 235 landmark_combo->selectFirstItem();
@@ -294,14 +299,14 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target)
294 map_panel->updateVisibleBlocks(); 299 map_panel->updateVisibleBlocks();
295 300
296 // Reload the agent positions when we show the window 301 // Reload the agent positions when we show the window
297 gWorldMap->eraseItems(); 302 LLWorldMap::getInstance()->eraseItems();
298 303
299 // Reload any maps that may have changed 304 // Reload any maps that may have changed
300 gWorldMap->clearSimFlags(); 305 LLWorldMap::getInstance()->clearSimFlags();
301 306
302 const S32 panel_num = gFloaterWorldMap->mTabs->getCurrentPanelIndex(); 307 const S32 panel_num = gFloaterWorldMap->mTabs->getCurrentPanelIndex();
303 const bool request_from_sim = true; 308 const bool request_from_sim = true;
304 gWorldMap->setCurrentLayer(panel_num, request_from_sim); 309 LLWorldMap::getInstance()->setCurrentLayer(panel_num, request_from_sim);
305 310
306 // We may already have a bounding box for the regions of the world, 311 // We may already have a bounding box for the regions of the world,
307 // so use that to adjust the view. 312 // so use that to adjust the view.
@@ -335,9 +340,9 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target)
335// static 340// static
336void LLFloaterWorldMap::reloadIcons(void*) 341void LLFloaterWorldMap::reloadIcons(void*)
337{ 342{
338 gWorldMap->eraseItems(); 343 LLWorldMap::getInstance()->eraseItems();
339 344
340 gWorldMap->sendMapLayerRequest(); 345 LLWorldMap::getInstance()->sendMapLayerRequest();
341} 346}
342 347
343 348
@@ -376,10 +381,7 @@ void LLFloaterWorldMap::setVisible( BOOL visible )
376 if( !visible ) 381 if( !visible )
377 { 382 {
378 // While we're not visible, discard the overlay images we're using 383 // While we're not visible, discard the overlay images we're using
379 if (gWorldMap) 384 LLWorldMap::getInstance()->clearImageRefs();
380 {
381 gWorldMap->clearImageRefs();
382 }
383 } 385 }
384} 386}
385 387
@@ -394,7 +396,7 @@ BOOL LLFloaterWorldMap::handleHover(S32 x, S32 y, MASK mask)
394 396
395BOOL LLFloaterWorldMap::handleScrollWheel(S32 x, S32 y, S32 clicks) 397BOOL LLFloaterWorldMap::handleScrollWheel(S32 x, S32 y, S32 clicks)
396{ 398{
397 if (getVisible() && !isMinimized() && isFrontmost()) 399 if (!isMinimized() && isFrontmost())
398 { 400 {
399 F32 slider_value = (F32)childGetValue("zoom slider").asReal(); 401 F32 slider_value = (F32)childGetValue("zoom slider").asReal();
400 slider_value += ((F32)clicks * -0.3333f); 402 slider_value += ((F32)clicks * -0.3333f);
@@ -421,11 +423,6 @@ void LLFloaterWorldMap::reshape( S32 width, S32 height, BOOL called_from_parent
421// virtual 423// virtual
422void LLFloaterWorldMap::draw() 424void LLFloaterWorldMap::draw()
423{ 425{
424 if( !getVisible() )
425 {
426 return;
427 }
428
429 // Hide/Show Mature Events controls 426 // Hide/Show Mature Events controls
430 childSetVisible("events_mature_icon", !gAgent.isTeen()); 427 childSetVisible("events_mature_icon", !gAgent.isTeen());
431 childSetVisible("events_mature_label", !gAgent.isTeen()); 428 childSetVisible("events_mature_label", !gAgent.isTeen());
@@ -488,7 +485,7 @@ void LLFloaterWorldMap::draw()
488 485
489 childSetEnabled("Teleport", (BOOL)tracking_status); 486 childSetEnabled("Teleport", (BOOL)tracking_status);
490// childSetEnabled("Clear", (BOOL)tracking_status); 487// childSetEnabled("Clear", (BOOL)tracking_status);
491 childSetEnabled("Show Destination", (BOOL)tracking_status || gWorldMap->mIsTrackingUnknownLocation); 488 childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation);
492 childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); 489 childSetEnabled("copy_slurl", (mSLURL.size() > 0) );
493 490
494 setMouseOpaque(TRUE); 491 setMouseOpaque(TRUE);
@@ -569,7 +566,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
569 { 566 {
570 LLUUID asset_id = mLandmarkAssetIDList.get( idx ); 567 LLUUID asset_id = mLandmarkAssetIDList.get( idx );
571 LLString name; 568 LLString name;
572 LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(this, "landmark combo"); 569 LLComboBox* combo = getChild<LLComboBox>( "landmark combo");
573 if (combo) name = combo->getSimple(); 570 if (combo) name = combo->getSimple();
574 mTrackedStatus = LLTracker::TRACKING_LANDMARK; 571 mTrackedStatus = LLTracker::TRACKING_LANDMARK;
575 LLTracker::trackLandmark(mLandmarkAssetIDList.get( idx ), // assetID 572 LLTracker::trackLandmark(mLandmarkAssetIDList.get( idx ), // assetID
@@ -609,32 +606,32 @@ void LLFloaterWorldMap::trackGenericItem(const LLItemInfo &item)
609 606
610void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) 607void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
611{ 608{
612 LLSimInfo* sim_info = gWorldMap->simInfoFromPosGlobal(pos_global); 609 LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global);
613 if (!sim_info) 610 if (!sim_info)
614 { 611 {
615 gWorldMap->mIsTrackingUnknownLocation = TRUE; 612 LLWorldMap::getInstance()->mIsTrackingUnknownLocation = TRUE;
616 gWorldMap->mInvalidLocation = FALSE; 613 LLWorldMap::getInstance()->mInvalidLocation = FALSE;
617 gWorldMap->mUnknownLocation = pos_global; 614 LLWorldMap::getInstance()->mUnknownLocation = pos_global;
618 LLTracker::stopTracking(NULL); 615 LLTracker::stopTracking(NULL);
619 S32 world_x = S32(pos_global.mdV[0] / 256); 616 S32 world_x = S32(pos_global.mdV[0] / 256);
620 S32 world_y = S32(pos_global.mdV[1] / 256); 617 S32 world_y = S32(pos_global.mdV[1] / 256);
621 gWorldMap->sendMapBlockRequest(world_x, world_y, world_x, world_y, true); 618 LLWorldMap::getInstance()->sendMapBlockRequest(world_x, world_y, world_x, world_y, true);
622 setDefaultBtn(""); 619 setDefaultBtn("");
623 return; 620 return;
624 } 621 }
625 if (sim_info->mAccess == SIM_ACCESS_DOWN) 622 if (sim_info->mAccess == SIM_ACCESS_DOWN)
626 { 623 {
627 // Down sim. Show the blue circle of death! 624 // Down sim. Show the blue circle of death!
628 gWorldMap->mIsTrackingUnknownLocation = TRUE; 625 LLWorldMap::getInstance()->mIsTrackingUnknownLocation = TRUE;
629 gWorldMap->mUnknownLocation = pos_global; 626 LLWorldMap::getInstance()->mUnknownLocation = pos_global;
630 gWorldMap->mInvalidLocation = TRUE; 627 LLWorldMap::getInstance()->mInvalidLocation = TRUE;
631 LLTracker::stopTracking(NULL); 628 LLTracker::stopTracking(NULL);
632 setDefaultBtn(""); 629 setDefaultBtn("");
633 return; 630 return;
634 } 631 }
635 632
636 LLString sim_name; 633 LLString sim_name;
637 gWorldMap->simNameFromPosGlobal( pos_global, sim_name ); 634 LLWorldMap::getInstance()->simNameFromPosGlobal( pos_global, sim_name );
638 F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); 635 F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS );
639 F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); 636 F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS );
640 LLString full_name = llformat("%s (%d, %d, %d)", 637 LLString full_name = llformat("%s (%d, %d, %d)",
@@ -646,9 +643,9 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
646 LLString tooltip(""); 643 LLString tooltip("");
647 mTrackedStatus = LLTracker::TRACKING_LOCATION; 644 mTrackedStatus = LLTracker::TRACKING_LOCATION;
648 LLTracker::trackLocation(pos_global, full_name, tooltip); 645 LLTracker::trackLocation(pos_global, full_name, tooltip);
649 gWorldMap->mIsTrackingUnknownLocation = FALSE; 646 LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE;
650 gWorldMap->mIsTrackingDoubleClick = FALSE; 647 LLWorldMap::getInstance()->mIsTrackingDoubleClick = FALSE;
651 gWorldMap->mIsTrackingCommit = FALSE; 648 LLWorldMap::getInstance()->mIsTrackingCommit = FALSE;
652 649
653 setDefaultBtn("Teleport"); 650 setDefaultBtn("Teleport");
654} 651}
@@ -671,7 +668,7 @@ void LLFloaterWorldMap::updateLocation()
671 { 668 {
672 // Make sure we know where we are before setting the current user position 669 // Make sure we know where we are before setting the current user position
673 LLString agent_sim_name; 670 LLString agent_sim_name;
674 gotSimName = gWorldMap->simNameFromPosGlobal( agentPos, agent_sim_name ); 671 gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( agentPos, agent_sim_name );
675 if ( gotSimName ) 672 if ( gotSimName )
676 { 673 {
677 mSetToUserPosition = FALSE; 674 mSetToUserPosition = FALSE;
@@ -698,7 +695,7 @@ void LLFloaterWorldMap::updateLocation()
698 return; // invalid location 695 return; // invalid location
699 } 696 }
700 LLString sim_name; 697 LLString sim_name;
701 gotSimName = gWorldMap->simNameFromPosGlobal( pos_global, sim_name ); 698 gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( pos_global, sim_name );
702 if ((status != LLTracker::TRACKING_NOTHING) && 699 if ((status != LLTracker::TRACKING_NOTHING) &&
703 (status != mTrackedStatus || pos_global != mTrackedLocation || sim_name != mTrackedSimName)) 700 (status != mTrackedStatus || pos_global != mTrackedLocation || sim_name != mTrackedSimName))
704 { 701 {
@@ -739,7 +736,7 @@ void LLFloaterWorldMap::updateLocation()
739 736
740void LLFloaterWorldMap::trackURL(const LLString& region_name, S32 x_coord, S32 y_coord, S32 z_coord) 737void LLFloaterWorldMap::trackURL(const LLString& region_name, S32 x_coord, S32 y_coord, S32 z_coord)
741{ 738{
742 LLSimInfo* sim_info = gWorldMap->simInfoFromName(region_name); 739 LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name);
743 z_coord = llclamp(z_coord, 0, 1000); 740 z_coord = llclamp(z_coord, 0, 1000);
744 if (sim_info) 741 if (sim_info)
745 { 742 {
@@ -761,9 +758,9 @@ void LLFloaterWorldMap::trackURL(const LLString& region_name, S32 x_coord, S32 y
761 758
762 // pass sim name to combo box 759 // pass sim name to combo box
763 gFloaterWorldMap->mCompletingRegionName = region_name; 760 gFloaterWorldMap->mCompletingRegionName = region_name;
764 gWorldMap->sendNamedRegionRequest(region_name); 761 LLWorldMap::getInstance()->sendNamedRegionRequest(region_name);
765 LLString::toLower(gFloaterWorldMap->mCompletingRegionName); 762 LLString::toLower(gFloaterWorldMap->mCompletingRegionName);
766 gWorldMap->mIsTrackingCommit = TRUE; 763 LLWorldMap::getInstance()->mIsTrackingCommit = TRUE;
767 } 764 }
768} 765}
769 766
@@ -826,17 +823,15 @@ void LLFloaterWorldMap::friendsChanged()
826void LLFloaterWorldMap::buildAvatarIDList() 823void LLFloaterWorldMap::buildAvatarIDList()
827{ 824{
828 LLCtrlListInterface *list = childGetListInterface("friend combo"); 825 LLCtrlListInterface *list = childGetListInterface("friend combo");
829 if (!list) 826 if (!list) return;
830 { 827
831 return;
832 }
833
834 // Delete all but the "None" entry 828 // Delete all but the "None" entry
835 S32 list_size = list->getItemCount(); 829 S32 list_size = list->getItemCount();
836 if (list_size > 1) 830 while (list_size > 1)
837 { 831 {
838 list->selectItemRange(1, -1); 832 list->selectNthItem(1);
839 list->operateOnSelection(LLCtrlListInterface::OP_DELETE); 833 list->operateOnSelection(LLCtrlListInterface::OP_DELETE);
834 --list_size;
840 } 835 }
841 836
842 LLSD default_column; 837 LLSD default_column;
@@ -848,9 +843,11 @@ void LLFloaterWorldMap::buildAvatarIDList()
848 // Get all of the calling cards for avatar that are currently online 843 // Get all of the calling cards for avatar that are currently online
849 LLCollectMappableBuddies collector; 844 LLCollectMappableBuddies collector;
850 LLAvatarTracker::instance().applyFunctor(collector); 845 LLAvatarTracker::instance().applyFunctor(collector);
851 846 LLCollectMappableBuddies::buddy_map_t::iterator it;
852 for (LLCollectMappableBuddies::buddy_map_t::iterator it = collector.mMappable.begin(); 847 LLCollectMappableBuddies::buddy_map_t::iterator end;
853 it != collector.mMappable.end(); ++it) 848 it = collector.mMappable.begin();
849 end = collector.mMappable.end();
850 for( ; it != end; ++it)
854 { 851 {
855 list->addSimpleElement((*it).first, ADD_BOTTOM, (*it).second); 852 list->addSimpleElement((*it).first, ADD_BOTTOM, (*it).second);
856 } 853 }
@@ -945,7 +942,7 @@ void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui)
945 { 942 {
946 childSetValue("spin z", 0); 943 childSetValue("spin z", 0);
947 } 944 }
948 gWorldMap->mIsTrackingCommit = FALSE; 945 LLWorldMap::getInstance()->mIsTrackingCommit = FALSE;
949 mCompletingRegionName = ""; 946 mCompletingRegionName = "";
950 mExactMatch = FALSE; 947 mExactMatch = FALSE;
951} 948}
@@ -983,8 +980,8 @@ void LLFloaterWorldMap::clearAvatarSelection(BOOL clear_ui)
983void LLFloaterWorldMap::adjustZoomSliderBounds() 980void LLFloaterWorldMap::adjustZoomSliderBounds()
984{ 981{
985 // World size in regions 982 // World size in regions
986 S32 world_width_regions = gWorldMap->getWorldWidth() / REGION_WIDTH_UNITS; 983 S32 world_width_regions = LLWorldMap::getInstance()->getWorldWidth() / REGION_WIDTH_UNITS;
987 S32 world_height_regions = gWorldMap->getWorldHeight() / REGION_WIDTH_UNITS; 984 S32 world_height_regions = LLWorldMap::getInstance()->getWorldHeight() / REGION_WIDTH_UNITS;
988 985
989 // Pad the world size a little bit, so we have a nice border on 986 // Pad the world size a little bit, so we have a nice border on
990 // the edge 987 // the edge
@@ -1186,7 +1183,7 @@ void LLFloaterWorldMap::onAvatarComboCommit( LLUICtrl* ctrl, void* userdata )
1186 if (new_avatar_id.notNull()) 1183 if (new_avatar_id.notNull())
1187 { 1184 {
1188 LLString name; 1185 LLString name;
1189 LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(gFloaterWorldMap, "friend combo"); 1186 LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo");
1190 if (combo) name = combo->getSimple(); 1187 if (combo) name = combo->getSimple();
1191 self->trackAvatar(new_avatar_id, name); 1188 self->trackAvatar(new_avatar_id, name);
1192 onShowTargetBtn(self); 1189 onShowTargetBtn(self);
@@ -1243,16 +1240,16 @@ void LLFloaterWorldMap::onLocationCommit( void* userdata )
1243 1240
1244 LLString::toLower(str); 1241 LLString::toLower(str);
1245 gFloaterWorldMap->mCompletingRegionName = str; 1242 gFloaterWorldMap->mCompletingRegionName = str;
1246 gWorldMap->mIsTrackingCommit = TRUE; 1243 LLWorldMap::getInstance()->mIsTrackingCommit = TRUE;
1247 self->mExactMatch = FALSE; 1244 self->mExactMatch = FALSE;
1248 if (str.length() >= 3) 1245 if (str.length() >= 3)
1249 { 1246 {
1250 gWorldMap->sendNamedRegionRequest(str); 1247 LLWorldMap::getInstance()->sendNamedRegionRequest(str);
1251 } 1248 }
1252 else 1249 else
1253 { 1250 {
1254 str += "#"; 1251 str += "#";
1255 gWorldMap->sendNamedRegionRequest(str); 1252 LLWorldMap::getInstance()->sendNamedRegionRequest(str);
1256 } 1253 }
1257} 1254}
1258 1255
@@ -1263,7 +1260,7 @@ void LLFloaterWorldMap::onClearBtn(void* data)
1263 LLFloaterWorldMap* self = (LLFloaterWorldMap*)data; 1260 LLFloaterWorldMap* self = (LLFloaterWorldMap*)data;
1264 self->mTrackedStatus = LLTracker::TRACKING_NOTHING; 1261 self->mTrackedStatus = LLTracker::TRACKING_NOTHING;
1265 LLTracker::stopTracking((void *)(intptr_t)TRUE); 1262 LLTracker::stopTracking((void *)(intptr_t)TRUE);
1266 gWorldMap->mIsTrackingUnknownLocation = FALSE; 1263 LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE;
1267 self->mSLURL = ""; // Clear the SLURL since it's invalid 1264 self->mSLURL = ""; // Clear the SLURL since it's invalid
1268 self->mSetToUserPosition = TRUE; // Revert back to the current user position 1265 self->mSetToUserPosition = TRUE; // Revert back to the current user position
1269} 1266}
@@ -1337,9 +1334,9 @@ void LLFloaterWorldMap::centerOnTarget(BOOL animate)
1337 pos_global = LLTracker::getTrackedPositionGlobal() - gAgent.getCameraPositionGlobal(); 1334 pos_global = LLTracker::getTrackedPositionGlobal() - gAgent.getCameraPositionGlobal();
1338 } 1335 }
1339 } 1336 }
1340 else if(gWorldMap->mIsTrackingUnknownLocation) 1337 else if(LLWorldMap::getInstance()->mIsTrackingUnknownLocation)
1341 { 1338 {
1342 pos_global = gWorldMap->mUnknownLocation - gAgent.getCameraPositionGlobal();; 1339 pos_global = LLWorldMap::getInstance()->mUnknownLocation - gAgent.getCameraPositionGlobal();;
1343 } 1340 }
1344 else 1341 else
1345 { 1342 {
@@ -1532,10 +1529,7 @@ void LLFloaterWorldMap::onCommitBackground(void* userdata, bool from_click)
1532 // Find my index 1529 // Find my index
1533 S32 index = self->mTabs->getCurrentPanelIndex(); 1530 S32 index = self->mTabs->getCurrentPanelIndex();
1534 1531
1535 if (gWorldMap) 1532 LLWorldMap::getInstance()->setCurrentLayer(index);
1536 {
1537 gWorldMap->setCurrentLayer(index);
1538 }
1539} 1533}
1540 1534
1541void LLFloaterWorldMap::updateSims(bool found_null_sim) 1535void LLFloaterWorldMap::updateSims(bool found_null_sim)
@@ -1545,8 +1539,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
1545 return; 1539 return;
1546 } 1540 }
1547 1541
1548 LLScrollListCtrl *list = gUICtrlFactory->getScrollListByName(this, "search_results"); 1542 LLScrollListCtrl *list = getChild<LLScrollListCtrl>("search_results");
1549 if (!list) return;
1550 list->operateOnAll(LLCtrlListInterface::OP_DELETE); 1543 list->operateOnAll(LLCtrlListInterface::OP_DELETE);
1551 1544
1552 LLSD selected_value = list->getSelectedValue(); 1545 LLSD selected_value = list->getSelectedValue();
@@ -1556,7 +1549,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
1556 BOOL match_found = FALSE; 1549 BOOL match_found = FALSE;
1557 S32 num_results = 0; 1550 S32 num_results = 0;
1558 std::map<U64, LLSimInfo*>::const_iterator it; 1551 std::map<U64, LLSimInfo*>::const_iterator it;
1559 for (it = gWorldMap->mSimInfoMap.begin(); it != gWorldMap->mSimInfoMap.end(); ++it) 1552 for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
1560 { 1553 {
1561 LLSimInfo* info = (*it).second; 1554 LLSimInfo* info = (*it).second;
1562 LLString sim_name = info->mName; 1555 LLString sim_name = info->mName;
@@ -1565,7 +1558,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
1565 1558
1566 if (sim_name_lower.substr(0, name_length) == mCompletingRegionName) 1559 if (sim_name_lower.substr(0, name_length) == mCompletingRegionName)
1567 { 1560 {
1568 if (gWorldMap->mIsTrackingCommit) 1561 if (LLWorldMap::getInstance()->mIsTrackingCommit)
1569 { 1562 {
1570 if (sim_name_lower == mCompletingRegionName) 1563 if (sim_name_lower == mCompletingRegionName)
1571 { 1564 {
@@ -1644,7 +1637,7 @@ void LLFloaterWorldMap::onCommitSearchResult(LLUICtrl*, void* userdata)
1644 LLString::toLower(sim_name); 1637 LLString::toLower(sim_name);
1645 1638
1646 std::map<U64, LLSimInfo*>::const_iterator it; 1639 std::map<U64, LLSimInfo*>::const_iterator it;
1647 for (it = gWorldMap->mSimInfoMap.begin(); it != gWorldMap->mSimInfoMap.end(); ++it) 1640 for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
1648 { 1641 {
1649 LLSimInfo* info = (*it).second; 1642 LLSimInfo* info = (*it).second;
1650 LLString info_sim_name = info->mName; 1643 LLString info_sim_name = info->mName;