[OpenSimExtras] Variable chat ranges viewer awareness, thanks Diva Canto!!
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<bool> mSupportsExport;
|
||||
std::string mMapServerURL;
|
||||
SignaledType<std::string> mSearchURL;
|
||||
SignaledType<U32> mSayRange;
|
||||
SignaledType<U32> mShoutRange;
|
||||
SignaledType<U32> mWhisperRange;
|
||||
};
|
||||
|
||||
#endif //LFSIMFEATUREHANDLER_H
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<bool> chat_ring("MiniMapChatRing");
|
||||
static LLUICachedControl<bool> 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
|
||||
// <FS:CR> Aurora Sim
|
||||
|
||||
@@ -94,12 +94,6 @@ const F32 LLWorld::mScale = 1.f;
|
||||
F32 LLWorld::mWidthInMeters = mWidth * mScale;
|
||||
// </FS:CR> 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
|
||||
//
|
||||
|
||||
@@ -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;
|
||||
// </FS:CR> 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;
|
||||
|
||||
Reference in New Issue
Block a user