summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-03-10 15:41:30 -0800
committerJames Cook <james@lindenlab.com>2010-03-10 15:41:30 -0800
commit0ee6a6025cba2f63c5c33c20870f67afd62f6372 (patch)
treebf55bdb9fca8a73008a63823ab8a439364702ac7 /indra/newview
parent8527463c157021bdbda8c1eff18c659f3cd37037 (diff)
Name tag color and position hackery for demo
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llhudnametag.cpp21
-rw-r--r--indra/newview/llhudtext.cpp2
-rw-r--r--indra/newview/llvoavatar.cpp24
-rw-r--r--indra/newview/skins/default/colors.xml41
-rw-r--r--indra/newview/skins/default/textures/Rounded_Rect.pngbin0 -> 338 bytes
-rw-r--r--indra/newview/skins/default/textures/textures.xml1
6 files changed, 64 insertions, 25 deletions
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index ebc6472a81..e444fc88eb 100644
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -58,8 +58,9 @@
const F32 SPRING_STRENGTH = 0.7f;
const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f;
-const F32 HORIZONTAL_PADDING = 15.f;
+const F32 HORIZONTAL_PADDING = 16.f;
const F32 VERTICAL_PADDING = 12.f;
+const F32 LINE_PADDING = 1; // aka "leading"
const F32 BUFFER_SIZE = 2.f;
const F32 MIN_EDGE_OVERLAP = 3.f;
const F32 HUD_TEXT_MAX_WIDTH = 190.f;
@@ -279,14 +280,17 @@ void LLHUDNameTag::renderText(BOOL for_select)
mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f));
// *TODO: cache this image
- LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square");
+ LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Rect");
// *TODO: make this a per-text setting
- LLColor4 bg_color = LLUIColorTable::instance().getColor("BackgroundChatColor");
+ LLColor4 bg_color = LLUIColorTable::instance().getColor("NameTagBackground");
bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
- const S32 border_height = 16;
- const S32 border_width = 16;
+ // JAMESDEBUG - maybe a no-op
+ //const S32 border_height = 16;
+ //const S32 border_width = 16;
+ const S32 border_height = 8;
+ const S32 border_width = 8;
// *TODO move this into helper function
F32 border_scale = 1.f;
@@ -456,7 +460,7 @@ void LLHUDNameTag::renderText(BOOL for_select)
LLUI::popMatrix();
}
- F32 y_offset = (F32)mOffsetY;
+ F32 y_offset = (F32)mOffsetY - 2; // JAMESDEBUG
// Render label
{
@@ -505,6 +509,7 @@ void LLHUDNameTag::renderText(BOOL for_select)
{
const LLFontGL* fontp = segment_iter->mFont;
y_offset -= fontp->getLineHeight();
+ y_offset -= LINE_PADDING;
U8 style = segment_iter->mStyle;
LLFontGL::ShadowType shadow = LLFontGL::DROP_SHADOW;
@@ -517,6 +522,9 @@ void LLHUDNameTag::renderText(BOOL for_select)
else // ALIGN_LEFT
{
x_offset = -0.5f * mWidth + (HORIZONTAL_PADDING / 2.f);
+
+ // JAMESDEBUG HACK
+ x_offset += 1;
}
text_color = segment_iter->mColor;
@@ -794,6 +802,7 @@ void LLHUDNameTag::updateSize()
{
const LLFontGL* fontp = iter->mFont;
height += fontp->getLineHeight();
+ height += LINE_PADDING;
width = llmax(width, llmin(iter->getWidth(fontp), HUD_TEXT_MAX_WIDTH));
++iter;
}
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp
index 91d5fcf665..31522f6efb 100644
--- a/indra/newview/llhudtext.cpp
+++ b/indra/newview/llhudtext.cpp
@@ -173,7 +173,7 @@ void LLHUDText::renderText(BOOL for_select)
LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square");
// *TODO: make this a per-text setting
- LLColor4 bg_color = LLUIColorTable::instance().getColor("BackgroundChatColor");
+ LLColor4 bg_color = LLUIColorTable::instance().getColor("ObjectBubbleColor");
bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
const S32 border_height = 16;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 582fc811a0..4c8bb0ac13 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2834,16 +2834,20 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
}
// trim last ", "
line.resize( line.length() - 2 );
- addNameTagLine(line, name_tag_color, LLFontGL::NORMAL,
+ LLColor4 status_color =
+ LLUIColorTable::getInstance()->getColor("NameTagStatus");
+ addNameTagLine(line, status_color, LLFontGL::NORMAL,
LLFontGL::getFontSansSerifSmall());
}
if (sRenderGroupTitles
&& title && title->getString() && title->getString()[0] != '\0')
{
+ LLColor4 group_color =
+ LLUIColorTable::getInstance()->getColor("NameTagGroup");
std::string title_str = title->getString();
LLStringFn::replace_ascii_controlchars(title_str,LL_UNKNOWN_CHAR);
- addNameTagLine(title_str, name_tag_color, LLFontGL::NORMAL,
+ addNameTagLine(title_str, group_color, LLFontGL::NORMAL,
LLFontGL::getFontSansSerifSmall());
}
@@ -2864,13 +2868,15 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
// Might be blank if name not available yet, that's OK
if (show_slids)
{
- addNameTagLine(av_name.mSLID, name_tag_color, LLFontGL::NORMAL,
- LLFontGL::getFontSansSerif());
+ // JAMESDEBUG HACK
+ LLColor4 slid_color = name_tag_color * 0.8f;
+ addNameTagLine(av_name.mSLID, slid_color, LLFontGL::NORMAL,
+ LLFontGL::getFontSansSerifSmall());
}
if (show_display_names)
{
addNameTagLine(av_name.mDisplayName, name_tag_color, LLFontGL::NORMAL,
- LLFontGL::getFontSansSerifBig());
+ LLFontGL::getFontSansSerif());
}
}
else
@@ -2904,7 +2910,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
std::deque<LLChat>::iterator chat_iter = mChats.begin();
mNameText->clearString();
- LLColor4 new_chat = LLUIColorTable::instance().getColor( "AvatarNameColor" );
+ LLColor4 new_chat = LLUIColorTable::instance().getColor( "NameTagChat" );
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)
@@ -3036,10 +3042,10 @@ void LLVOAvatar::idleUpdateNameTagAlpha(BOOL new_name, F32 alpha)
LLColor4 LLVOAvatar::getNameTagColor(bool is_friend)
{
- const char* color_name = "AvatarNameColor";
+ const char* color_name = "NameTagText";
if (is_friend)
{
- color_name = "AvatarNameFriendColor";
+ color_name = "NameTagFriend";
}
else
{
@@ -3049,7 +3055,7 @@ LLColor4 LLVOAvatar::getNameTagColor(bool is_friend)
&& LLAvatarNameCache::get(getID(), &av_name)
&& av_name.mIsLegacy)
{
- color_name = "AvatarNameLegacyColor";
+ color_name = "NameTagLegacy";
}
}
return LLUIColorTable::getInstance()->getColor( color_name );
diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index 4580efe688..c259e0391d 100644
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -115,15 +115,6 @@
name="AlertTextColor"
value="0.58 0.66 0.84 1" />
<color
- name="AvatarNameColor"
- reference="White" />
- <color
- name="AvatarNameFriendColor"
- reference="Green" />
- <color
- name="AvatarNameLegacyColor"
- reference="Yellow" />
- <color
name="AvatarListItemIconDefaultColor"
reference="White" />
<color
@@ -528,6 +519,35 @@
<color
name="MultiSliderTriangleColor"
reference="Unused?" />
+ <!--
+ <color
+ name="NameTagBackground"
+ value="0.85 0.85 0.85 0.80" />
+ -->
+ <color
+ name="NameTagBackground"
+ value="0 0 0 1" />
+ <color
+ name="NameTagChat"
+ reference="White" />
+ <color
+ name="NameTagText"
+ reference="White" />
+ <color
+ name="NameTagFriend"
+ reference="EmphasisColor" />
+ <color
+ name="NameTagGroup"
+ value="1 1 1 1" />
+ <color
+ name="NameTagLegacy"
+ value="0.984 0.758 0 1" />
+ <color
+ name="NameTagSLID"
+ value="1 1 1 1" />
+ <color
+ name="NameTagStatus"
+ value="1 1 1 1" />
<color
name="NetMapBackgroundColor"
value="0 0 0 0.3" />
@@ -562,6 +582,9 @@
name="NotifyTextColor"
reference="White" />
<color
+ name="ObjectBubbleColor"
+ reference="DkGray_66" />
+ <color
name="ObjectChatColor"
reference="EmphasisColor" />
<color
diff --git a/indra/newview/skins/default/textures/Rounded_Rect.png b/indra/newview/skins/default/textures/Rounded_Rect.png
new file mode 100644
index 0000000000..c270c28039
--- /dev/null
+++ b/indra/newview/skins/default/textures/Rounded_Rect.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 3b08408661..82bce8c069 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -458,6 +458,7 @@ with the same filename but different name
<texture name="Resize_Corner" file_name="windows/Resize_Corner.png" preload="true" />
+ <texture name="Rounded_Rect" file_name="Rounded_Rect.png" preload="true" scale.left="6" scale.top="24" scale.right="58" scale.bottom="6" />
<texture name="Rounded_Square" file_name="rounded_square.j2c" preload="true" scale.left="16" scale.top="16" scale.right="112" scale.bottom="16" />
<texture name="Row_Selection" file_name="navbar/Row_Selection.png" preload="false" />