summaryrefslogtreecommitdiff
path: root/indra/newview/llteleporthistory.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-08-28 22:30:09 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-08-28 22:30:09 +0000
commit51500f82e23b7deff9a0e1bc23f5bfa40aec1fb9 (patch)
tree2ed65f1dd0a8404eda670cf1fe2e37769758f74a /indra/newview/llteleporthistory.cpp
parentb2b980d6979b10a08b56c10b71c12ae4f9e6ff59 (diff)
svn merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1480 https://svn.aws.productengine.com/secondlife/pe/stable-2@1489 -> viewer-2.0.0-3
* EXT-97 EXT-576 EXT-593 EXT-613 EXT-649 EXT-697 EXT-707 EXT-708 EXT-726 EXT-737
Diffstat (limited to 'indra/newview/llteleporthistory.cpp')
-rw-r--r--indra/newview/llteleporthistory.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp
index 5235dc9358..bc886d5743 100644
--- a/indra/newview/llteleporthistory.cpp
+++ b/indra/newview/llteleporthistory.cpp
@@ -40,6 +40,7 @@
#include "llagent.h"
#include "llslurl.h"
#include "llurlsimstring.h"
+#include "llviewercontrol.h" // for gSavedSettings
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
#include "llworldmap.h"
@@ -49,20 +50,9 @@
// LLTeleportHistoryItem
//////////////////////////////////////////////////////////////////////////////
-LLTeleportHistoryItem::LLTeleportHistoryItem(const LLSD& val)
+const std::string& LLTeleportHistoryItem::getTitle() const
{
- mTitle = val["title"].asString();
- mGlobalPos.setValue(val["global_pos"]);
-}
-
-LLSD LLTeleportHistoryItem::toLLSD() const
-{
- LLSD val;
-
- val["title"] = mTitle;
- val["global_pos"] = mGlobalPos.getValue();
-
- return val;
+ return gSavedSettings.getBOOL("ShowCoordinatesOption") ? mFullTitle : mTitle;
}
//////////////////////////////////////////////////////////////////////////////
@@ -149,7 +139,9 @@ void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
llwarns << "Invalid current item. (this should not happen)" << llendl;
return;
}
- mItems[mCurrentItem].mTitle = getCurrentLocationTitle();
+ LLVector3 new_pos_local = gAgent.getPosAgentFromGlobal(new_pos);
+ mItems[mCurrentItem].mFullTitle = getCurrentLocationTitle(true, new_pos_local);
+ mItems[mCurrentItem].mTitle = getCurrentLocationTitle(false, new_pos_local);
mItems[mCurrentItem].mGlobalPos = new_pos;
mItems[mCurrentItem].mRegionID = gAgent.getRegion()->getRegionID();
}
@@ -182,10 +174,12 @@ void LLTeleportHistory::purgeItems()
}
// static
-std::string LLTeleportHistory::getCurrentLocationTitle()
+std::string LLTeleportHistory::getCurrentLocationTitle(bool full, const LLVector3& local_pos_override)
{
std::string location_name;
- if (!LLAgentUI::buildLocationString(location_name, LLAgent::LOCATION_FORMAT_NORMAL)) location_name = "Unknown";
+ LLAgentUI::ELocationFormat fmt = full ? LLAgentUI::LOCATION_FORMAT_WITHOUT_SIM : LLAgentUI::LOCATION_FORMAT_NORMAL;
+
+ if (!LLAgentUI::buildLocationString(location_name, fmt, local_pos_override)) location_name = "Unknown";
return location_name;
}