diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-04-07 14:47:25 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-04-07 14:47:25 -0400 |
commit | 52293aa4bb7af45d2c3733f20982f4acb030c2d8 (patch) | |
tree | f963815f91b6259ea403d41807d19b69e759897e /indra/newview/llfloaterworldmap.cpp | |
parent | 516ec63f52245a777725d29efe3c35e4e4e72936 (diff) | |
parent | 8ac6310020bd2d524c97c729c29a0afe4a529ecf (diff) |
automated merge
Diffstat (limited to 'indra/newview/llfloaterworldmap.cpp')
-rw-r--r-- | indra/newview/llfloaterworldmap.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 896c410e32..b3223ad494 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -125,7 +125,7 @@ public: } // support the secondlife:///app/worldmap/{LOCATION}/{COORDS} SLapp - const std::string region_name = params[0].asString(); + const std::string region_name = LLURI::unescape(params[0].asString()); S32 x = (params.size() > 1) ? params[1].asInteger() : 128; S32 y = (params.size() > 2) ? params[2].asInteger() : 128; S32 z = (params.size() > 3) ? params[3].asInteger() : 0; @@ -461,7 +461,7 @@ void LLFloaterWorldMap::draw() childSetEnabled("Teleport", (BOOL)tracking_status); // childSetEnabled("Clear", (BOOL)tracking_status); childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->isTracking()); - childSetEnabled("copy_slurl", (mSLURL.isValid()) ); + childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); setMouseOpaque(TRUE); getDragHandle()->setMouseOpaque(TRUE); @@ -660,8 +660,14 @@ void LLFloaterWorldMap::updateLocation() childSetValue("location", agent_sim_name); // Figure out where user is + LLVector3d agentPos = gAgent.getPositionGlobal(); + + S32 agent_x = llround( (F32)fmod( agentPos.mdV[VX], (F64)REGION_WIDTH_METERS ) ); + S32 agent_y = llround( (F32)fmod( agentPos.mdV[VY], (F64)REGION_WIDTH_METERS ) ); + S32 agent_z = llround( (F32)agentPos.mdV[VZ] ); + // Set the current SLURL - mSLURL = LLSLURL(agent_sim_name, gAgent.getPositionGlobal()); + mSLURL = LLSLURL::buildSLURL(agent_sim_name, agent_x, agent_y, agent_z); } } @@ -688,15 +694,18 @@ void LLFloaterWorldMap::updateLocation() } childSetValue("location", sim_name); + + F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); + F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); // simNameFromPosGlobal can fail, so don't give the user an invalid SLURL if ( gotSimName ) { - mSLURL = LLSLURL(sim_name, pos_global); + mSLURL = LLSLURL::buildSLURL(sim_name, llround(region_x), llround(region_y), llround((F32)pos_global.mdV[VZ])); } else { // Empty SLURL will disable the "Copy SLURL to clipboard" button - mSLURL = LLSLURL(); + mSLURL = ""; } } } @@ -1165,7 +1174,7 @@ void LLFloaterWorldMap::onClearBtn() mTrackedStatus = LLTracker::TRACKING_NOTHING; LLTracker::stopTracking((void *)(intptr_t)TRUE); LLWorldMap::getInstance()->cancelTracking(); - mSLURL = LLSLURL(); // Clear the SLURL since it's invalid + mSLURL = ""; // Clear the SLURL since it's invalid mSetToUserPosition = TRUE; // Revert back to the current user position } @@ -1188,10 +1197,10 @@ void LLFloaterWorldMap::onClickTeleportBtn() void LLFloaterWorldMap::onCopySLURL() { - getWindow()->copyTextToClipboard(utf8str_to_wstring(mSLURL.getSLURLString())); + getWindow()->copyTextToClipboard(utf8str_to_wstring(mSLURL)); LLSD args; - args["SLURL"] = mSLURL.getSLURLString(); + args["SLURL"] = mSLURL; LLNotificationsUtil::add("CopySLURL", args); } |