FIRE-10827: Be a little more lenient on coloring when rlv showname restricted

meow-7.2.2
Cinders 2013-08-16 12:23:31 -06:00
parent 42d5e7c8f5
commit 9cf44eacc4
3 changed files with 52 additions and 37 deletions

View File

@ -342,17 +342,15 @@ LLColor4 LGGContactSets::colorize(const LLUUID& uuid, const LLColor4& cur_color,
{
static LLCachedControl<bool> legacy_radar_friend(gSavedSettings, "FSLegacyRadarFriendColoring");
static LLCachedControl<bool> legacy_radar_linden(gSavedSettings, "FSLegacyRadarLindenColoring");
bool rlv_shownames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
LLColor4 color = cur_color;
// Leave generic colors if RLV restricted
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
return color;
else if (uuid == gAgent.getID())
if (uuid == gAgent.getID())
{
switch (type)
{
case LGG_CS_CHAT:
case LGG_CS_IM:
color = LLUIColorTable::instance().getColor("UserChatColor", LLColor4::white);
break;
case LGG_CS_TAG:
@ -367,12 +365,51 @@ LLColor4 LGGContactSets::colorize(const LLUUID& uuid, const LLColor4& cur_color,
break;
}
}
else if (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL)
{
switch (type)
{
case LGG_CS_CHAT:
if (!rlv_shownames)
color = LLUIColorTable::instance().getColor("FriendsChatColor", LLColor4::white);
break;
case LGG_CS_IM:
color = LLUIColorTable::instance().getColor("FriendsChatColor", LLColor4::white);
break;
case LGG_CS_TAG:
{
// This is optional per prefs.
static LLUICachedControl<bool> color_friends("NameTagShowFriends");
if (color_friends && !rlv_shownames)
{
color = LLUIColorTable::instance().getColor("NameTagFriend", LLColor4::white);
}
}
break;
case LGG_CS_MINIMAP:
if (!rlv_shownames)
color = LLUIColorTable::instance().getColor("MapAvatarFriendColor", LLColor4::white);
break;
case LGG_CS_RADAR:
if (legacy_radar_friend && !rlv_shownames)
color = LLUIColorTable::instance().getColor("MapAvatarFriendColor", LLColor4::white);
break;
default:
llwarns << "Unhandled colorize case!" << llendl;
break;
}
}
else if (rlv_shownames)
{
// Don't bother with the rest if we're rlv_shownames restricted.
}
else if (LLMuteList::getInstance()->isMuted(uuid))
{
switch (type)
{
case LGG_CS_CHAT:
color = LLUIColorTable::instance().getColor("MutedChatColor", LLColor4::grey3);
case LGG_CS_IM:
color = LLUIColorTable::instance().getColor("MutedChatColor", LLColor4::grey3);
break;
case LGG_CS_TAG:
color = LLUIColorTable::instance().getColor("NameTagMuted", LLColor4::grey3);
@ -386,40 +423,12 @@ LLColor4 LGGContactSets::colorize(const LLUUID& uuid, const LLColor4& cur_color,
break;
}
}
else if (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL)
{
switch (type)
{
case LGG_CS_CHAT:
color = LLUIColorTable::instance().getColor("FriendsChatColor", LLColor4::white);
break;
case LGG_CS_TAG:
{
// This is optional per prefs.
static LLUICachedControl<bool> color_friends("NameTagShowFriends");
if (color_friends)
{
color = LLUIColorTable::instance().getColor("NameTagFriend", LLColor4::white);
}
}
break;
case LGG_CS_MINIMAP:
color = LLUIColorTable::instance().getColor("MapAvatarFriendColor", LLColor4::white);
break;
case LGG_CS_RADAR:
if (legacy_radar_friend)
color = LLUIColorTable::instance().getColor("MapAvatarFriendColor", LLColor4::white);
break;
default:
llwarns << "Unhandled colorize case!" << llendl;
break;
}
}
else if (FSData::instance().isAgentFlag(uuid, FSData::CHAT_COLOR))
{
switch (type)
{
case LGG_CS_CHAT:
case LGG_CS_IM:
color = LLUIColorTable::instance().getColor("FirestormChatColor", LLColor4::red);
break;
case LGG_CS_TAG:
@ -442,6 +451,7 @@ LLColor4 LGGContactSets::colorize(const LLUUID& uuid, const LLColor4& cur_color,
switch (type)
{
case LGG_CS_CHAT:
case LGG_CS_IM:
color = LLUIColorTable::instance().getColor("LindenChatColor", LLColor4::blue);
break;
case LGG_CS_TAG:
@ -461,7 +471,7 @@ LLColor4 LGGContactSets::colorize(const LLUUID& uuid, const LLColor4& cur_color,
}
}
if (isNonFriend(uuid))
if (!rlv_shownames && isNonFriend(uuid))
{
color = toneDownColor(color, 0.8f);
}
@ -527,6 +537,7 @@ bool LGGContactSets::hasFriendColorThatShouldShow(const LLUUID& friend_id, ELGGC
switch (type)
{
case LGG_CS_CHAT:
case LGG_CS_IM:
if (!fsContactSetsColorizeChat)
return false;
break;

View File

@ -28,6 +28,7 @@
typedef enum e_lgg_cs
{
LGG_CS_CHAT,
LGG_CS_IM,
LGG_CS_TAG,
LGG_CS_RADAR,
LGG_CS_MINIMAP

View File

@ -77,7 +77,10 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color, bool is_l
//{
r_color = LLUIColorTable::instance().getColor("AgentChatColor");
//}
r_color = LGGContactSets::getInstance()->colorize(chat.mFromID, r_color, LGG_CS_CHAT);
if (chat.mChatType == CHAT_TYPE_IM || chat.mChatType == CHAT_TYPE_IM_GROUP)
r_color = LGGContactSets::getInstance()->colorize(chat.mFromID, r_color, LGG_CS_IM);
else
r_color = LGGContactSets::getInstance()->colorize(chat.mFromID, r_color, LGG_CS_CHAT);
// </FS:CR>
//color based on contact sets prefs