summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterworldmap.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-08-06 14:17:18 +0300
committerGitHub <noreply@github.com>2025-08-06 14:17:18 +0300
commitacc8928330fe1e5022a1e968afe7d7027b86a63a (patch)
treeb95453ecc772cb4eaf275aab6fb5a882087a4c33 /indra/newview/llfloaterworldmap.cpp
parentc25df5224f7bf150ddc56014b0389985da2eb542 (diff)
parentf338b91f7c9dbfe999b5ea9a1facb9eaeafb3407 (diff)
Merge release/2025.05 into develop
Diffstat (limited to 'indra/newview/llfloaterworldmap.cpp')
-rwxr-xr-xindra/newview/llfloaterworldmap.cpp36
1 files changed, 30 insertions, 6 deletions
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index da808bd8f2..03979edbc1 100755
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -371,6 +371,7 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key)
mWaitingForTracker(false),
mIsClosing(false),
mSetToUserPosition(true),
+ mProcessingSearchUpdate(false),
mTrackedLocation(0.0,0.0,0.0),
mTrackedStatus(LLTracker::TRACKING_NOTHING),
mParcelInfoObserver(nullptr),
@@ -384,7 +385,7 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key)
mCommitCallbackRegistrar.add("WMap.Location", boost::bind(&LLFloaterWorldMap::onLocationCommit, this));
mCommitCallbackRegistrar.add("WMap.AvatarCombo", boost::bind(&LLFloaterWorldMap::onAvatarComboCommit, this));
mCommitCallbackRegistrar.add("WMap.Landmark", boost::bind(&LLFloaterWorldMap::onLandmarkComboCommit, this));
- mCommitCallbackRegistrar.add("WMap.SearchResult", boost::bind(&LLFloaterWorldMap::onCommitSearchResult, this));
+ mCommitCallbackRegistrar.add("WMap.SearchResult", [this](LLUICtrl* ctrl, const LLSD& data) { LLFloaterWorldMap::onCommitSearchResult(false); });
mCommitCallbackRegistrar.add("WMap.GoHome", boost::bind(&LLFloaterWorldMap::onGoHome, this));
mCommitCallbackRegistrar.add("WMap.Teleport", boost::bind(&LLFloaterWorldMap::onClickTeleportBtn, this));
mCommitCallbackRegistrar.add("WMap.ShowTarget", boost::bind(&LLFloaterWorldMap::onShowTargetBtn, this));
@@ -829,6 +830,7 @@ void LLFloaterWorldMap::trackGenericItem(const LLItemInfo &item)
void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
{
+ mProcessingSearchUpdate = false;
LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global);
if (!sim_info)
{
@@ -968,7 +970,10 @@ void LLFloaterWorldMap::updateLocation()
}
}
- mLocationEditor->setValue(sim_name);
+ if (!mProcessingSearchUpdate)
+ {
+ mLocationEditor->setValue(sim_name);
+ }
// refresh coordinate display to reflect where user clicked.
LLVector3d coord_pos = LLTracker::getTrackedPositionGlobal();
@@ -1242,6 +1247,7 @@ void LLFloaterWorldMap::onGoHome()
{
gAgent.teleportHome();
closeFloater();
+ mProcessingSearchUpdate = false;
}
@@ -1411,6 +1417,7 @@ void LLFloaterWorldMap::onLocationCommit()
{
return;
}
+ mProcessingSearchUpdate = true;
LLStringUtil::toLower(str);
mCompletingRegionName = str;
@@ -1432,6 +1439,7 @@ void LLFloaterWorldMap::onCoordinatesCommit()
{
return;
}
+ mProcessingSearchUpdate = false;
S32 x_coord = (S32)mTeleportCoordSpinX->getValue().asReal();
S32 y_coord = (S32)mTeleportCoordSpinY->getValue().asReal();
@@ -1445,6 +1453,7 @@ void LLFloaterWorldMap::onCoordinatesCommit()
void LLFloaterWorldMap::onClearBtn()
{
mTrackedStatus = LLTracker::TRACKING_NOTHING;
+ mProcessingSearchUpdate = false;
LLTracker::stopTracking(true);
LLWorldMap::getInstance()->cancelTracking();
mSLURL = LLSLURL(); // Clear the SLURL since it's invalid
@@ -1461,6 +1470,7 @@ void LLFloaterWorldMap::onShowAgentBtn()
mMapView->setPanWithInterpTime(0, 0, false, 0.1f); // false == animate
// Set flag so user's location will be displayed if not tracking anything else
mSetToUserPosition = true;
+ mProcessingSearchUpdate = false;
}
void LLFloaterWorldMap::onClickTeleportBtn()
@@ -1616,6 +1626,12 @@ void LLFloaterWorldMap::teleport()
gAgent.teleportViaLocation( pos_global );
}
}
+
+ if (mProcessingSearchUpdate)
+ {
+ mProcessingSearchUpdate = false;
+ mTrackedSimName.clear();
+ }
}
void LLFloaterWorldMap::flyToLandmark()
@@ -1741,18 +1757,20 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
{
mSearchResults->selectByValue(match);
mSearchResults->setFocus(true);
- onCommitSearchResult();
+ onCommitSearchResult(false /*fully commit the only option*/);
}
// else let user decide
else
{
- mSearchResults->operateOnAll(LLCtrlListInterface::OP_DESELECT);
+ mSearchResults->selectFirstItem();
mSearchResults->setFocus(true);
+ onCommitSearchResult(true /*don't update text field*/);
}
}
else
{
// if we found nothing, say "none"
+ mProcessingSearchUpdate = false;
mSearchResults->setCommentText(LLTrans::getString("worldmap_results_none_found"));
mSearchResults->operateOnAll(LLCtrlListInterface::OP_DESELECT);
}
@@ -1766,7 +1784,7 @@ void LLFloaterWorldMap::onTeleportFinished()
}
}
-void LLFloaterWorldMap::onCommitSearchResult()
+void LLFloaterWorldMap::onCommitSearchResult(bool from_search)
{
std::string sim_name = mSearchResults->getSelectedValue().asString();
if (sim_name.empty())
@@ -1797,8 +1815,14 @@ void LLFloaterWorldMap::onCommitSearchResult()
pos_global.mdV[VY] += (F64)pos_local.mV[VY];
pos_global.mdV[VZ] = (F64)pos_local.mV[VZ];
- mLocationEditor->setValue(sim_name);
+ // Commiting search string automatically selects first item in the search list,
+ // in such case onCommitSearchResult shouldn't modify search string
+ if (!from_search)
+ {
+ mLocationEditor->setValue(sim_name);
+ }
trackLocation(pos_global);
+ mProcessingSearchUpdate = from_search;
mTrackCtrlsPanel->setDefaultBtn(mTeleportButton);
break;
}