diff options
author | Lynx Linden <lynx@lindenlab.com> | 2009-12-14 16:21:15 +0000 |
---|---|---|
committer | Lynx Linden <lynx@lindenlab.com> | 2009-12-14 16:21:15 +0000 |
commit | 7b2f4b6169570b8604fe3920ac18d5952ad8e79e (patch) | |
tree | c4ad1c3c9e1e1e9fe3f4c575acc9a57d99ec68f5 /indra | |
parent | 94a9b1ed0d962d9d97c026b25c81aacca018d558 (diff) |
EXT-3426: Update Place buttons based on state.
We now disable the teleport/map buttons when they cannot be used (when
we don't have a global 3D position for the parcel). We also update
this button enable state at the right times.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelplaces.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 20f1864f9d..685104a8b1 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -300,7 +300,6 @@ void LLPanelPlaces::onOpen(const LLSD& key) mItem = NULL; isLandmarkEditModeOn = false; togglePlaceInfoPanel(TRUE); - updateVerbs(); if (mPlaceInfoType == AGENT_INFO_TYPE) { @@ -371,6 +370,8 @@ void LLPanelPlaces::onOpen(const LLSD& key) mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal); } + updateVerbs(); + LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance(); if (!parcel_mgr) return; @@ -905,6 +906,7 @@ void LLPanelPlaces::changedInventory(U32 mask) void LLPanelPlaces::changedGlobalPos(const LLVector3d &global_pos) { mPosGlobal = global_pos; + updateVerbs(); } void LLPanelPlaces::updateVerbs() @@ -923,6 +925,7 @@ void LLPanelPlaces::updateVerbs() bool is_agent_place_info_visible = mPlaceInfoType == AGENT_INFO_TYPE; bool is_create_landmark_visible = mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE; + bool have_3d_pos = ! mPosGlobal.isExactlyZero(); mTeleportBtn->setVisible(!is_create_landmark_visible && !isLandmarkEditModeOn); mShowOnMapBtn->setVisible(!is_create_landmark_visible && !isLandmarkEditModeOn); @@ -932,7 +935,7 @@ void LLPanelPlaces::updateVerbs() mCancelBtn->setVisible(isLandmarkEditModeOn); mCloseBtn->setVisible(is_create_landmark_visible && !isLandmarkEditModeOn); - mShowOnMapBtn->setEnabled(!is_create_landmark_visible && !isLandmarkEditModeOn); + mShowOnMapBtn->setEnabled(!is_create_landmark_visible && !isLandmarkEditModeOn && have_3d_pos); mOverflowBtn->setEnabled(is_place_info_visible && !is_create_landmark_visible); if (is_place_info_visible) @@ -941,12 +944,12 @@ void LLPanelPlaces::updateVerbs() { // We don't need to teleport to the current location // so check if the location is not within the current parcel. - mTeleportBtn->setEnabled(!mPosGlobal.isExactlyZero() && + mTeleportBtn->setEnabled(have_3d_pos && !LLViewerParcelMgr::getInstance()->inAgentParcel(mPosGlobal)); } else if (mPlaceInfoType == LANDMARK_INFO_TYPE || mPlaceInfoType == REMOTE_PLACE_INFO_TYPE) { - mTeleportBtn->setEnabled(TRUE); + mTeleportBtn->setEnabled(have_3d_pos); } } else |