Fixed normal bug EXT-2452 (Favorites Bar tooltip shows only 2 out of 3 coordinates).

--HG--
branch : product-engine
master
Andrew Dyukov 2009-11-16 13:15:09 +02:00
parent e7519e8a97
commit 602921ba2d
3 changed files with 18 additions and 6 deletions

View File

@ -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);
}

View File

@ -324,7 +324,7 @@ void LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(const LLVector3d& gl
{
LLVector3 pos = sim_infop->getLocalPos(global_pos);
std::string name = sim_infop->getName() ;
cb(name, llround(pos.mV[VX]), llround(pos.mV[VY]));
cb(name, llround(pos.mV[VX]), llround(pos.mV[VY]),llround(pos.mV[VZ]));
}
else
{
@ -368,7 +368,7 @@ void LLLandmarkActions::onRegionResponseNameAndCoords(region_name_and_coords_cal
{
LLVector3 local_pos = sim_infop->getLocalPos(global_pos);
std::string name = sim_infop->getName() ;
cb(name, llround(local_pos.mV[VX]), llround(local_pos.mV[VY]));
cb(name, llround(local_pos.mV[VX]), llround(local_pos.mV[VY]), llround(local_pos.mV[VZ]));
}
}

View File

@ -43,7 +43,7 @@ class LLLandmarkActions
{
public:
typedef boost::function<void(std::string& slurl)> slurl_callback_t;
typedef boost::function<void(std::string& slurl, S32 x, S32 y)> region_name_and_coords_callback_t;
typedef boost::function<void(std::string& slurl, S32 x, S32 y, S32 z)> region_name_and_coords_callback_t;
/**
* @brief Fetches landmark LLViewerInventoryItems for the given landmark name.