From a05fdaa63eb1d92c15491134b168083b8265fe88 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Sat, 12 Mar 2011 15:46:46 +0100 Subject: [PATCH] Unbotched that --- indra/newview/llfloaterworldmap.cpp | 21 ++++++++------------- indra/newview/llfloaterworldmap.h | 4 ++-- indra/newview/llworldmap.cpp | 1 + 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 5438b9d36..ce091dc5c 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -178,17 +178,15 @@ void* LLFloaterWorldMap::createWorldMapView(void* data) BOOL LLFloaterWorldMap::postBuild() { - mTabs = getChild("maptab"); - if (!mTabs) return FALSE; - - LLPanel *panel; - + // The following callback syncs the worlmap tabs with the images. // Commented out since it was crashing when LLWorldMap became a singleton. // We should be fine without it but override the onOpen method and put it // there if it turns out to be needed. -MG // //onCommitBackground((void*)this, false); + + mPanel = getChild("objects_mapview"); childSetCommitCallback("friend combo", onAvatarComboCommit, this); @@ -249,7 +247,7 @@ BOOL LLFloaterWorldMap::postBuild() LLFloaterWorldMap::~LLFloaterWorldMap() { // All cleaned up by LLView destructor - mTabs = NULL; + mPanel = NULL; // Inventory deletes all observers on shutdown mInventory = NULL; @@ -282,7 +280,7 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target) gFloaterWorldMap->open(); /* Flawfinder: ignore */ LLWorldMapView* map_panel; - map_panel = (LLWorldMapView*)gFloaterWorldMap->mTabs->getCurrentPanel(); + map_panel = (LLWorldMapView*)gFloaterWorldMap->mPanel; map_panel->clearLastClick(); if (!was_visible) @@ -300,9 +298,8 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target) // Reload any maps that may have changed LLWorldMap::getInstance()->clearSimFlags(); - const S32 panel_num = gFloaterWorldMap->mTabs->getCurrentPanelIndex(); const bool request_from_sim = true; - LLWorldMap::getInstance()->setCurrentLayer(panel_num, request_from_sim); + LLWorldMap::getInstance()->setCurrentLayer(1, request_from_sim); // We may already have a bounding box for the regions of the world, // so use that to adjust the view. @@ -1019,9 +1016,7 @@ void LLFloaterWorldMap::adjustZoomSliderBounds() world_height_regions++; // Find how much space we have to display the world - LLWorldMapView* map_panel; - map_panel = (LLWorldMapView*)mTabs->getCurrentPanel(); - LLRect view_rect = map_panel->getRect(); + LLRect view_rect = mPanel->getRect(); // View size in pixels S32 view_width = view_rect.getWidth(); @@ -1070,7 +1065,7 @@ void LLFloaterWorldMap::onPanBtn( void* userdata ) } LLWorldMapView* map_panel; - map_panel = (LLWorldMapView*)gFloaterWorldMap->mTabs->getCurrentPanel(); + map_panel = (LLWorldMapView*)gFloaterWorldMap->mPanel; map_panel->translatePan( pan_x, pan_y ); } diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 3dd9a95f8..5c8c976d6 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -160,8 +160,8 @@ protected: void cacheLandmarkPosition(); protected: - LLTabContainer* mTabs; - + LLPanel* mPanel; // Panel displaying the map + // Sets sMapScale, in pixels per region F32 mCurZoomVal; LLFrameTimer mZoomTimer; diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 9d6d4d2b0..aa79a33da 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -294,6 +294,7 @@ bool LLWorldMap::simNameFromPosGlobal(const LLVector3d& pos_global, std::string void LLWorldMap::setCurrentLayer(S32 layer, bool request_layer) { + //TODO: we only have 1 layer -SG mCurrentMap = layer; if (!mMapLoaded[layer] || request_layer) {