diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 7c5046fe2..9a11ca02b 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -37,8 +37,6 @@ extern F32 const gPrehashVersionNumber; extern char const* const _PREHASH_X; extern char const* const _PREHASH_Y; extern char const* const _PREHASH_Z; -extern char const* const _PREHASH_SizeX; -extern char const* const _PREHASH_SizeY; extern char const* const _PREHASH_AddFlags; extern char const* const _PREHASH_FailureInfo; extern char const* const _PREHASH_MapData; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a49e6aa74..1eba2c840 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10068,6 +10068,98 @@ This should be as low as possible, but too low may break functionality Value 1 + MiniMapChatRings + + Comment + Display chat distance rings on mini map + Persist + 1 + Type + Boolean + Value + 0 + + MiniMapWhisperRing + + Comment + Display whisper distance ring on mini map + Persist + 1 + Type + Boolean + Value + 0 + + MiniMapWhisperRingColor + + Comment + Color for whisper distance ring on mini map + Persist + 1 + Type + Color4 + Value + + 0.0 + 1.0 + 0.0 + 0.5 + + + MiniMapChatRing + + Comment + Display chat distance ring on mini map + Persist + 1 + Type + Boolean + Value + 0 + + MiniMapChatRingColor + + Comment + Color for chat distance ring on mini map + Persist + 1 + Type + Color4 + Value + + 1.0 + 1.0 + 0.0 + 0.5 + + + MiniMapShoutRing + + Comment + Display shout distance ring on mini map + Persist + 1 + Type + Boolean + Value + 0 + + MiniMapShoutRingColor + + Comment + Color for shout distance ring on mini map + Persist + 1 + Type + Color4 + Value + + 1.0 + 0.0 + 0.0 + 0.5 + + MiniMapScale Comment diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index a69c60aee..0166c951b 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -66,7 +66,6 @@ LLPrefsAscentVan::LLPrefsAscentVan() getChild("show_self_tag_color_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2)); getChild("customize_own_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2)); getChild("show_friend_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2)); - getChild("display_client_new_line_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2)); getChild("use_status_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2)); getChild("custom_tag_label_box")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitTextModified, this, _1, _2)); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 0ee2f246e..d13a81f37 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -89,6 +89,9 @@ const F32 DOT_SCALE = 0.75f; const F32 MIN_PICK_SCALE = 2.f; const S32 MOUSE_DRAG_SLOP = 2; // How far the mouse needs to move before we think it's a drag +const F32 WIDTH_PIXELS = 2.f; +const S32 CIRCLE_STEPS = 100; + LLNetMap::LLNetMap(const std::string& name) : LLPanel(name), mScale(128.f), @@ -114,6 +117,10 @@ LLNetMap::LLNetMap(const std::string& name) : (new LLCheckRotateMap())->registerListener(this, "MiniMap.CheckRotate"); (new LLShowObjects())->registerListener(this, "MiniMap.ShowObjects"); (new LLCheckShowObjects())->registerListener(this, "MiniMap.CheckShowObjects"); + (new LLChatRings())->registerListener(this, "MiniMap.ChatRings"); + (new LLWhisperRing())->registerListener(this, "MiniMap.WhisperRing"); + (new LLChatRing())->registerListener(this, "MiniMap.ChatRing"); + (new LLShoutRing())->registerListener(this, "MiniMap.ShoutRing"); (new LLStopTracking())->registerListener(this, "MiniMap.StopTracking"); (new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking"); (new LLShowAgentProfile())->registerListener(this, "MiniMap.ShowProfile"); @@ -196,6 +203,10 @@ void LLNetMap::draw() { static LLFrameTimer map_timer; + static const LLCachedControl map_whisper_ring_color("MiniMapWhisperRingColor", LLColor4(0.f,1.f,0.f,0.5f)); + static const LLCachedControl map_chat_ring_color("MiniMapChatRingColor", LLColor4(0.f,0.f,1.f,0.5f)); + static const LLCachedControl map_shout_ring_color("MiniMapShoutRingColor", LLColor4(1.f,0.f,0.f,0.5f)); + if (mObjectImagep.isNull()) { createObjectImage(); @@ -492,6 +503,18 @@ void LLNetMap::draw() dot_width, dot_width); + // Draw chat range ring(s) + //static LLUICachedControl chat_rings("MiniMapChatRings"); + static LLUICachedControl whisper_ring("MiniMapWhisperRing"); + static LLUICachedControl chat_ring("MiniMapChatRing"); + static LLUICachedControl shout_ring("MiniMapShoutRing"); + if(whisper_ring) + drawRing(LLWorld::getInstance()->getWhisperDistance(), pos_map, map_whisper_ring_color); + if(chat_ring) + drawRing(LLWorld::getInstance()->getSayDistance(), pos_map, map_chat_ring_color); + if(shout_ring) + drawRing(LLWorld::getInstance()->getShoutDistance(), pos_map, map_shout_ring_color); + // Draw frustum // Aurora Sim //F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters(); @@ -588,6 +611,22 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos, BOOL rotated) return pos_local; } +void LLNetMap::drawRing(const F32 radius, const LLVector3 pos_map, const LLColor4& color) + +{ +// Aurora Sim + F32 meters_to_pixels = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); + //F32 meters_to_pixels = mScale / REGION_WIDTH_METERS; +// Aurora Sim + F32 radius_pixels = radius * meters_to_pixels; + + glMatrixMode(GL_MODELVIEW); + gGL.pushMatrix(); + gGL.translatef((F32)pos_map.mV[VX], (F32)pos_map.mV[VY], 0.f); + gl_ring(radius_pixels, WIDTH_PIXELS, color, color, CIRCLE_STEPS, FALSE); + gGL.popMatrix(); +} + void LLNetMap::drawTracking(const LLVector3d& pos_global, BOOL rotated, const LLColor4& color, BOOL draw_arrow ) { @@ -1156,6 +1195,67 @@ bool LLNetMap::LLCheckShowObjects::handleEvent(LLPointer event, const L return true; } +bool LLNetMap::LLChatRings::handleEvent(LLPointer event, const LLSD& userdata) +{ + BOOL all_enabled = gSavedSettings.getBOOL("MiniMapChatRings"); + gSavedSettings.setBOOL("MiniMapChatRings", !all_enabled); + gSavedSettings.setBOOL("MiniMapWhisperRing", !all_enabled); + gSavedSettings.setBOOL("MiniMapChatRing", !all_enabled); + gSavedSettings.setBOOL("MiniMapShoutRing", !all_enabled); + return true; +} + +bool LLNetMap::LLWhisperRing::handleEvent(LLPointer event, const LLSD& userdata) +{ + BOOL all_enabled = gSavedSettings.getBOOL("MiniMapChatRings"); + BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing"); + BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing"); + BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing"); + + gSavedSettings.setBOOL("MiniMapWhisperRing", !whisper_enabled); + + if(all_enabled) + gSavedSettings.setBOOL("MiniMapChatRings", !all_enabled); + else if(!whisper_enabled && chat_enabled && shout_enabled) + gSavedSettings.setBOOL("MiniMapChatRings", TRUE); + + return true; +} + +bool LLNetMap::LLChatRing::handleEvent(LLPointer event, const LLSD& userdata) +{ + BOOL all_enabled = gSavedSettings.getBOOL("MiniMapChatRings"); + BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing"); + BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing"); + BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing"); + + gSavedSettings.setBOOL("MiniMapChatRing", !chat_enabled); + + if(all_enabled) + gSavedSettings.setBOOL("MiniMapChatRings", !all_enabled); + else if(whisper_enabled && !chat_enabled && shout_enabled) + gSavedSettings.setBOOL("MiniMapChatRings", TRUE); + + return true; +} + +bool LLNetMap::LLShoutRing::handleEvent(LLPointer event, const LLSD& userdata) +{ + BOOL all_enabled = gSavedSettings.getBOOL("MiniMapChatRings"); + BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing"); + BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing"); + BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing"); + + gSavedSettings.setBOOL("MiniMapShoutRing", !shout_enabled); + + if(all_enabled) + gSavedSettings.setBOOL("MiniMapChatRings", !all_enabled); + else if(whisper_enabled && chat_enabled && !shout_enabled) + gSavedSettings.setBOOL("MiniMapChatRings", TRUE); + + return true; +} + bool LLNetMap::LLStopTracking::handleEvent(LLPointer event, const LLSD& userdata) { LLTracker::stopTracking(false); diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index bd481b805..cac65a418 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -82,6 +82,8 @@ private: LLVector3 globalPosToView(const LLVector3d& global_pos, BOOL rotated); LLVector3d viewPosToGlobal(S32 x,S32 y, BOOL rotated); + void drawRing(const F32 radius, LLVector3 pos_map, const LLColor4& color); + void drawTracking( const LLVector3d& pos_global, BOOL rotated, const LLColor4& color, @@ -163,12 +165,36 @@ private: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; + class LLChatRings : public LLMemberListener + { + public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + }; + class LLShowObjects : public LLMemberListener { public: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; + class LLWhisperRing : public LLMemberListener + { + public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + }; + + class LLChatRing : public LLMemberListener + { + public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + }; + + class LLShoutRing : public LLMemberListener + { + public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + }; + class LLStopTracking : public LLMemberListener { public: diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 84ac30bf8..4a1f578a1 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -94,6 +94,12 @@ 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 291159540..3545f0636 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -125,6 +125,10 @@ 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(); @@ -198,6 +202,10 @@ 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; diff --git a/indra/newview/skins/default/xui/en-us/menu_mini_map.xml b/indra/newview/skins/default/xui/en-us/menu_mini_map.xml index cc93d134b..244f25317 100644 --- a/indra/newview/skins/default/xui/en-us/menu_mini_map.xml +++ b/indra/newview/skins/default/xui/en-us/menu_mini_map.xml @@ -29,6 +29,26 @@ + + + + + + + + + + + + + + + + + + + @@ -46,9 +66,7 @@ - + mouse_opaque="false" name="Mark" opaque="true" tear_off="false" width="125">