diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index f77428ea7..855bca468 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -26,6 +26,9 @@ LFSimFeatureHandler::LFSimFeatureHandler() : mSupportsExport(false) +, mSayRange(20) +, mShoutRange(100) +, mWhisperRange(10) { if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Remove this line if we ever handle SecondLife sim features LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LFSimFeatureHandler::handleRegionChange, this)); @@ -65,12 +68,18 @@ void LFSimFeatureHandler::setSupportedFeatures() mSupportsExport = extras.has("ExportSupported") ? extras["ExportSupported"].asBoolean() : false; mMapServerURL = extras.has("map-server-url") ? extras["map-server-url"].asString() : ""; mSearchURL = extras.has("search-server-url") ? extras["search-server-url"].asString() : ""; + mSayRange = extras.has("say-range") ? extras["say-range"].asInteger() : 20; + mShoutRange = extras.has("shout-range") ? extras["shout-range"].asInteger() : 100; + mWhisperRange = extras.has("whisper-range") ? extras["whisper-range"].asInteger() : 10; } else // OpenSim specifics are unsupported reset all to default { mSupportsExport = false; mMapServerURL = ""; mSearchURL = ""; + mSayRange = 20; + mShoutRange = 100; + mWhisperRange = 10; } } } diff --git a/indra/newview/lfsimfeaturehandler.h b/indra/newview/lfsimfeaturehandler.h index 8a8c49640..6d52c6ac0 100644 --- a/indra/newview/lfsimfeaturehandler.h +++ b/indra/newview/lfsimfeaturehandler.h @@ -64,6 +64,9 @@ public: bool simSupportsExport() const { return mSupportsExport; } std::string mapServerURL() const { return mMapServerURL; } std::string searchURL() const { return mSearchURL; } + U32 sayRange() const { return mSayRange; } + U32 shoutRange() const { return mShoutRange; } + U32 whisperRange() const { return mWhisperRange; } ExportPolicy exportPolicy() const; private: @@ -71,6 +74,9 @@ private: SignaledType mSupportsExport; std::string mMapServerURL; SignaledType mSearchURL; + SignaledType mSayRange; + SignaledType mShoutRange; + SignaledType mWhisperRange; }; #endif //LFSIMFEATUREHANDLER_H diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 14ef9b2b6..4ce5e7c18 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -61,6 +61,7 @@ #include "llviewermenu.h" #include "hippogridmanager.h" +#include "lfsimfeaturehandler.h" // [RLVa:KB] #include "rlvhandler.h" @@ -617,7 +618,7 @@ void LLFloaterAvatarList::updateAvatarList() // Announce position F32 dist = (F32)(position - mypos).magVec(); - entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position), avatarp, dist < 20.0, dist < 96.0); + entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position), avatarp, dist < LFSimFeatureHandler::getInstance()->sayRange(), dist < LFSimFeatureHandler::getInstance()->shoutRange()); // Mark as typing if they are typing if (avatarp && avatarp->isTyping()) entry->setActivity(LLAvatarListEntry::ACTIVITY_TYPING); @@ -876,10 +877,10 @@ void LLFloaterAvatarList::refreshAvatarList() } else { - if (distance <= 96.0) + if (distance <= LFSimFeatureHandler::getInstance()->shoutRange()) { snprintf(temp, sizeof(temp), "%.1f", distance); - if (distance > 20.0f) + if (distance > LFSimFeatureHandler::getInstance()->sayRange()) { color = sRadarTextShoutRange; } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index e77ca7a0b..162d036af 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -40,6 +40,7 @@ #include "lllocalcliprect.h" #include "llrender.h" +#include "lfsimfeaturehandler.h" #include "llfloateravatarlist.h" #include "llagent.h" @@ -503,11 +504,11 @@ void LLNetMap::draw() static LLUICachedControl chat_ring("MiniMapChatRing"); static LLUICachedControl shout_ring("MiniMapShoutRing"); if(whisper_ring) - drawRing(LLWorld::getInstance()->getWhisperDistance(), pos_map, map_whisper_ring_color); + drawRing(LFSimFeatureHandler::getInstance()->whisperRange(), pos_map, map_whisper_ring_color); if(chat_ring) - drawRing(LLWorld::getInstance()->getSayDistance(), pos_map, map_chat_ring_color); + drawRing(LFSimFeatureHandler::getInstance()->sayRange(), pos_map, map_chat_ring_color); if(shout_ring) - drawRing(LLWorld::getInstance()->getShoutDistance(), pos_map, map_shout_ring_color); + drawRing(LFSimFeatureHandler::getInstance()->shoutRange(), pos_map, map_shout_ring_color); // Draw frustum // Aurora Sim diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 4a1f578a1..84ac30bf8 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -94,12 +94,6 @@ const F32 LLWorld::mScale = 1.f; F32 LLWorld::mWidthInMeters = mWidth * mScale; // Aurora Sim -//TODO: This will use chat ranges -// according to opensim settings -const F32 LLWorld::mWhisperDistance = 10; -const F32 LLWorld::mSayDistance = 20; -const F32 LLWorld::mShoutDistance = 100; - // // Functions // diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index 3545f0636..291159540 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -125,10 +125,6 @@ public: F32 getRegionMinHeight() const { return -mWidthInMeters; } F32 getRegionMaxHeight() const { return MAX_OBJECT_Z; } - F32 getWhisperDistance() const { return mWhisperDistance; } - F32 getSayDistance() const { return mSayDistance; } - F32 getShoutDistance() const { return mShoutDistance; } - void updateRegions(F32 max_update_time); void updateVisibilities(); void updateParticles(); @@ -202,10 +198,6 @@ private: static F32 mWidthInMeters; // Aurora Sim - static const F32 mWhisperDistance; - static const F32 mSayDistance; - static const F32 mShoutDistance; - F32 mLandFarClip; // Far clip distance for land. LLPatchVertexArray mLandPatch; S32 mLastPacketsIn;