From 8ca811f84989538d8834eb098103637d3d0d6673 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 9 Jul 2021 16:43:10 +0300 Subject: SL-14799 add "Hide beacon" button --- indra/newview/llfloaterworldmap.cpp | 102 ++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) (limited to 'indra/newview/llfloaterworldmap.cpp') diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 27197f0b06..6ca134ecd3 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -56,6 +56,7 @@ #include "llscrolllistctrl.h" #include "llslurl.h" #include "lltextbox.h" +#include "lltoolbarview.h" #include "lltracker.h" #include "lltrans.h" #include "llviewerinventory.h" // LLViewerInventoryItem @@ -87,6 +88,9 @@ static const F32 MAP_ZOOM_TIME = 0.2f; // Currently (01/26/09), this value allows the whole grid to be visible in a 1024x1024 window. static const S32 MAX_VISIBLE_REGIONS = 512; + +const S32 HIDE_BEACON_PAD = 133; + // It would be more logical to have this inside the method where it is used but to compile under gcc this // struct has to be here. struct SortRegionNames @@ -1642,3 +1646,101 @@ void LLFloaterWorldMap::onFocusLost() LLWorldMapView* map_panel = (LLWorldMapView*)gFloaterWorldMap->mPanel; map_panel->mPanning = FALSE; } + +LLPanelHideBeacon::LLPanelHideBeacon() : + mHideButton(NULL) +{ +} + +// static +LLPanelHideBeacon* LLPanelHideBeacon::getInstance() +{ + static LLPanelHideBeacon* panel = getPanelHideBeacon(); + return panel; +} + + +BOOL LLPanelHideBeacon::postBuild() +{ + mHideButton = getChild("hide_beacon_btn"); + mHideButton->setCommitCallback(boost::bind(&LLPanelHideBeacon::onHideButtonClick, this)); + + gViewerWindow->setOnWorldViewRectUpdated(boost::bind(&LLPanelHideBeacon::updatePosition, this)); + + return TRUE; +} + +//virtual +void LLPanelHideBeacon::draw() +{ + if (!LLTracker::isTracking(NULL)) + { + return; + } + updatePosition(); + LLPanel::draw(); +} + +//virtual +void LLPanelHideBeacon::setVisible(BOOL visible) +{ + if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) visible = false; + + if (visible) + { + updatePosition(); + } + + LLPanel::setVisible(visible); +} + + +//static +LLPanelHideBeacon* LLPanelHideBeacon::getPanelHideBeacon() +{ + LLPanelHideBeacon* panel = new LLPanelHideBeacon(); + panel->buildFromFile("panel_hide_beacon.xml"); + + LL_INFOS() << "Build LLPanelHideBeacon panel" << LL_ENDL; + + panel->updatePosition(); + return panel; +} + +void LLPanelHideBeacon::onHideButtonClick() +{ + LLFloaterWorldMap* instance = LLFloaterWorldMap::getInstance(); + if (instance) + { + instance->onClearBtn(); + } +} + +/** +* Updates position of the panel (similar to Stand & Stop Flying panel). +*/ +void LLPanelHideBeacon::updatePosition() +{ + S32 bottom_tb_center = 0; + if (LLToolBar* toolbar_bottom = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_BOTTOM)) + { + bottom_tb_center = toolbar_bottom->getRect().getCenterX(); + } + + S32 left_tb_width = 0; + if (LLToolBar* toolbar_left = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT)) + { + left_tb_width = toolbar_left->getRect().getWidth(); + } + + if (gToolBarView != NULL && gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT)->hasButtons()) + { + S32 x_pos = bottom_tb_center - getRect().getWidth() / 2 - left_tb_width; + setOrigin( x_pos + HIDE_BEACON_PAD, 0); + } + else + { + S32 x_pos = bottom_tb_center - getRect().getWidth() / 2; + setOrigin( x_pos + HIDE_BEACON_PAD, 0); + } +} -- cgit v1.3 From b3cd910e759bf2d0755526e0cc4972a19405ff6b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 23 Mar 2022 15:35:10 +0200 Subject: SL-17037 Center map on current location after teleporting --- indra/newview/llfloaterworldmap.cpp | 16 +++++++++++++++- indra/newview/llfloaterworldmap.h | 4 +++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterworldmap.cpp') diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 6ca134ecd3..3ec1e17bd8 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -61,6 +61,7 @@ #include "lltrans.h" #include "llviewerinventory.h" // LLViewerInventoryItem #include "llviewermenu.h" +#include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llviewerstats.h" #include "llviewertexture.h" @@ -330,6 +331,8 @@ LLFloaterWorldMap::~LLFloaterWorldMap() mFriendObserver = NULL; gFloaterWorldMap = NULL; + + mTeleportFinishConnection.disconnect(); } //static @@ -343,12 +346,16 @@ void LLFloaterWorldMap::onClose(bool app_quitting) { // While we're not visible, discard the overlay images we're using LLWorldMap::getInstance()->clearImageRefs(); + mTeleportFinishConnection.disconnect(); } // virtual void LLFloaterWorldMap::onOpen(const LLSD& key) { - bool center_on_target = (key.asString() == "center"); + mTeleportFinishConnection = LLViewerParcelMgr::getInstance()-> + setTeleportFinishedCallback(boost::bind(&LLFloaterWorldMap::onTeleportFinished, this)); + + bool center_on_target = (key.asString() == "center"); mIsClosing = FALSE; @@ -1570,6 +1577,13 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) } } +void LLFloaterWorldMap::onTeleportFinished() +{ + if(isInVisibleChain()) + { + LLWorldMapView::setPan(0, 0, TRUE); + } +} void LLFloaterWorldMap::onCommitSearchResult() { diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 30cf1b9910..14a9c26fb9 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -151,7 +151,7 @@ protected: void onCoordinatesCommit(); void onCommitSearchResult(); - void cacheLandmarkPosition(); + void onTeleportFinished(); private: LLPanel* mPanel; // Panel displaying the map @@ -195,6 +195,8 @@ private: LLCtrlListInterface * mListFriendCombo; LLCtrlListInterface * mListLandmarkCombo; LLCtrlListInterface * mListSearchResults; + + boost::signals2::connection mTeleportFinishConnection; }; extern LLFloaterWorldMap* gFloaterWorldMap; -- cgit v1.3 From d97105663f1b63feda1f56b9b3cf908c64135693 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 29 Mar 2022 18:07:06 +0300 Subject: SL-17091 FIXED Walk/Run/Fly buttons are not clickable --- indra/newview/llfloaterworldmap.cpp | 4 +++- indra/newview/skins/default/xui/en/panel_hide_beacon.xml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterworldmap.cpp') diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 3ec1e17bd8..2c84cd1f93 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -1689,8 +1689,10 @@ void LLPanelHideBeacon::draw() { if (!LLTracker::isTracking(NULL)) { - return; + mHideButton->setVisible(false); + return; } + mHideButton->setVisible(true); updatePosition(); LLPanel::draw(); } diff --git a/indra/newview/skins/default/xui/en/panel_hide_beacon.xml b/indra/newview/skins/default/xui/en/panel_hide_beacon.xml index cb22719cef..7cab285f77 100644 --- a/indra/newview/skins/default/xui/en/panel_hide_beacon.xml +++ b/indra/newview/skins/default/xui/en/panel_hide_beacon.xml @@ -15,6 +15,6 @@ name="hide_beacon_btn" tool_tip="Stop tracking and hide beacon" top="2" - visible="true" + visible="false" width="113" /> -- cgit v1.3