diff options
-rw-r--r-- | indra/newview/llavataractions.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llavataractions.h | 5 | ||||
-rw-r--r-- | indra/newview/llpanelavatar.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llpanelpeoplemenus.cpp | 10 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_people_nearby.xml | 10 |
5 files changed, 40 insertions, 6 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 1d75374930..e6666c7f83 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -50,6 +50,7 @@ #include "llfloatergroups.h" #include "llfloaterreg.h" #include "llfloaterpay.h" +#include "llfloaterworldmap.h" #include "llinventorymodel.h" // for gInventory.findCategoryUUIDForType #include "llimview.h" // for gIMMgr #include "llmutelist.h" @@ -317,6 +318,20 @@ void LLAvatarActions::showProfile(const LLUUID& id) } // static +void LLAvatarActions::showOnMap(const LLUUID& id) +{ + std::string name; + if (!gCacheName->getFullName(id, name)) + { + gCacheName->get(id, FALSE, boost::bind(&LLAvatarActions::showOnMap, id)); + return; + } + + gFloaterWorldMap->trackAvatar(id, name); + LLFloaterReg::showInstance("world_map"); +} + +// static void LLAvatarActions::pay(const LLUUID& id) { LLNotification::Params params("BusyModePay"); diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 16a58718a2..a7f3acad4f 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -99,6 +99,11 @@ public: static void showProfile(const LLUUID& id); /** + * Show avatar on world map. + */ + static void showOnMap(const LLUUID& id); + + /** * Give money to the avatar. */ static void pay(const LLUUID& id); diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 6b07409676..b61d3ef371 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -48,7 +48,6 @@ #include "llscrollcontainer.h" #include "llavatariconctrl.h" #include "llweb.h" -#include "llfloaterworldmap.h" #include "llfloaterreg.h" #include "llnotificationsutil.h" #include "llvoiceclient.h" @@ -449,10 +448,7 @@ void LLPanelProfileTab::scrollToTop() void LLPanelProfileTab::onMapButtonClick() { - std::string name; - gCacheName->getFullName(getAvatarId(), name); - gFloaterWorldMap->trackAvatar(getAvatarId(), name); - LLFloaterReg::showInstance("world_map"); + LLAvatarActions::showOnMap(getAvatarId()); } void LLPanelProfileTab::updateButtons() diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 900d28adca..854651cd01 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -39,6 +39,7 @@ #include "llpanelpeoplemenus.h" // newview +#include "llagent.h" #include "llagentdata.h" // for gAgentID #include "llavataractions.h" #include "llviewermenu.h" // for gMenuHolder @@ -125,7 +126,7 @@ LLContextMenu* NearbyMenu::createMenu() registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startIM, id)); registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startCall, id)); registrar.add("Avatar.OfferTeleport", boost::bind(&NearbyMenu::offerTeleport, this)); - registrar.add("Avatar.ShowOnMap", boost::bind(&LLAvatarActions::startIM, id)); // *TODO: unimplemented + registrar.add("Avatar.ShowOnMap", boost::bind(&LLAvatarActions::showOnMap, id)); registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::share, id)); registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, id)); registrar.add("Avatar.BlockUnblock", boost::bind(&LLAvatarActions::toggleBlock, id)); @@ -218,6 +219,13 @@ bool NearbyMenu::enableContextMenuItem(const LLSD& userdata) { return LLAvatarActions::canCall(); } + else if (item == std::string("can_show_on_map")) + { + const LLUUID& id = mUUIDs.front(); + + return (LLAvatarTracker::instance().isBuddyOnline(id) && is_agent_mappable(id)) + || gAgent.isGodlike(); + } return false; } diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml index 9d2ccba4da..014a52bb4f 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml @@ -47,6 +47,16 @@ parameter="can_call" /> </menu_item_call> <menu_item_call + label="Map" + layout="topleft" + name="Map"> + <menu_item_call.on_click + function="Avatar.ShowOnMap" /> + <menu_item_call.on_enable + function="Avatar.EnableItem" + parameter="can_show_on_map" /> + </menu_item_call> + <menu_item_call label="Share" layout="topleft" name="Share"> |