FIRE-18207: Color avatar hitboxes in the same color as on minimap

meow-7.2.2
Ansariel 2016-04-23 22:41:58 +02:00
parent a1c79e93e8
commit ee865b9fad
3 changed files with 30 additions and 20 deletions

View File

@ -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
// </FS:Zi>
#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();

View File

@ -667,25 +667,7 @@ void LLNetMap::draw()
}
// </FS:Ansariel>
LLColor4 color = map_avatar_color; // <FS:CR>
// <FS:CR> Color "special" avatars with special colors (Friends, muted, Lindens, etc)
color = LGGContactSets::getInstance()->colorize(uuid, color, LGG_CS_MINIMAP);
// </FS:CR>
//color based on contact sets prefs
if(LGGContactSets::getInstance()->hasFriendColorThatShouldShow(uuid, LGG_CS_MINIMAP))
{
color = LGGContactSets::getInstance()->getFriendColor(uuid);
}
// <FS:Ansariel> Mark Avatars with special colors
avatar_marks_map_t::iterator found = sAvatarMarksMap.find(uuid);
if (found != sAvatarMarksMap.end())
{
color = found->second;
}
// </FS:Ansariel> Mark Avatars with special colors
LLColor4 color = getAvatarColor(uuid); // <FS:CR>
// [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;
}
//</FS:Ansariel>
void LLNetMap::handleCam()

View File

@ -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);
// </FS:Ansariel>
private: