From af36d6397520230718ae71a841078bc7b73867ce Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sat, 28 Sep 2013 11:34:57 -0400 Subject: [PATCH 1/3] Remove duplicate entries from message_prehash.h --- indra/llmessage/message_prehash.h | 2 -- 1 file changed, 2 deletions(-) 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; From aa4bee448d0ec56c3ac8192dcce4c12a05b6c29c Mon Sep 17 00:00:00 2001 From: Salvatore La Bua Date: Sun, 29 Sep 2013 00:01:11 +0200 Subject: [PATCH 2/3] Remove unnecessary CommitCallback --- indra/newview/ascentprefsvan.cpp | 1 - 1 file changed, 1 deletion(-) 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)); From af1480615f142128e383d6b6ee8f74420b1f6eb7 Mon Sep 17 00:00:00 2001 From: Salvatore La Bua Date: Sun, 29 Sep 2013 14:53:51 +0200 Subject: [PATCH 3/3] Add optional chat ranges rings on MiniMap Ability to show Whisper, Chat and Shout range circles on the MiniMap. Range values are at the moment hardcoded as [10, 20, 100]. Each ring is binded to the following Debug Settings: Whisper ring: MiniMapWhisperRing Chat Ring: MiniMapChatRing Shout Ring: MiniMapShoutRing Each ring colour can be customised through the following Debug Settings: Whisper ring: MiniMapWhisperRingColor Chat Ring: MiniMapChatRingColor Shout Ring: MiniMapShoutRingColor The following Debug Setting is used to enable/disable all the rings at once: MiniMapChatRings --- indra/newview/app_settings/settings.xml | 92 ++++++++++++++++ indra/newview/llnetmap.cpp | 100 ++++++++++++++++++ indra/newview/llnetmap.h | 26 +++++ indra/newview/llworld.cpp | 6 ++ indra/newview/llworld.h | 8 ++ .../skins/default/xui/en-us/menu_mini_map.xml | 24 ++++- 6 files changed, 253 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ce9ac3ae0..ca4ad99e4 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/llnetmap.cpp b/indra/newview/llnetmap.cpp index 8b0a17c62..96854b324 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), @@ -112,6 +115,10 @@ LLNetMap::LLNetMap(const std::string& name) : (new LLCheckCenterMap())->registerListener(this, "MiniMap.CheckCenter"); (new LLRotateMap())->registerListener(this, "MiniMap.Rotate"); (new LLCheckRotateMap())->registerListener(this, "MiniMap.CheckRotate"); + (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"); @@ -194,6 +201,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(); @@ -488,6 +499,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(); @@ -584,6 +607,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 ) { @@ -1137,6 +1176,67 @@ bool LLNetMap::LLCheckRotateMap::handleEvent(LLPointer event, const LLS 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 a709761d6..5e2ee09ec 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, @@ -157,6 +159,30 @@ private: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; + class LLChatRings : 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 c870268ce..4aec8ae4e 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 @@ -24,6 +24,26 @@ + + + + + + + + + + + + + + + + + + + @@ -41,9 +61,7 @@ - + mouse_opaque="false" name="Mark" opaque="true" tear_off="false" width="125">