Standardize and centralize "zoom at avatar" functions in LLAvatarActions: General use of radar if avatar not in object list and account for SL interest list changes that avatar not necessarily must be within draw distance
parent
9769b36c17
commit
ebd1a9ad69
|
|
@ -901,19 +901,15 @@ void FSRadar::updateTracking()
|
|||
|
||||
void FSRadar::zoomAvatar(const LLUUID& avatar_id, const std::string& name)
|
||||
{
|
||||
FSRadarEntry* entry = getEntry(avatar_id);
|
||||
if (entry)
|
||||
if (LLAvatarActions::canZoomIn(avatar_id))
|
||||
{
|
||||
if (entry->mRange <= gSavedSettings.getF32("RenderFarClip"))
|
||||
{
|
||||
handle_zoom_to_object(avatar_id, entry->mGlobalPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["AVATARNAME"] = name.c_str();
|
||||
reportToNearbyChat(LLTrans::getString("camera_no_focus", args));
|
||||
}
|
||||
LLAvatarActions::zoomIn(avatar_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["AVATARNAME"] = name.c_str();
|
||||
reportToNearbyChat(LLTrans::getString("camera_no_focus", args));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,12 +81,14 @@
|
|||
#include "fsfloaterimcontainer.h"
|
||||
#include "fsfloaterprofile.h"
|
||||
#include "fslslbridge.h"
|
||||
#include "fsradar.h"
|
||||
#include "fswsassetblacklist.h"
|
||||
#include "llfloaterregioninfo.h"
|
||||
#include "llfloaterreporter.h"
|
||||
#include "llparcel.h"
|
||||
#include "lltrans.h"
|
||||
#include "llviewermenu.h"
|
||||
#include "llviewernetwork.h"
|
||||
#include "llviewerparcelmgr.h"
|
||||
#include "llviewerwindow.h" // For opening logs externally
|
||||
#include "llworld.h"
|
||||
|
|
@ -1436,12 +1438,47 @@ void LLAvatarActions::report(const LLUUID& idAgent)
|
|||
|
||||
bool LLAvatarActions::canZoomIn(const LLUUID& idAgent)
|
||||
{
|
||||
return gObjectList.findObject(idAgent);
|
||||
// <FS:Ansariel> Firestorm radar support
|
||||
//return gObjectList.findObject(idAgent);
|
||||
|
||||
LLViewerObject* object = gObjectList.findObject(idAgent);
|
||||
if (object)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Special case for SL since interest list changes
|
||||
FSRadarEntry* entry = FSRadar::getInstance()->getEntry(idAgent);
|
||||
#ifdef OPENSIM
|
||||
if (LLGridManager::getInstance()->isInOpenSim())
|
||||
{
|
||||
return (entry && entry->getRange() <= gSavedSettings.getF32("RenderFarClip"));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
return (entry != NULL);
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
void LLAvatarActions::zoomIn(const LLUUID& idAgent)
|
||||
{
|
||||
handle_zoom_to_object(idAgent);
|
||||
// <FS:Ansariel> Firestorm radar support
|
||||
//handle_zoom_to_object(idAgent);
|
||||
|
||||
FSRadarEntry* entry = FSRadar::getInstance()->getEntry(idAgent);
|
||||
if (entry)
|
||||
{
|
||||
handle_zoom_to_object(idAgent, entry->getGlobalPos());
|
||||
}
|
||||
else
|
||||
{
|
||||
handle_zoom_to_object(idAgent);
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
void LLAvatarActions::getScriptInfo(const LLUUID& idAgent)
|
||||
|
|
|
|||
Loading…
Reference in New Issue