From 29aef502ea4f058b067c7be38b3567f7b9e68fe6 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Sat, 8 Jan 2011 02:17:04 +0100 Subject: [PATCH] Fixes focusing from minimap --- indra/newview/app_settings/settings.xml | 4 ++-- indra/newview/llfloateravatarlist.cpp | 16 ++++++++++++++++ indra/newview/llfloateravatarlist.h | 2 ++ indra/newview/llnetmap.cpp | 10 ++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2b0e68bb3..6e3a5b265 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13672,13 +13672,13 @@ ContactListCollapsed Comment - Send a digest of texture info to the sim + Hide extended friend information in contact list Persist 1 Type Boolean Value - 1 + 0 FloaterHexRect diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index f943ae641..16a40f188 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -1141,6 +1141,22 @@ void LLFloaterAvatarList::focusOnNext(BOOL marked_only) } } +/*static*/ +void LLFloaterAvatarList::lookAtAvatar(LLUUID &uuid) +{ // twisted laws + LLViewerObject* voavatar = gObjectList.findObject(uuid); + if(voavatar && voavatar->isAvatar()) + { + gAgent.setFocusOnAvatar(FALSE, FALSE); + gAgent.changeCameraToThirdPerson(); + gAgent.setFocusGlobal(voavatar->getPositionGlobal(),uuid); + gAgent.setCameraPosAndFocusGlobal(voavatar->getPositionGlobal() + + LLVector3d(3.5,1.35,0.75) * voavatar->getRotation(), + voavatar->getPositionGlobal(), + uuid ); + } +} + //static void LLFloaterAvatarList::onClickPrevInList(void *userdata) { diff --git a/indra/newview/llfloateravatarlist.h b/indra/newview/llfloateravatarlist.h index b34c5c3d9..3afd6929d 100644 --- a/indra/newview/llfloateravatarlist.h +++ b/indra/newview/llfloateravatarlist.h @@ -182,6 +182,8 @@ public: std::string getSelectedName(); LLUUID getSelectedID(); + static void lookAtAvatar(LLUUID &uuid); + static void sound_trigger_hook(LLMessageSystem* msg,void **); static void sendKeys(); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 8a3b348c6..b5dc030b2 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -115,6 +115,7 @@ LLNetMap::LLNetMap(const std::string& name) : (new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking"); (new LLShowAgentProfile())->registerListener(this, "MiniMap.ShowProfile"); (new LLEnableProfile())->registerListener(this, "MiniMap.EnableProfile"); + (new LLCamFollow())->registerListener(this, "MiniMap.CamFollow"); //moymod - add cam follow crap thingie (new mmsetred())->registerListener(this, "MiniMap.setred"); (new mmsetgreen())->registerListener(this, "MiniMap.setgreen"); (new mmsetblue())->registerListener(this, "MiniMap.setblue"); @@ -1120,6 +1121,15 @@ bool LLNetMap::LLEnableTracking::handleEvent(LLPointer event, const LLS return true; } + +bool LLNetMap::LLCamFollow::handleEvent(LLPointer event, const LLSD& userdata) +{ + LLNetMap *self = mPtr; + LLFloaterAvatarList::lookAtAvatar(self->mClosestAgentAtLastRightClick); + return true; +} + + bool LLNetMap::LLShowAgentProfile::handleEvent(LLPointer event, const LLSD& userdata) { LLNetMap *self = mPtr;