diff options
Diffstat (limited to 'indra/newview/lllandmarkactions.cpp')
-rw-r--r-- | indra/newview/lllandmarkactions.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index e0dc1b6f0f..08d56f8b9f 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -39,7 +39,7 @@ #include "lllandmark.h" #include "llparcel.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llagent.h" #include "llagentui.h" @@ -267,7 +267,7 @@ void LLLandmarkActions::createLandmarkHere( } if (!canCreateLandmarkHere()) { - LLNotifications::instance().add("CannotCreateLandmarkNotOwner"); + LLNotificationsUtil::add("CannotCreateLandmarkNotOwner"); return; } @@ -324,7 +324,7 @@ void LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(const LLVector3d& gl { LLVector3 pos = sim_infop->getLocalPos(global_pos); std::string name = sim_infop->getName() ; - cb(name, llround(pos.mV[VX]), llround(pos.mV[VY])); + cb(name, llround(pos.mV[VX]), llround(pos.mV[VY]),llround(pos.mV[VZ])); } else { @@ -368,28 +368,40 @@ void LLLandmarkActions::onRegionResponseNameAndCoords(region_name_and_coords_cal { LLVector3 local_pos = sim_infop->getLocalPos(global_pos); std::string name = sim_infop->getName() ; - cb(name, llround(local_pos.mV[VX]), llround(local_pos.mV[VY])); + cb(name, llround(local_pos.mV[VX]), llround(local_pos.mV[VY]), llround(local_pos.mV[VZ])); } } bool LLLandmarkActions::getLandmarkGlobalPos(const LLUUID& landmarkInventoryItemID, LLVector3d& posGlobal) { - LLLandmark* landmark = LLLandmarkActions::getLandmark(landmarkInventoryItemID); + LLViewerInventoryItem* item = gInventory.getItem(landmarkInventoryItemID); + if (NULL == item) + return false; + + const LLUUID& asset_id = item->getAssetUUID(); + LLLandmark* landmark = gLandmarkList.getAsset(asset_id, NULL); if (NULL == landmark) return false; return landmark->getGlobalPos(posGlobal); } -LLLandmark* LLLandmarkActions::getLandmark(const LLUUID& landmarkInventoryItemID) +LLLandmark* LLLandmarkActions::getLandmark(const LLUUID& landmarkInventoryItemID, LLLandmarkList::loaded_callback_t cb) { LLViewerInventoryItem* item = gInventory.getItem(landmarkInventoryItemID); if (NULL == item) return NULL; const LLUUID& asset_id = item->getAssetUUID(); - return gLandmarkList.getAsset(asset_id, NULL); + + LLLandmark* landmark = gLandmarkList.getAsset(asset_id, cb); + if (landmark) + { + return landmark; + } + + return NULL; } void LLLandmarkActions::copySLURLtoClipboard(const LLUUID& landmarkInventoryItemID) @@ -408,5 +420,5 @@ void copy_slurl_to_clipboard_callback(const std::string& slurl) gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(slurl)); LLSD args; args["SLURL"] = slurl; - LLNotifications::instance().add("CopySLURL", args); + LLNotificationsUtil::add("CopySLURL", args); } |