From b0b909d91fd4b398991cd8df3446fd92f76fc93d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 13 Mar 2014 10:24:20 +0100 Subject: [PATCH] FIRE-13095: Override nametag color with mark color set on minimap --- indra/newview/llnetmap.h | 1 + indra/newview/llvoavatar.cpp | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 89c1166dd6..b40a257095 100755 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -101,6 +101,7 @@ public: void performDoubleClickAction(LLVector3d pos_global); // Mark avatar feature + static bool hasAvatarMarkColor(const LLUUID& avatar_id) { return sAvatarMarksMap.find(avatar_id) != sAvatarMarksMap.end(); } static bool getAvatarMarkColor(const LLUUID& avatar_id, LLColor4& color); static void setAvatarMarkColor(const LLUUID& avatar_id, const LLSD& color); static void setAvatarMarkColors(const uuid_vec_t& avatar_ids, const LLSD& color); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 14ba8bc4c1..db9d04eaa4 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -108,10 +108,11 @@ #include "llsdserialize.h" #include "fsdata.h" -#include "llcontrol.h" -#include "lggcontactsets.h" -#include "llfilepicker.h" // FIRE-8893 - Dump archetype xml to user defined location #include "lfsimfeaturehandler.h" // Opensim +#include "lggcontactsets.h" +#include "llcontrol.h" +#include "llfilepicker.h" // FIRE-8893 - Dump archetype xml to user defined location +#include "llnetmap.h" #include "llviewernetwork.h" // [FS:CR] isInSecondlife() extern F32 SPEED_ADJUST_MAX; @@ -2891,8 +2892,10 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) // then use that color as name_tag_color static LLUICachedControl show_friends("NameTagShowFriends"); static LLUICachedControl color_client_tags("FSColorClienttags"); + bool special_color_override = (show_friends && (is_friend || LGGContactSets::getInstance()->hasFriendColorThatShouldShow(getID(), LGG_CS_TAG))) || + LLNetMap::hasAvatarMarkColor(getID()); if (mClientTagData.has("color") - && !(show_friends && (is_friend || LGGContactSets::getInstance()->hasFriendColorThatShouldShow(getID(), LGG_CS_TAG))) + && !special_color_override && color_client_tags && !this->isSelf()) { name_tag_color = mClientTagData["color"]; @@ -2937,8 +2940,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) // Override nametag color only if friend color is disabled // or avatar is not a friend nor has a contact set color - if (show_distance_color_tag - && !(show_friends && (is_friend || LGGContactSets::getInstance()->hasFriendColorThatShouldShow(getID(), LGG_CS_TAG)))) + if (show_distance_color_tag && !special_color_override) { name_tag_color = distance_color; } @@ -3394,6 +3396,8 @@ LLColor4 LLVOAvatar::getNameTagColor() color = LGGContactSets::getInstance()->getFriendColor(getID()); } + LLNetMap::getAvatarMarkColor(getID(), color); + return color; }