From bce13197539cc6dc8ddb31d4a44677322b369fd6 Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Wed, 9 Apr 2025 23:49:53 +1000 Subject: [PATCH] Fixed copy SLurl for open sim. Fixed Z location not allowed to go negative for OpenSim. --- indra/newview/llfloaterworldmap.cpp | 46 +++++++++++++++++++++++++++-- indra/newview/llfloaterworldmap.h | 7 +++++ 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 26545a66bc..5dab7a07e2 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -57,6 +57,8 @@ #include "llnotificationsutil.h" #include "llregionhandle.h" #include "llscrolllistctrl.h" +#include "llviewernetwork.h" // Access to GridManager +#include "lfsimfeaturehandler.h" // hyperGridURL() #include "llslurl.h" #include "lltextbox.h" #include "lltoolbarview.h" @@ -77,6 +79,7 @@ #include "llmapimagetype.h" #include "llweb.h" #include "llsliderctrl.h" +#include "llspinctrl.h" // setMinValue #include "message.h" #include "llwindow.h" // copyTextToClipboard() #include @@ -396,9 +399,16 @@ bool LLFloaterWorldMap::postBuild() mLandmarkIcon = getChild("landmark_icon"); mLocationIcon = getChild("location_icon"); + // [FIRE-35333] OpenSim needs to be able to adjust the minValue + /* mTeleportCoordSpinX = getChild("teleport_coordinate_x"); mTeleportCoordSpinY = getChild("teleport_coordinate_y"); mTeleportCoordSpinZ = getChild("teleport_coordinate_z"); + */ + mTeleportCoordSpinX = getChild("teleport_coordinate_x"); + mTeleportCoordSpinY = getChild("teleport_coordinate_y"); + mTeleportCoordSpinZ = getChild("teleport_coordinate_z"); + // LLComboBox *avatar_combo = getChild("friend combo"); avatar_combo->selectFirstItem(); @@ -518,6 +528,15 @@ void LLFloaterWorldMap::onOpen(const LLSD& key) { centerOnTarget(false); } + + // [FIRE-35333] OpenSim allows Z coordinates to be negative based on MinSimHeight + if (!LLGridManager::getInstance()->isInSecondLife()) + { + LLViewerRegion* regionp = gAgent.getRegion(); + F32 min_sim_height = regionp ? regionp->getMinSimHeight() : 0.f; + mTeleportCoordSpinZ->setMinValue(min_sim_height); + } + // } // static @@ -1003,7 +1022,12 @@ void LLFloaterWorldMap::updateLocation() // Set the current SLURL // Aurora-sim var region teleports //mSLURL = LLSLURL(agent_sim_name, gAgent.getPositionGlobal()); - mSLURL = LLSLURL(agent_sim_name, gAgent.getPositionAgent()); + // [FIRE-35268] OpenSim support for when on other grids + if (LLGridManager::getInstance()->isInSecondLife()) + mSLURL = LLSLURL(agent_sim_name, gAgent.getPositionAgent()); + else + mSLURL = LLSLURL(LFSimFeatureHandler::instance().hyperGridURL(), agent_sim_name, gAgent.getPositionAgent()); + // // } } @@ -1056,7 +1080,12 @@ void LLFloaterWorldMap::updateLocation() // if ( gotSimName ) { // mSLURL = LLSLURL(sim_name, pos_global); - mSLURL = LLSLURL(sim_info->getName(), sim_info->getGlobalOrigin(), pos_global); + // [FIRE-35268] OpenSim support for when on other grids + if (LLGridManager::getInstance()->isInSecondLife()) + mSLURL = LLSLURL(sim_info->getName(), gAgent.getPositionAgent()); + else + mSLURL = LLSLURL(LFSimFeatureHandler::instance().hyperGridURL(), sim_info->getName(), gAgent.getPositionAgent()); + // } // else @@ -1079,7 +1108,18 @@ void LLFloaterWorldMap::updateLocation() void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord) { LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name); - z_coord = llclamp(z_coord, 0, 4096); + // [FIRE-35333] OpenSim allows Z coordinates to be negative based on MinSimHeight + if (!LLGridManager::getInstance()->isInSecondLife()) + { + LLViewerRegion* regionp = gAgent.getRegion(); + F32 min_sim_height = regionp ? regionp->getMinSimHeight() : 0.f; + z_coord = llclamp(z_coord, min_sim_height, 4096); + } + else + { + z_coord = llclamp(z_coord, 0, 4096); + } + // if (sim_info) { LLVector3 local_pos; diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 6a6f0e898a..d71ae9e88c 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -245,9 +245,16 @@ private: LLUICtrl* mLocationIcon = nullptr; LLSearchEditor* mLocationEditor = nullptr; + // [FIRE-35333] OpenSim needs to be able to adjust the minValue + /* LLUICtrl* mTeleportCoordSpinX = nullptr; LLUICtrl* mTeleportCoordSpinY = nullptr; LLUICtrl* mTeleportCoordSpinZ = nullptr; + */ + LLSpinCtrl* mTeleportCoordSpinX = nullptr; + LLSpinCtrl* mTeleportCoordSpinY = nullptr; + LLSpinCtrl* mTeleportCoordSpinZ = nullptr; + // LLSliderCtrl* mZoomSlider = nullptr;