From 602921ba2d70f39cee6f19946b5d9a43d3cd8f33 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Mon, 16 Nov 2009 13:15:09 +0200 Subject: Fixed normal bug EXT-2452 (Favorites Bar tooltip shows only 2 out of 3 coordinates). --HG-- branch : product-engine --- indra/newview/llfavoritesbar.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfavoritesbar.cpp') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 01603f390d..ae5be8cc7c 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -74,6 +74,7 @@ public: mName("(Loading...)"), mPosX(0), mPosY(0), + mPosZ(0), mLoaded(false) {} @@ -101,6 +102,14 @@ public: requestNameAndPos(); return mPosY; } + + S32 getPosZ() + { + if (!mLoaded) + requestNameAndPos(); + return mPosZ; + } + private: /** * Requests landmark data from server. @@ -114,14 +123,15 @@ private: if(LLLandmarkActions::getLandmarkGlobalPos(mLandmarkID, g_pos)) { LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(g_pos, - boost::bind(&LLLandmarkInfoGetter::landmarkNameCallback, this, _1, _2, _3)); + boost::bind(&LLLandmarkInfoGetter::landmarkNameCallback, this, _1, _2, _3, _4)); } } - void landmarkNameCallback(const std::string& name, S32 x, S32 y) + void landmarkNameCallback(const std::string& name, S32 x, S32 y, S32 z) { mPosX = x; mPosY = y; + mPosZ = z; mName = name; mLoaded = true; } @@ -130,6 +140,7 @@ private: std::string mName; S32 mPosX; S32 mPosY; + S32 mPosZ; bool mLoaded; }; @@ -151,7 +162,8 @@ public: if (!region_name.empty()) { LLToolTip::Params params; - params.message = llformat("%s\n%s (%d, %d)", getLabelSelected().c_str(), region_name.c_str(), mLandmarkInfoGetter.getPosX(), mLandmarkInfoGetter.getPosY()); + params.message = llformat("%s\n%s (%d, %d, %d)", getLabelSelected().c_str(), region_name.c_str(), + mLandmarkInfoGetter.getPosX(), mLandmarkInfoGetter.getPosY(), mLandmarkInfoGetter.getPosZ()); params.sticky_rect = calcScreenRect(); LLToolTipMgr::instance().show(params); } -- cgit v1.2.3