From ee81adb01b8619302898471fdbba5c93f716d10b Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 18 Feb 2010 18:46:41 -0800 Subject: Preference to set what fields name tags display, and first attempt at "use display names" menu item which doesn't work yet --- indra/newview/llvoavatar.cpp | 60 ++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 24 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e4de75d173..04809caa6f 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2805,50 +2805,62 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += "\n"; } + static LLUICachedControl show_display_names("NameTagShowDisplayNames"); + static LLUICachedControl show_slids("NameTagShowSLIDs"); + LLAvatarName av_name; - if (LLAvatarNameCache::get(getID(), &av_name)) + if (LLAvatarNameCache::useDisplayNames() + && LLAvatarNameCache::get(getID(), &av_name)) { - line += av_name.mDisplayName; + if (show_display_names) + { + line += av_name.mDisplayName; + line += "\n"; + } + if (show_slids) + { + line += "("; + line += av_name.mSLID; + line += ")\n"; + } } else { - line += LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); + if (show_display_names || show_slids) + { + line += LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); + line += "\n"; + } } - BOOL need_comma = FALSE; - - if (is_away || is_muted || is_busy) + static LLUICachedControl show_status("NameTagShowStatus"); + if (show_status + && (is_away || is_muted || is_busy || is_appearance) ) { - line += " ("; + //line += "("; if (is_away) { line += LLTrans::getString("AvatarAway"); - need_comma = TRUE; + line += ", "; } if (is_busy) { - if (need_comma) - { - line += ", "; - } line += LLTrans::getString("AvatarBusy"); - need_comma = TRUE; + line += ", "; } if (is_muted) { - if (need_comma) - { - line += ", "; - } line += LLTrans::getString("AvatarMuted"); - need_comma = TRUE; + line += ", "; } - line += ")"; - } - if (is_appearance) - { - line += "\n"; - line += LLTrans::getString("AvatarEditingAppearance"); + if (is_appearance) + { + line += LLTrans::getString("AvatarEditingAppearance"); + line += ", "; + } + // trim last ", " + line.resize( line.length() - 2 ); + //line += ")"; } mNameAway = is_away; mNameBusy = is_busy; -- cgit v1.2.3