From 1d6d3fc5a9698dfd64d5fa778823d38d514ec3b1 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 12 Jan 2010 16:33:08 -0800 Subject: Suppress rendering of last name "Resident" to display only SLIDs. Reviewed with Huseby --- indra/newview/llvoavatar.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4235f97eab..7df24c9ade 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2792,8 +2792,12 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += firstname->getString(); } - line += " "; - line += lastname->getString(); + // Suppress last name "Resident" as this is used for new SLID names + if (strcmp(lastname->getString(), "Resident")) + { + line += " "; + line += lastname->getString(); + } BOOL need_comma = FALSE; if (is_away || is_muted || is_busy) -- cgit v1.2.3 From 42176145c9e81dd99b65f88152df50a7b3ccf834 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 8 Feb 2010 14:55:30 -0800 Subject: Converted names build from avatar object LLNameValue pairs to SLID Added temporary getDisplayName() to LLCacheName Moved temporary placeholder display names into LLCacheName Eliminated rarely used LLAgentUI::buildName in favor of buildFullName Standardized buildFullName capitalization --- indra/newview/llvoavatar.cpp | 48 ++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 19 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7df24c9ade..4f7b93b19d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -44,6 +44,7 @@ #include #include "llaudioengine.h" +#include "llcachename.h" #include "noise.h" #include "sound_ids.h" @@ -2773,31 +2774,42 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) || is_appearance != mNameAppearance) { std::string line; - if (!sRenderGroupTitles) - { - // If all group titles are turned off, stack first name - // on a line above last name - line += firstname->getString(); - line += "\n"; - } - else if (title && title->getString() && title->getString()[0] != '\0') + // IDEVO JAMESDEBUG + //if (!sRenderGroupTitles) + //{ + // // If all group titles are turned off, stack first name + // // on a line above last name + // line += firstname->getString(); + // line += "\n"; + //} + //else if (title && title->getString() && title->getString()[0] != '\0') + //{ + // line += title->getString(); + // LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); + // line += "\n"; + // line += firstname->getString(); + //} + //else + //{ + // line += firstname->getString(); + //} + if (title && title->getString() && title->getString()[0] != '\0') { line += title->getString(); LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); line += "\n"; - line += firstname->getString(); } - else + + std::string display_name; + if (gCacheName->getDisplayName(getID(), display_name)) { - line += firstname->getString(); + line += display_name; } - - // Suppress last name "Resident" as this is used for new SLID names - if (strcmp(lastname->getString(), "Resident")) + else { - line += " "; - line += lastname->getString(); + line += LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); } + BOOL need_comma = FALSE; if (is_away || is_muted || is_busy) @@ -7520,9 +7532,7 @@ std::string LLVOAvatar::getFullname() const LLNameValue* last = getNVPair("LastName"); if (first && last) { - name += first->getString(); - name += " "; - name += last->getString(); + name = LLCacheName::buildFullName( first->getString(), last->getString() ); } return name; -- cgit v1.2.3 From 644c5cadbf8a0ab3ea7c2137e8819220a010c93f Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 10 Feb 2010 12:04:03 -0800 Subject: Name tags of friends appear in green. Refactored LLVOAvatar idleUpdateNameTag into smaller functions Eliminated unused LLHUDText::setUsePixelSize --- indra/newview/llvoavatar.cpp | 575 +++++++++++++++++++++++-------------------- 1 file changed, 305 insertions(+), 270 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4f7b93b19d..124851144a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -53,6 +53,7 @@ #include "llanimationstates.h" #include "llavatarpropertiesprocessor.h" #include "llviewercontrol.h" +#include "llcallingcard.h" // IDEVO for LLAvatarTracker #include "lldrawpoolavatar.h" #include "lldriverparam.h" #include "lleditingmotion.h" @@ -651,11 +652,13 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mAppearanceAnimating(FALSE), mNameString(), mTitle(), - mNameAway(FALSE), - mNameBusy(FALSE), - mNameMute(FALSE), + mNameAway(false), + mNameBusy(false), + mNameMute(false), + mNameAppearance(false), + mNameFriend(false), + mNameAlpha(0.f), mRenderGroupTitles(sRenderGroupTitles), - mNameAppearance(FALSE), mFirstTEMessageReceived( FALSE ), mFirstAppearanceMessageReceived( FALSE ), mCulled( FALSE ), @@ -2660,303 +2663,335 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) && gSavedSettings.getS32("AvatarNameTagMode") )); } - if ( render_name ) + if ( !render_name ) { - BOOL new_name = FALSE; - if (visible_chat != mVisibleChat) + if (mNameText) { - mVisibleChat = visible_chat; - new_name = TRUE; + // ...clean up old name tag + mNameText->markDead(); + mNameText = NULL; + sNumVisibleChatBubbles--; } - - if (sRenderGroupTitles != mRenderGroupTitles) + return; + } + + BOOL new_name = FALSE; + if (visible_chat != mVisibleChat) + { + mVisibleChat = visible_chat; + new_name = TRUE; + } + + if (sRenderGroupTitles != mRenderGroupTitles) + { + mRenderGroupTitles = sRenderGroupTitles; + new_name = TRUE; + } + + // First Calculate Alpha + // If alpha > 0, create mNameText if necessary, otherwise delete it + F32 alpha = 0.f; + if (mAppAngle > 5.f) + { + const F32 START_FADE_TIME = NAME_SHOW_TIME - FADE_DURATION; + if (!visible_chat && sRenderName == RENDER_NAME_FADE && time_visible > START_FADE_TIME) { - mRenderGroupTitles = sRenderGroupTitles; - new_name = TRUE; + alpha = 1.f - (time_visible - START_FADE_TIME) / FADE_DURATION; } + else + { + // ...not fading, full alpha + alpha = 1.f; + } + } + else if (mAppAngle > 2.f) + { + // far away is faded out also + alpha = (mAppAngle-2.f)/3.f; + } - // First Calculate Alpha - // If alpha > 0, create mNameText if necessary, otherwise delete it + if (alpha <= 0.f) + { + if (mNameText) { - F32 alpha = 0.f; - if (mAppAngle > 5.f) + mNameText->markDead(); + mNameText = NULL; + sNumVisibleChatBubbles--; + } + return; + } + + if (!mNameText) + { + mNameText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); + mNameText->setMass(10.f); + mNameText->setSourceObject(this); + mNameText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); + mNameText->setVisibleOffScreen(TRUE); + mNameText->setMaxLines(11); + mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); + mNameText->setUseBubble(TRUE); + sNumVisibleChatBubbles++; + new_name = TRUE; + } + + idleUpdateNameTagColor(new_name, alpha); + + LLVector3 name_position = idleUpdateNameTagPosition(root_pos_last); + mNameText->setPositionAgent(name_position); + + LLNameValue *title = getNVPair("Title"); + LLNameValue* firstname = getNVPair("FirstName"); + LLNameValue* lastname = getNVPair("LastName"); + + // Avatars must have a first and last name + if (!firstname || !lastname) return; + + bool is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end(); + bool is_busy = mSignaledAnimations.find(ANIM_AGENT_BUSY) != mSignaledAnimations.end(); + bool is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end(); + bool is_muted; + if (isSelf()) + { + is_muted = false; + } + else + { + is_muted = LLMuteList::getInstance()->isMuted(getID()); + } + + // Rebuild name tag if state change detected + if (mNameString.empty() + || new_name + || (!title && !mTitle.empty()) + || (title && mTitle != title->getString()) + || is_away != mNameAway + || is_busy != mNameBusy + || is_muted != mNameMute + || is_appearance != mNameAppearance) + { + std::string line; + // IDEVO JAMESDEBUG + //if (!sRenderGroupTitles) + //{ + // // If all group titles are turned off, stack first name + // // on a line above last name + // line += firstname->getString(); + // line += "\n"; + //} + //else if (title && title->getString() && title->getString()[0] != '\0') + //{ + // line += title->getString(); + // LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); + // line += "\n"; + // line += firstname->getString(); + //} + //else + //{ + // line += firstname->getString(); + //} + if (sRenderGroupTitles + && title && title->getString() && title->getString()[0] != '\0') + { + line += title->getString(); + LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); + line += "\n"; + } + + std::string display_name; + if (gCacheName->getDisplayName(getID(), display_name)) + { + line += display_name; + } + else + { + line += LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); + } + + BOOL need_comma = FALSE; + + if (is_away || is_muted || is_busy) + { + line += " ("; + if (is_away) + { + line += LLTrans::getString("AvatarAway"); + need_comma = TRUE; + } + if (is_busy) { - const F32 START_FADE_TIME = NAME_SHOW_TIME - FADE_DURATION; - if (!visible_chat && sRenderName == RENDER_NAME_FADE && time_visible > START_FADE_TIME) + if (need_comma) { - alpha = 1.f - (time_visible - START_FADE_TIME) / FADE_DURATION; + line += ", "; } - else + line += LLTrans::getString("AvatarBusy"); + need_comma = TRUE; + } + if (is_muted) + { + if (need_comma) { - // ...not fading, full alpha - alpha = 1.f; + line += ", "; } + line += LLTrans::getString("AvatarMuted"); + need_comma = TRUE; } - else if (mAppAngle > 2.f) + line += ")"; + } + if (is_appearance) + { + line += "\n"; + line += LLTrans::getString("AvatarEditingAppearance"); + } + mNameAway = is_away; + mNameBusy = is_busy; + mNameMute = is_muted; + mNameAppearance = is_appearance; + mTitle = title ? title->getString() : ""; + LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR); + mNameString = utf8str_to_wstring(line); + new_name = TRUE; + } + + if (visible_chat) + { + mNameText->setDropShadow(TRUE); + mNameText->setFont(LLFontGL::getFontSansSerif()); + mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_LEFT); + mNameText->setFadeDistance(CHAT_NORMAL_RADIUS * 2.f, 5.f); + if (new_name) + { + mNameText->setLabel(mNameString); + } + + char line[MAX_STRING]; /* Flawfinder: ignore */ + line[0] = '\0'; + std::deque::iterator chat_iter = mChats.begin(); + mNameText->clearString(); + + LLColor4 new_chat = LLUIColorTable::instance().getColor( "AvatarNameColor" ); + LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f); + LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f); + if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES) + { + ++chat_iter; + } + + for(; chat_iter != mChats.end(); ++chat_iter) + { + F32 chat_fade_amt = llclamp((F32)((LLFrameTimer::getElapsedSeconds() - chat_iter->mTime) / CHAT_FADE_TIME), 0.f, 4.f); + LLFontGL::StyleFlags style; + switch(chat_iter->mChatType) { - // far away is faded out also - alpha = (mAppAngle-2.f)/3.f; + case CHAT_TYPE_WHISPER: + style = LLFontGL::ITALIC; + break; + case CHAT_TYPE_SHOUT: + style = LLFontGL::BOLD; + break; + default: + style = LLFontGL::NORMAL; + break; } - - if (alpha > 0.f) + if (chat_fade_amt < 1.f) { - if (!mNameText) - { - mNameText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); - mNameText->setMass(10.f); - mNameText->setSourceObject(this); - mNameText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); - mNameText->setVisibleOffScreen(TRUE); - mNameText->setMaxLines(11); - mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); - mNameText->setUseBubble(TRUE); - sNumVisibleChatBubbles++; - new_name = TRUE; - } - - LLColor4 avatar_name_color = LLUIColorTable::instance().getColor( "AvatarNameColor" ); - avatar_name_color.setAlpha(alpha); - mNameText->setColor(avatar_name_color); - - LLQuaternion root_rot = mRoot.getWorldRotation(); - mNameText->setUsePixelSize(TRUE); - LLVector3 pixel_right_vec; - LLVector3 pixel_up_vec; - LLViewerCamera::getInstance()->getPixelVectors(root_pos_last, pixel_up_vec, pixel_right_vec); - LLVector3 camera_to_av = root_pos_last - LLViewerCamera::getInstance()->getOrigin(); - camera_to_av.normalize(); - LLVector3 local_camera_at = camera_to_av * ~root_rot; - LLVector3 local_camera_up = camera_to_av % LLViewerCamera::getInstance()->getLeftAxis(); - local_camera_up.normalize(); - local_camera_up = local_camera_up * ~root_rot; - - local_camera_up.scaleVec(mBodySize * 0.5f); - local_camera_at.scaleVec(mBodySize * 0.5f); - - LLVector3 name_position = mRoot.getWorldPosition() + - (local_camera_up * root_rot) - - (projected_vec(local_camera_at * root_rot, camera_to_av)); - name_position += pixel_up_vec * 15.f; - mNameText->setPositionAgent(name_position); + F32 u = clamp_rescale(chat_fade_amt, 0.9f, 1.f, 0.f, 1.f); + mNameText->addLine(utf8str_to_wstring(chat_iter->mText), lerp(new_chat, normal_chat, u), style); } - else if (mNameText) + else if (chat_fade_amt < 2.f) { - mNameText->markDead(); - mNameText = NULL; - sNumVisibleChatBubbles--; + F32 u = clamp_rescale(chat_fade_amt, 1.9f, 2.f, 0.f, 1.f); + mNameText->addLine(utf8str_to_wstring(chat_iter->mText), lerp(normal_chat, old_chat, u), style); + } + else if (chat_fade_amt < 3.f) + { + // *NOTE: only remove lines down to minimum number + mNameText->addLine(utf8str_to_wstring(chat_iter->mText), old_chat, style); } } - - LLNameValue *title = getNVPair("Title"); - LLNameValue* firstname = getNVPair("FirstName"); - LLNameValue* lastname = getNVPair("LastName"); + mNameText->setVisibleOffScreen(TRUE); - if (mNameText.notNull() && firstname && lastname) + if (mTyping) { - BOOL is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end(); - BOOL is_busy = mSignaledAnimations.find(ANIM_AGENT_BUSY) != mSignaledAnimations.end(); - BOOL is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end(); - BOOL is_muted; - if (isSelf()) + S32 dot_count = (llfloor(mTypingTimer.getElapsedTimeF32() * 3.f) + 2) % 3 + 1; + switch(dot_count) { - is_muted = FALSE; + case 1: + mNameText->addLine(".", new_chat); + break; + case 2: + mNameText->addLine("..", new_chat); + break; + case 3: + mNameText->addLine("...", new_chat); + break; } - else - { - is_muted = LLMuteList::getInstance()->isMuted(getID()); - } - - if (mNameString.empty() || - new_name || - (!title && !mTitle.empty()) || - (title && mTitle != title->getString()) || - (is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute) - || is_appearance != mNameAppearance) - { - std::string line; - // IDEVO JAMESDEBUG - //if (!sRenderGroupTitles) - //{ - // // If all group titles are turned off, stack first name - // // on a line above last name - // line += firstname->getString(); - // line += "\n"; - //} - //else if (title && title->getString() && title->getString()[0] != '\0') - //{ - // line += title->getString(); - // LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); - // line += "\n"; - // line += firstname->getString(); - //} - //else - //{ - // line += firstname->getString(); - //} - if (title && title->getString() && title->getString()[0] != '\0') - { - line += title->getString(); - LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); - line += "\n"; - } - std::string display_name; - if (gCacheName->getDisplayName(getID(), display_name)) - { - line += display_name; - } - else - { - line += LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); - } + } + } + else + { + static LLUICachedControl small_avatar_names("SmallAvatarNames"); + if (small_avatar_names) + { + mNameText->setFont(LLFontGL::getFontSansSerif()); + } + else + { + mNameText->setFont(LLFontGL::getFontSansSerifBig()); + } + mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER); + mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); + mNameText->setVisibleOffScreen(FALSE); + if (new_name) + { + mNameText->setLabel(""); + mNameText->setString(mNameString); + } + } +} - BOOL need_comma = FALSE; +// Compute name tag position during idle update +LLVector3 LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last) +{ + LLQuaternion root_rot = mRoot.getWorldRotation(); + LLVector3 pixel_right_vec; + LLVector3 pixel_up_vec; + LLViewerCamera::getInstance()->getPixelVectors(root_pos_last, pixel_up_vec, pixel_right_vec); + LLVector3 camera_to_av = root_pos_last - LLViewerCamera::getInstance()->getOrigin(); + camera_to_av.normalize(); + LLVector3 local_camera_at = camera_to_av * ~root_rot; + LLVector3 local_camera_up = camera_to_av % LLViewerCamera::getInstance()->getLeftAxis(); + local_camera_up.normalize(); + local_camera_up = local_camera_up * ~root_rot; - if (is_away || is_muted || is_busy) - { - line += " ("; - if (is_away) - { - line += LLTrans::getString("AvatarAway"); - need_comma = TRUE; - } - if (is_busy) - { - if (need_comma) - { - line += ", "; - } - line += LLTrans::getString("AvatarBusy"); - need_comma = TRUE; - } - if (is_muted) - { - if (need_comma) - { - line += ", "; - } - line += LLTrans::getString("AvatarMuted"); - need_comma = TRUE; - } - line += ")"; - } - if (is_appearance) - { - line += "\n"; - line += LLTrans::getString("AvatarEditingAppearance"); - } - mNameAway = is_away; - mNameBusy = is_busy; - mNameMute = is_muted; - mNameAppearance = is_appearance; - mTitle = title ? title->getString() : ""; - LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR); - mNameString = utf8str_to_wstring(line); - new_name = TRUE; - } - - if (visible_chat) - { - mNameText->setDropShadow(TRUE); - mNameText->setFont(LLFontGL::getFontSansSerif()); - mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_LEFT); - mNameText->setFadeDistance(CHAT_NORMAL_RADIUS * 2.f, 5.f); - if (new_name) - { - mNameText->setLabel(mNameString); - } - - char line[MAX_STRING]; /* Flawfinder: ignore */ - line[0] = '\0'; - std::deque::iterator chat_iter = mChats.begin(); - mNameText->clearString(); - - LLColor4 new_chat = LLUIColorTable::instance().getColor( "AvatarNameColor" ); - LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f); - LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f); - if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES) - { - ++chat_iter; - } + local_camera_up.scaleVec(mBodySize * 0.5f); + local_camera_at.scaleVec(mBodySize * 0.5f); - for(; chat_iter != mChats.end(); ++chat_iter) - { - F32 chat_fade_amt = llclamp((F32)((LLFrameTimer::getElapsedSeconds() - chat_iter->mTime) / CHAT_FADE_TIME), 0.f, 4.f); - LLFontGL::StyleFlags style; - switch(chat_iter->mChatType) - { - case CHAT_TYPE_WHISPER: - style = LLFontGL::ITALIC; - break; - case CHAT_TYPE_SHOUT: - style = LLFontGL::BOLD; - break; - default: - style = LLFontGL::NORMAL; - break; - } - if (chat_fade_amt < 1.f) - { - F32 u = clamp_rescale(chat_fade_amt, 0.9f, 1.f, 0.f, 1.f); - mNameText->addLine(utf8str_to_wstring(chat_iter->mText), lerp(new_chat, normal_chat, u), style); - } - else if (chat_fade_amt < 2.f) - { - F32 u = clamp_rescale(chat_fade_amt, 1.9f, 2.f, 0.f, 1.f); - mNameText->addLine(utf8str_to_wstring(chat_iter->mText), lerp(normal_chat, old_chat, u), style); - } - else if (chat_fade_amt < 3.f) - { - // *NOTE: only remove lines down to minimum number - mNameText->addLine(utf8str_to_wstring(chat_iter->mText), old_chat, style); - } - } - mNameText->setVisibleOffScreen(TRUE); + LLVector3 name_position = mRoot.getWorldPosition() + + (local_camera_up * root_rot) - + (projected_vec(local_camera_at * root_rot, camera_to_av)); + name_position += pixel_up_vec * 15.f; + return name_position; +} - if (mTyping) - { - S32 dot_count = (llfloor(mTypingTimer.getElapsedTimeF32() * 3.f) + 2) % 3 + 1; - switch(dot_count) - { - case 1: - mNameText->addLine(".", new_chat); - break; - case 2: - mNameText->addLine("..", new_chat); - break; - case 3: - mNameText->addLine("...", new_chat); - break; - } +void LLVOAvatar::idleUpdateNameTagColor(BOOL new_name, F32 alpha) +{ + llassert(mNameText); - } - } - else - { - if (gSavedSettings.getBOOL("SmallAvatarNames")) - { - mNameText->setFont(LLFontGL::getFontSansSerif()); - } - else - { - mNameText->setFont(LLFontGL::getFontSansSerifBig()); - } - mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER); - mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); - mNameText->setVisibleOffScreen(FALSE); - if (new_name) - { - mNameText->setLabel(""); - mNameText->setString(mNameString); - } - } - } - } - else if (mNameText) + bool is_friend = LLAvatarTracker::instance().isBuddy(getID()); + if (new_name + || alpha != mNameAlpha + || is_friend != mNameFriend) { - mNameText->markDead(); - mNameText = NULL; - sNumVisibleChatBubbles--; + const char* color_name = (is_friend ? "AvatarNameFriendColor" : "AvatarNameColor"); + LLColor4 avatar_name_color = + LLUIColorTable::getInstance()->getColor( color_name ); + avatar_name_color.setAlpha(alpha); + mNameText->setColor(avatar_name_color); + + mNameFriend = is_friend; + mNameAlpha = alpha; } } -- cgit v1.2.3 From c2373fb5a6b08b2c32e5f93fa67b25f669e8b47f Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 11 Feb 2010 16:39:15 -0800 Subject: Created stub LLAvatarNameCache for display name lookup, as well as LLAvatarName base data object. Reviewed with Kelly. --- indra/newview/llvoavatar.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 265adb3e7f..e4de75d173 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -51,6 +51,7 @@ #include "llagent.h" // Get state values from here #include "llagentwearables.h" #include "llanimationstates.h" +#include "llavatarnamecache.h" #include "llavatarpropertiesprocessor.h" #include "llviewercontrol.h" #include "llcallingcard.h" // IDEVO for LLAvatarTracker @@ -2804,10 +2805,10 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += "\n"; } - std::string display_name; - if (gCacheName->getDisplayName(getID(), display_name)) + LLAvatarName av_name; + if (LLAvatarNameCache::get(getID(), &av_name)) { - line += display_name; + line += av_name.mDisplayName; } else { -- cgit v1.2.3 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 From af8f8b4770eb45b4238d98ddd574ba726470f797 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 19 Feb 2010 11:11:45 -0800 Subject: Improved support for toggling display names on/off Stop pre-populated name cache because we have a web service now for lookup Added mIsLegacy to LLAvatarName so we can colorize those name tags differently --- indra/newview/llvoavatar.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 04809caa6f..73f292cbca 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -660,6 +660,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mNameFriend(false), mNameAlpha(0.f), mRenderGroupTitles(sRenderGroupTitles), + mUseDisplayNames( LLAvatarNameCache::useDisplayNames() ), mFirstTEMessageReceived( FALSE ), mFirstAppearanceMessageReceived( FALSE ), mCulled( FALSE ), @@ -2695,6 +2696,13 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) new_name = TRUE; } + // IDEVO HACK to force refresh + if (LLAvatarNameCache::useDisplayNames() != mUseDisplayNames) + { + mUseDisplayNames = LLAvatarNameCache::useDisplayNames(); + new_name = TRUE; + } + // First Calculate Alpha // If alpha > 0, create mNameText if necessary, otherwise delete it F32 alpha = 0.f; -- cgit v1.2.3 From a5099524e2a89d0162053c7165468b72bcaa2571 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 19 Feb 2010 15:14:14 -0800 Subject: Avatars with legacy names have special color name tags --- indra/newview/llvoavatar.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 73f292cbca..69a4abcdae 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3000,10 +3000,10 @@ LLVector3 LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last) (projected_vec(local_camera_at * root_rot, camera_to_av)); name_position += pixel_up_vec * 15.f; return name_position; - } +} void LLVOAvatar::idleUpdateNameTagColor(BOOL new_name, F32 alpha) - { +{ llassert(mNameText); bool is_friend = LLAvatarTracker::instance().isBuddy(getID()); @@ -3011,7 +3011,22 @@ void LLVOAvatar::idleUpdateNameTagColor(BOOL new_name, F32 alpha) || alpha != mNameAlpha || is_friend != mNameFriend) { - const char* color_name = (is_friend ? "AvatarNameFriendColor" : "AvatarNameColor"); + const char* color_name = "AvatarNameColor"; + if (is_friend) + { + color_name = "AvatarNameFriendColor"; + } + else + { + // IDEVO can we avoid doing this lookup repeatedly? + LLAvatarName av_name; + if (LLAvatarNameCache::useDisplayNames() + && LLAvatarNameCache::get(getID(), &av_name) + && av_name.mIsLegacy) + { + color_name = "AvatarNameLegacyColor"; + } + } LLColor4 avatar_name_color = LLUIColorTable::getInstance()->getColor( color_name ); avatar_name_color.setAlpha(alpha); -- cgit v1.2.3 From 70f4e8ede81e1a1259345891c946dc447d686718 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 24 Feb 2010 11:03:52 -0800 Subject: Use async display name lookup for name tags, makes them refresh properly when toggling display name feature --- indra/newview/llvoavatar.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 69a4abcdae..2cd1d48aa0 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2755,6 +2755,11 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) LLVector3 name_position = idleUpdateNameTagPosition(root_pos_last); mNameText->setPositionAgent(name_position); + idleUpdateNameTagText(new_name); +} + +void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) +{ LLNameValue *title = getNVPair("Title"); LLNameValue* firstname = getNVPair("FirstName"); LLNameValue* lastname = getNVPair("LastName"); @@ -2816,10 +2821,18 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) static LLUICachedControl show_display_names("NameTagShowDisplayNames"); static LLUICachedControl show_slids("NameTagShowSLIDs"); - LLAvatarName av_name; - if (LLAvatarNameCache::useDisplayNames() - && LLAvatarNameCache::get(getID(), &av_name)) + if (LLAvatarNameCache::useDisplayNames()) { + LLAvatarName av_name; + if (!LLAvatarNameCache::get(getID(), &av_name)) + { + // ...call this function back when the name arrives + // and force a rebuild + LLAvatarNameCache::get(getID(), + boost::bind(&LLVOAvatar::idleUpdateNameTagText, this, TRUE)); + } + + // Might be blank if name not available yet, that's OK if (show_display_names) { line += av_name.mDisplayName; @@ -2880,7 +2893,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) new_name = TRUE; } - if (visible_chat) + if (mVisibleChat) { mNameText->setDropShadow(TRUE); mNameText->setFont(LLFontGL::getFontSansSerif()); -- cgit v1.2.3 From f3e0e9a5264a80d146a1d4d77fd9c4f5d3070278 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 24 Feb 2010 14:31:46 -0800 Subject: Hack to refresh name tags when I change my display name. Also fixes a crash when turning on display names. --- indra/newview/llvoavatar.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2cd1d48aa0..ac91ded18b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2829,7 +2829,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) // ...call this function back when the name arrives // and force a rebuild LLAvatarNameCache::get(getID(), - boost::bind(&LLVOAvatar::idleUpdateNameTagText, this, TRUE)); + boost::bind(&LLVOAvatar::invalidateName, this)); } // Might be blank if name not available yet, that's OK @@ -7629,6 +7629,13 @@ std::string LLVOAvatar::getFullname() const return name; } +// IDEVO +void LLVOAvatar::invalidateName() +{ + // force update by clearing name string + mNameString.clear(); +} + LLHost LLVOAvatar::getObjectHost() const { LLViewerRegion* region = getRegion(); -- cgit v1.2.3 From 3eec41f6716940ffcfd4bf239e1e493c2d0a0658 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 24 Feb 2010 17:21:12 -0800 Subject: Re-color name tags after display name changes --- indra/newview/llvoavatar.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ac91ded18b..7f57289fc3 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7634,6 +7634,8 @@ void LLVOAvatar::invalidateName() { // force update by clearing name string mNameString.clear(); + // and force color update by tweaking alpha + mNameAlpha = F32_MAX; } LLHost LLVOAvatar::getObjectHost() const -- cgit v1.2.3 From 36c35bca2663447216027015c10aa921ab75abfb Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 25 Feb 2010 17:06:17 -0800 Subject: Support multiple fonts, colors and styles in name tags Simplified LLHUDText string API to be UTF8 only Added per-text segment font support Changed LLVOAvatar invalidateNameTag to clearNameTag --- indra/newview/llvoavatar.cpp | 172 ++++++++++++++++++++++--------------------- 1 file changed, 88 insertions(+), 84 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7f57289fc3..8e017b2a51 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2749,13 +2749,13 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) sNumVisibleChatBubbles++; new_name = TRUE; } - - idleUpdateNameTagColor(new_name, alpha); - + LLVector3 name_position = idleUpdateNameTagPosition(root_pos_last); mNameText->setPositionAgent(name_position); idleUpdateNameTagText(new_name); + + idleUpdateNameTagAlpha(new_name, alpha); } void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) @@ -2779,6 +2779,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) { is_muted = LLMuteList::getInstance()->isMuted(getID()); } + bool is_friend = LLAvatarTracker::instance().isBuddy(getID()); // Rebuild name tag if state change detected if (mNameString.empty() @@ -2788,34 +2789,20 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) || is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute - || is_appearance != mNameAppearance) + || is_appearance != mNameAppearance + || is_friend != mNameFriend) { - std::string line; - // IDEVO JAMESDEBUG - //if (!sRenderGroupTitles) - //{ - // // If all group titles are turned off, stack first name - // // on a line above last name - // line += firstname->getString(); - // line += "\n"; - //} - //else if (title && title->getString() && title->getString()[0] != '\0') - //{ - // line += title->getString(); - // LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); - // line += "\n"; - // line += firstname->getString(); - //} - //else - //{ - // line += firstname->getString(); - //} + LLColor4 name_tag_color = getNameTagColor(is_friend); + + clearNameTag(); + if (sRenderGroupTitles && title && title->getString() && title->getString()[0] != '\0') { - line += title->getString(); - LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); - line += "\n"; + std::string title_str = title->getString(); + LLStringFn::replace_ascii_controlchars(title_str,LL_UNKNOWN_CHAR); + addNameTagLine(title_str, name_tag_color, LLFontGL::ITALIC, + LLFontGL::getFontSansSerifSmall()); } static LLUICachedControl show_display_names("NameTagShowDisplayNames"); @@ -2829,28 +2816,28 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) // ...call this function back when the name arrives // and force a rebuild LLAvatarNameCache::get(getID(), - boost::bind(&LLVOAvatar::invalidateName, this)); + boost::bind(&LLVOAvatar::clearNameTag, this)); } // Might be blank if name not available yet, that's OK if (show_display_names) { - line += av_name.mDisplayName; - line += "\n"; + addNameTagLine(av_name.mDisplayName, name_tag_color, LLFontGL::NORMAL, + LLFontGL::getFontSansSerifBig()); } if (show_slids) { - line += "("; - line += av_name.mSLID; - line += ")\n"; + addNameTagLine(av_name.mSLID, LLColor4::red, LLFontGL::NORMAL, + LLFontGL::getFontSansSerif()); } } else { if (show_display_names || show_slids) { - line += LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); - line += "\n"; + std::string full_name = + LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); + addNameTagLine(full_name, name_tag_color, LLFontGL::NORMAL, NULL); } } @@ -2858,7 +2845,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) if (show_status && (is_away || is_muted || is_busy || is_appearance) ) { - //line += "("; + std::string line; if (is_away) { line += LLTrans::getString("AvatarAway"); @@ -2881,15 +2868,17 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) } // trim last ", " line.resize( line.length() - 2 ); - //line += ")"; + addNameTagLine(line, LLColor4::blue, LLFontGL::NORMAL, + LLFontGL::getFontSansSerifSmall()); } mNameAway = is_away; mNameBusy = is_busy; mNameMute = is_muted; mNameAppearance = is_appearance; + mNameFriend = is_friend; mTitle = title ? title->getString() : ""; LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR); - mNameString = utf8str_to_wstring(line); +// mNameString = utf8str_to_wstring(line); new_name = TRUE; } @@ -2899,10 +2888,10 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) mNameText->setFont(LLFontGL::getFontSansSerif()); mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_LEFT); mNameText->setFadeDistance(CHAT_NORMAL_RADIUS * 2.f, 5.f); - if (new_name) - { - mNameText->setLabel(mNameString); - } +// if (new_name) +// { +// mNameText->setLabel(mNameString); +// } char line[MAX_STRING]; /* Flawfinder: ignore */ line[0] = '\0'; @@ -2936,17 +2925,17 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) if (chat_fade_amt < 1.f) { F32 u = clamp_rescale(chat_fade_amt, 0.9f, 1.f, 0.f, 1.f); - mNameText->addLine(utf8str_to_wstring(chat_iter->mText), lerp(new_chat, normal_chat, u), style); + mNameText->addLine(chat_iter->mText, lerp(new_chat, normal_chat, u), style); } else if (chat_fade_amt < 2.f) { F32 u = clamp_rescale(chat_fade_amt, 1.9f, 2.f, 0.f, 1.f); - mNameText->addLine(utf8str_to_wstring(chat_iter->mText), lerp(normal_chat, old_chat, u), style); + mNameText->addLine(chat_iter->mText, lerp(normal_chat, old_chat, u), style); } else if (chat_fade_amt < 3.f) { // *NOTE: only remove lines down to minimum number - mNameText->addLine(utf8str_to_wstring(chat_iter->mText), old_chat, style); + mNameText->addLine(chat_iter->mText, old_chat, style); } } mNameText->setVisibleOffScreen(TRUE); @@ -2971,6 +2960,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) } else { + // ...not using chat bubbles, just names static LLUICachedControl small_avatar_names("SmallAvatarNames"); if (small_avatar_names) { @@ -2983,11 +2973,36 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER); mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); mNameText->setVisibleOffScreen(FALSE); - if (new_name) - { - mNameText->setLabel(""); - mNameText->setString(mNameString); - } +// if (new_name) +// { +// mNameText->setLabel(""); +// mNameText->setString(mNameString); +// } + } +} + +void LLVOAvatar::addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font) +{ + llassert(mNameText); + if (mVisibleChat) + { + mNameText->addLabel(line); + } + else + { + mNameText->addLine(line, color, (LLFontGL::StyleFlags)style, font); + } + mNameString += line; + mNameString += '\n'; +} + +void LLVOAvatar::clearNameTag() +{ + mNameString.clear(); + if (mNameText) + { + mNameText->setLabel( "" ); + mNameText->setString( "" ); } } @@ -3015,39 +3030,37 @@ LLVector3 LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last) return name_position; } -void LLVOAvatar::idleUpdateNameTagColor(BOOL new_name, F32 alpha) +void LLVOAvatar::idleUpdateNameTagAlpha(BOOL new_name, F32 alpha) { llassert(mNameText); - bool is_friend = LLAvatarTracker::instance().isBuddy(getID()); if (new_name - || alpha != mNameAlpha - || is_friend != mNameFriend) + || alpha != mNameAlpha) { - const char* color_name = "AvatarNameColor"; - if (is_friend) - { - color_name = "AvatarNameFriendColor"; - } - else + mNameText->setAlpha(alpha); + mNameAlpha = alpha; + } +} + +LLColor4 LLVOAvatar::getNameTagColor(bool is_friend) +{ + const char* color_name = "AvatarNameColor"; + if (is_friend) + { + color_name = "AvatarNameFriendColor"; + } + else + { + // IDEVO can we avoid doing this lookup repeatedly? + LLAvatarName av_name; + if (LLAvatarNameCache::useDisplayNames() + && LLAvatarNameCache::get(getID(), &av_name) + && av_name.mIsLegacy) { - // IDEVO can we avoid doing this lookup repeatedly? - LLAvatarName av_name; - if (LLAvatarNameCache::useDisplayNames() - && LLAvatarNameCache::get(getID(), &av_name) - && av_name.mIsLegacy) - { - color_name = "AvatarNameLegacyColor"; - } + color_name = "AvatarNameLegacyColor"; } - LLColor4 avatar_name_color = - LLUIColorTable::getInstance()->getColor( color_name ); - avatar_name_color.setAlpha(alpha); - mNameText->setColor(avatar_name_color); - - mNameFriend = is_friend; - mNameAlpha = alpha; } + return LLUIColorTable::getInstance()->getColor( color_name ); } //-------------------------------------------------------------------- @@ -7629,15 +7642,6 @@ std::string LLVOAvatar::getFullname() const return name; } -// IDEVO -void LLVOAvatar::invalidateName() -{ - // force update by clearing name string - mNameString.clear(); - // and force color update by tweaking alpha - mNameAlpha = F32_MAX; -} - LLHost LLVOAvatar::getObjectHost() const { LLViewerRegion* region = getRegion(); -- cgit v1.2.3 From d2680b86170255e701d44e51ab9f5883a9fd61d8 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 26 Feb 2010 13:41:47 -0800 Subject: Less ugly name tag fonts and colors --- indra/newview/llvoavatar.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8e017b2a51..93662a030f 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2801,7 +2801,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) { std::string title_str = title->getString(); LLStringFn::replace_ascii_controlchars(title_str,LL_UNKNOWN_CHAR); - addNameTagLine(title_str, name_tag_color, LLFontGL::ITALIC, + addNameTagLine(title_str, name_tag_color, LLFontGL::NORMAL, LLFontGL::getFontSansSerifSmall()); } @@ -2827,7 +2827,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) } if (show_slids) { - addNameTagLine(av_name.mSLID, LLColor4::red, LLFontGL::NORMAL, + addNameTagLine(av_name.mSLID, name_tag_color, LLFontGL::NORMAL, LLFontGL::getFontSansSerif()); } } @@ -2835,9 +2835,13 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) { if (show_display_names || show_slids) { + + static LLUICachedControl small_avatar_names("SmallAvatarNames"); + const LLFontGL* font = + (small_avatar_names ? LLFontGL::getFontSansSerif() : LLFontGL::getFontSansSerifBig() ); std::string full_name = LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); - addNameTagLine(full_name, name_tag_color, LLFontGL::NORMAL, NULL); + addNameTagLine(full_name, name_tag_color, LLFontGL::NORMAL, font); } } @@ -2868,7 +2872,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) } // trim last ", " line.resize( line.length() - 2 ); - addNameTagLine(line, LLColor4::blue, LLFontGL::NORMAL, + addNameTagLine(line, name_tag_color, LLFontGL::NORMAL, LLFontGL::getFontSansSerifSmall()); } mNameAway = is_away; @@ -2961,15 +2965,6 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) else { // ...not using chat bubbles, just names - static LLUICachedControl small_avatar_names("SmallAvatarNames"); - if (small_avatar_names) - { - mNameText->setFont(LLFontGL::getFontSansSerif()); - } - else - { - mNameText->setFont(LLFontGL::getFontSansSerifBig()); - } mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER); mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); mNameText->setVisibleOffScreen(FALSE); -- cgit v1.2.3 From a235f3d5ea734db03a1a64901c893016f0320f18 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 26 Feb 2010 16:58:29 -0800 Subject: Clean out some dead code --- indra/newview/llvoavatar.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 93662a030f..9a9fbc22e2 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2882,7 +2882,6 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) mNameFriend = is_friend; mTitle = title ? title->getString() : ""; LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR); -// mNameString = utf8str_to_wstring(line); new_name = TRUE; } @@ -2892,10 +2891,6 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) mNameText->setFont(LLFontGL::getFontSansSerif()); mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_LEFT); mNameText->setFadeDistance(CHAT_NORMAL_RADIUS * 2.f, 5.f); -// if (new_name) -// { -// mNameText->setLabel(mNameString); -// } char line[MAX_STRING]; /* Flawfinder: ignore */ line[0] = '\0'; @@ -2968,11 +2963,6 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER); mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); mNameText->setVisibleOffScreen(FALSE); -// if (new_name) -// { -// mNameText->setLabel(""); -// mNameText->setString(mNameString); -// } } } -- cgit v1.2.3 From 541291b366c4813217be5cb9118cd74778d0daeb Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 26 Feb 2010 17:31:55 -0800 Subject: Removed unnecessary include llhudtext.h from llviewerobject.h --- indra/newview/llvoavatar.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9a9fbc22e2..317bc0da29 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -63,6 +63,7 @@ #include "llheadrotmotion.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" +#include "llhudtext.h" #include "llkeyframefallmotion.h" #include "llkeyframestandmotion.h" #include "llkeyframewalkmotion.h" -- cgit v1.2.3