diff options
Diffstat (limited to 'indra/newview/lllocationhistory.cpp')
| -rw-r--r-- | indra/newview/lllocationhistory.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/lllocationhistory.cpp b/indra/newview/lllocationhistory.cpp index 179eca2532..43512372b1 100644 --- a/indra/newview/lllocationhistory.cpp +++ b/indra/newview/lllocationhistory.cpp @@ -37,11 +37,28 @@ #include <iomanip> // for std::setw() #include "llui.h" +#include "llagent.h" +#include "llslurl.h" +#include "llviewerregion.h" +#include "llviewerparcelmgr.h" + + +void addLocationHistory() +{ + LLVector3 position = gAgent.getPositionAgent(); + std::string region_name = gAgent.getRegion()->getName(); + std::string location = LLSLURL::buildSLURL(region_name, position.mV[VX], + position.mV[VY], position.mV[VZ]); + LLLocationHistory* lh = LLLocationHistory::getInstance(); + lh->addItem(location); + lh->save(); +} LLLocationHistory::LLLocationHistory() : mFilename("typed_locations.txt"), mLoadedCallback(NULL) { + LLViewerParcelMgr::getInstance()->setTeleportFinishedCallback(addLocationHistory); } void LLLocationHistory::addItem(std::string item) |
