From dc3e7219ac09dc5d071827eb30f39d9fec0f0f8b Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 4 Mar 2012 15:13:48 +0100 Subject: [PATCH] Added optional viewer tag colors based on distance (chat, shout, beyond shout range), configurable via Firestorm Tags prefs (FIRE-5324) --- indra/newview/app_settings/settings.xml | 11 ++ indra/newview/llvoavatar.cpp | 24 ++++ indra/newview/skins/default/colors.xml | 9 ++ .../xui/de/panel_preferences_firestorm.xml | 10 ++ .../xui/en/panel_preferences_firestorm.xml | 110 +++++++++++++++++- 5 files changed, 163 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 60288db0b9..66c254fd3c 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -17045,6 +17045,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSTagShowDistanceColors + + Comment + If enabled, color other avatars' nametags based on their distance + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index aec9444ad1..4dc9fb110b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3153,6 +3153,30 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) name_tag_color = mClientTagData["color"]; } + // Color name tags based on distance + static LLCachedControl show_distance_color_tag(gSavedSettings, "FSTagShowDistanceColors"); + static LLUIColor tag_chat_color = LLUIColorTable::instance().getColor("NameTagChatDistanceColor", LLColor4::green); + static LLUIColor tag_shout_color = LLUIColorTable::instance().getColor("NameTagShoutDistanceColor", LLColor4::yellow); + static LLUIColor tag_beyond_shout_color = LLUIColorTable::instance().getColor("NameTagBeyondShoutDistanceColor", LLColor4::red); + + if (show_distance_color_tag && !isSelf() && !(show_friends && (is_friend || LGGContactSets::getInstance()->hasFriendColorThatShouldShow(getID(),FALSE,TRUE)))) + { + F64 distance = dist_vec(getPositionGlobal(), gAgent.getPositionGlobal()); + if (distance < 20.f) + { + name_tag_color = tag_chat_color; + } + else if (distance < 100.f) + { + name_tag_color = tag_shout_color; + } + else + { + name_tag_color = tag_beyond_shout_color; + } + } + // + // Rebuild name tag if state change detected if (mNameString.empty() || new_name diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index e601e05fcc..62fdd04ccd 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -797,6 +797,15 @@ + + + diff --git a/indra/newview/skins/default/xui/de/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/de/panel_preferences_firestorm.xml index 9bf63fdca8..17a7a03ddf 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_firestorm.xml @@ -267,6 +267,16 @@ + + + Chat-Reichweite + + + Ruf-Reichweite + + + Außerhalb Ruf-Reichweite + diff --git a/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml index d9d8a4c683..613a6d2b9c 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml @@ -1585,9 +1585,117 @@ name="usernamecolorswatch" tool_tip="Click to open color picker"/> - + + + + + + + + Chat range + + + + + + + + Shout range + + + + + + + + Beyond Shout range + + +