From 457f0d9f42f1c6d80b95435a5d2650474b96926b Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 7 Mar 2009 18:55:47 -0700 Subject: Landmark icons now correctly change color when visited (patch by Zi Ree--VWR-7896) --- linden/indra/newview/llfloaterurldisplay.cpp | 3 ++- linden/indra/newview/llinventorybridge.cpp | 13 ++++++------- linden/indra/newview/llpanelinventory.cpp | 6 +++++- linden/indra/newview/llpanelplace.cpp | 6 ++++-- linden/indra/newview/llpanelplace.h | 2 ++ linden/indra/newview/llpreviewlandmark.cpp | 2 +- linden/indra/newview/llviewermessage.cpp | 6 +++++- 7 files changed, 25 insertions(+), 13 deletions(-) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/llfloaterurldisplay.cpp b/linden/indra/newview/llfloaterurldisplay.cpp index 563eaf6..457d8b6 100644 --- a/linden/indra/newview/llfloaterurldisplay.cpp +++ b/linden/indra/newview/llfloaterurldisplay.cpp @@ -75,7 +75,8 @@ void LLFloaterURLDisplay::displayParcelInfo(U64 region_handle, const LLVector3& LLUUID region_id; // don't know this LLUUID landmark_asset_id; // don't know this either - mPlacePanel->displayParcelInfo(pos_local, landmark_asset_id, region_id, pos_global); + LLUUID landmark_item_id; // don't know this either + mPlacePanel->displayParcelInfo(pos_local, landmark_asset_id, landmark_item_id, region_id, pos_global); this->setVisible(true); this->setFrontmost(true); diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index 34277f7..9506786 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp @@ -2606,7 +2606,7 @@ void LLLandmarkBridge::performAction(LLFolderView* folder, LLInventoryModel* mod // because you'll probably arrive at a telehub instead if( gFloaterWorldMap ) { - gFloaterWorldMap->trackLandmark( item->getAssetUUID() ); + gFloaterWorldMap->trackLandmark(item->getUUID()); // remember this must be the item UUID, not the asset UUID } } } @@ -2651,20 +2651,19 @@ void open_landmark(LLViewerInventoryItem* inv_item, static void open_landmark_callback(S32 option, void* data) { - LLUUID* asset_idp = (LLUUID*)data; + LLInventoryItem* itemp = (LLInventoryItem*)data; if (option == 0) { // HACK: This is to demonstrate teleport on double click for landmarks - gAgent.teleportViaLandmark( *asset_idp ); + gAgent.teleportViaLandmark( itemp->getAssetUUID() ); // we now automatically track the landmark you're teleporting to // because you'll probably arrive at a telehub instead if( gFloaterWorldMap ) { - gFloaterWorldMap->trackLandmark( *asset_idp ); + gFloaterWorldMap->trackLandmark( itemp->getUUID() ); // remember this is the item UUID not the asset UUID } } - delete asset_idp; } void LLLandmarkBridge::openItem() @@ -2675,9 +2674,9 @@ void LLLandmarkBridge::openItem() // Opening (double-clicking) a landmark immediately teleports, // but warns you the first time. // open_landmark(item, std::string(" ") + getPrefix() + item->getName(), FALSE); - LLUUID* asset_idp = new LLUUID(item->getAssetUUID()); LLAlertDialog::showXml("TeleportFromLandmark", - open_landmark_callback, (void*)asset_idp); + // send the full inventory item so the callback can use both asset UUID and inventory item id + open_landmark_callback, (void*)item); } } diff --git a/linden/indra/newview/llpanelinventory.cpp b/linden/indra/newview/llpanelinventory.cpp index 7277f05..631733a 100644 --- a/linden/indra/newview/llpanelinventory.cpp +++ b/linden/indra/newview/llpanelinventory.cpp @@ -1080,7 +1080,11 @@ LLTaskLandmarkBridge::LLTaskLandmarkBridge( LLUIImagePtr LLTaskLandmarkBridge::getIcon() const { - return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, 0, FALSE); + LLInventoryItem* item = findItem(); + BOOL visited = FALSE; + if(item->getFlags() & LLInventoryItem::II_FLAGS_LANDMARK_VISITED) visited=TRUE; + // attachment point parameter in get_item_icon is used for visited/unvisited landmark + return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, visited, FALSE); } diff --git a/linden/indra/newview/llpanelplace.cpp b/linden/indra/newview/llpanelplace.cpp index d8813b3..42134f3 100644 --- a/linden/indra/newview/llpanelplace.cpp +++ b/linden/indra/newview/llpanelplace.cpp @@ -333,6 +333,7 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **) void LLPanelPlace::displayParcelInfo(const LLVector3& pos_region, const LLUUID& landmark_asset_id, + const LLUUID& landmark_item_id, // item_id to be able to send map correct id const LLUUID& region_id, const LLVector3d& pos_global) { @@ -340,6 +341,7 @@ void LLPanelPlace::displayParcelInfo(const LLVector3& pos_region, mPosRegion = pos_region; mPosGlobal = pos_global; mLandmarkAssetID = landmark_asset_id; + mLandmarkItemID = landmark_item_id; std::string url = gAgent.getRegion()->getCapability("RemoteParcelRequest"); if (!url.empty()) { @@ -379,8 +381,8 @@ void LLPanelPlace::onClickTeleport(void* data) if(self->mLandmarkAssetID.notNull()) { gAgent.teleportViaLandmark(self->mLandmarkAssetID); - gFloaterWorldMap->trackLandmark(self->mLandmarkAssetID); - + // remember this must be an inventory item id, not an asset UUID + gFloaterWorldMap->trackLandmark(self->mLandmarkItemID); } else if (!self->mPosGlobal.isExactlyZero()) { diff --git a/linden/indra/newview/llpanelplace.h b/linden/indra/newview/llpanelplace.h index df53013..0478d93 100644 --- a/linden/indra/newview/llpanelplace.h +++ b/linden/indra/newview/llpanelplace.h @@ -70,6 +70,7 @@ public: void sendParcelInfoRequest(); void displayParcelInfo(const LLVector3& pos_region, const LLUUID& landmark_asset_id, + const LLUUID& landmark_item_id, // so we can send map floater the correct inventory item id const LLUUID& region_id, const LLVector3d& pos_global); static void processParcelInfoReply(LLMessageSystem* msg, void**); @@ -90,6 +91,7 @@ protected: LLUUID mRequestedID; LLUUID mRegionID; LLUUID mLandmarkAssetID; + LLUUID mLandmarkItemID; // Absolute position of the location for teleport, may not // be available (hence zero) LLVector3d mPosGlobal; diff --git a/linden/indra/newview/llpreviewlandmark.cpp b/linden/indra/newview/llpreviewlandmark.cpp index 20b0ee5..3a92f5a 100644 --- a/linden/indra/newview/llpreviewlandmark.cpp +++ b/linden/indra/newview/llpreviewlandmark.cpp @@ -189,7 +189,7 @@ void LLPreviewLandmark::draw() LLUUID region_id; mLandmark->getRegionID(region_id); // might find null? LLVector3d pos_global = getPositionGlobal(); // might be 0 - mPlacePanel->displayParcelInfo(pos_region, landmark_asset_id, region_id, pos_global); + mPlacePanel->displayParcelInfo(pos_region, landmark_asset_id, getItem()->getUUID(), region_id, pos_global); } } diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 221de59..86eca8f 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -2768,7 +2768,11 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) LLVector3 beacon_dir(agent_pos.mV[VX] - (F32)fmod(beacon_pos.mdV[VX], 256.0), agent_pos.mV[VY] - (F32)fmod(beacon_pos.mdV[VY], 256.0), 0); if (beacon_dir.magVecSquared() < 25.f) { - LLTracker::stopTracking(NULL); + // do not stop tracking landmarks here, so they can properly be marked as visited in LLTracker() + if(LLTracker::getTrackingStatus()!=LLTracker::TRACKING_LANDMARK) + { + LLTracker::stopTracking(NULL); + } } else if ( is_teleport ) { -- cgit v1.1