From ee865b9fadb64372b4e6c2a056ab0cbe1e5510af Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 23 Apr 2016 22:41:58 +0200 Subject: [PATCH] FIRE-18207: Color avatar hitboxes in the same color as on minimap --- indra/newview/lldrawpoolavatar.cpp | 4 ++- indra/newview/llnetmap.cpp | 45 +++++++++++++++++------------- indra/newview/llnetmap.h | 1 + 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 231b54eef0..680c38a1e1 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -56,6 +56,7 @@ // (See *NOTE: in renderAvatars why this forward declatation is commented out) // void drawBoxOutline(const LLVector3& pos,const LLVector3& size); // llspatialpartition.cpp // +#include "llnetmap.h" static U32 sDataMask = LLDrawPoolAvatar::VERTEX_DATA_MASK; static U32 sBufferUsage = GL_STREAM_DRAW_ARB; @@ -1267,7 +1268,8 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - gGL.diffuseColor4f(0.7f,1.0f,0.0f,0.3f); + LLColor4 avatar_color = LLNetMap::getAvatarColor(avatarp->getID()); + gGL.diffuseColor4f(avatar_color.mV[VRED], avatar_color.mV[VGREEN], avatar_color.mV[VBLUE], avatar_color.mV[VALPHA]); glLineWidth(2.0); LLQuaternion rot=avatarp->getRotationRegion(); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index f0ce3d3585..dfabf9a9b3 100755 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -667,25 +667,7 @@ void LLNetMap::draw() } // - LLColor4 color = map_avatar_color; // - - // Color "special" avatars with special colors (Friends, muted, Lindens, etc) - color = LGGContactSets::getInstance()->colorize(uuid, color, LGG_CS_MINIMAP); - // - - //color based on contact sets prefs - if(LGGContactSets::getInstance()->hasFriendColorThatShouldShow(uuid, LGG_CS_MINIMAP)) - { - color = LGGContactSets::getInstance()->getFriendColor(uuid); - } - - // Mark Avatars with special colors - avatar_marks_map_t::iterator found = sAvatarMarksMap.find(uuid); - if (found != sAvatarMarksMap.end()) - { - color = found->second; - } - // Mark Avatars with special colors + LLColor4 color = getAvatarColor(uuid); // // [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f | FS-Specific LLWorldMapView::drawAvatar( @@ -1835,6 +1817,31 @@ void LLNetMap::clearAvatarMarkColors() { sAvatarMarksMap.clear(); } + +// static +LLColor4 LLNetMap::getAvatarColor(const LLUUID& avatar_id) +{ + static LLUIColor map_avatar_color = LLUIColorTable::instance().getColor("MapAvatarColor", LLColor4::white); + LLColor4 color = map_avatar_color; + + // Color "special" avatars with special colors (Friends, muted, Lindens, etc) + color = LGGContactSets::getInstance()->colorize(avatar_id, color, LGG_CS_MINIMAP); + + // Color based on contact sets prefs + if(LGGContactSets::getInstance()->hasFriendColorThatShouldShow(avatar_id, LGG_CS_MINIMAP)) + { + color = LGGContactSets::getInstance()->getFriendColor(avatar_id); + } + + // Mark Avatars with special colors + avatar_marks_map_t::iterator found = sAvatarMarksMap.find(avatar_id); + if (found != sAvatarMarksMap.end()) + { + color = found->second; + } + + return color; +} // void LLNetMap::handleCam() diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 977f5407a0..a06a10b8e5 100755 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -108,6 +108,7 @@ public: static void clearAvatarMarkColor(const LLUUID& avatar_id); static void clearAvatarMarkColors(const uuid_vec_t& avatar_ids); static void clearAvatarMarkColors(); + static LLColor4 getAvatarColor(const LLUUID& avatar_id); // private: