From 7c699c5091fc36ee79e2859686f3a15a8e8ecbae Mon Sep 17 00:00:00 2001
From: McCabe Maxsted
Date: Sun, 25 Apr 2010 20:59:01 -0700
Subject: Added checkbox for broadcasting client tag to Preferences > Advanced
(and fixed the show client in name tags checkbox)
---
linden/indra/newview/llprefsadvanced.cpp | 20 ++++++++++++++++++--
linden/indra/newview/llvoavatar.cpp | 5 ++++-
.../default/xui/en-us/panel_preferences_advanced.xml | 4 ++++
3 files changed, 26 insertions(+), 3 deletions(-)
(limited to 'linden/indra')
diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp
index 394c325..b30e55a 100644
--- a/linden/indra/newview/llprefsadvanced.cpp
+++ b/linden/indra/newview/llprefsadvanced.cpp
@@ -30,8 +30,10 @@
#include "llviewerprecompiledheaders.h"
+#include "llagent.h"
#include "llprefsadvanced.h"
#include "llviewercontrol.h"
+#include "llvoavatar.h"
#include "lluictrlfactory.h"
@@ -49,7 +51,8 @@ BOOL LLPrefsAdvanced::postBuild()
{
childSetValue("disable_log_screen_check", gSavedSettings.getBOOL("DisableLoginLogoutScreens"));
childSetValue("disable_tp_screen_check", gSavedSettings.getBOOL("DisableTeleportScreens"));
- childSetValue("client_name_tag_check", gSavedSettings.getBOOL("ClothingLayerProtection"));
+ childSetValue("client_name_tag_check", gSavedSettings.getBOOL("ShowClientNameTag"));
+ childSetValue("client_name_tag_broadcast_check", gSavedSettings.getBOOL("ClothingLayerProtection"));
childSetValue("http_texture_check", gSavedSettings.getBOOL("ImagePipelineUseHTTP"));
childSetValue("speedrez_check", gSavedSettings.getBOOL("SpeedRez"));
childSetValue("speedrez_spinner", (F32)gSavedSettings.getU32("SpeedRezInterval"));
@@ -61,11 +64,24 @@ void LLPrefsAdvanced::apply()
{
gSavedSettings.setBOOL("DisableLoginLogoutScreens", childGetValue("disable_log_screen_check"));
gSavedSettings.setBOOL("DisableTeleportScreens", childGetValue("disable_tp_screen_check"));
- gSavedSettings.setBOOL("ClothingLayerProtection", childGetValue("client_name_tag_check"));
+ gSavedSettings.setBOOL("ShowClientNameTag", childGetValue("client_name_tag_check"));
gSavedSettings.setBOOL("ImagePipelineUseHTTP", childGetValue("http_texture_check"));
gSavedSettings.setBOOL("SpeedRez", childGetValue("speedrez_check"));
gSavedSettings.setU32("SpeedRezInterval", childGetValue("speedrez_spinner").asReal());
+ // Need to force a rebake when ClothingLayerProtection toggled for it take effect -- MC
+ if (gSavedSettings.getBOOL("ClothingLayerProtection") != (BOOL)childGetValue("client_name_tag_broadcast_check"))
+ {
+ LLVOAvatar* avatar = gAgent.getAvatarObject();
+ if (avatar)
+ {
+ // Slam pending upload count to "unstick" things
+ bool slam_for_debug = true;
+ avatar->forceBakeAllTextures(slam_for_debug);
+ }
+ }
+ gSavedSettings.setBOOL("ClothingLayerProtection", childGetValue("client_name_tag_broadcast_check"));
+
// This is bad bad BAD UI from Emerald, I know.
// If anyone wants to do this better, please do -- MC
if ( childGetValue("shadows_check").asBoolean() )
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index 0f1e2a3..bf96ad1 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -3480,7 +3480,10 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
if(!mIsSelf) //don't know your own client ?
{
new_name = TRUE; //lol or see the last client used
- resolveClient(avatar_name_color,client, this);
+ if (gSavedSettings.getBOOL("ShowClientNameTag"))
+ {
+ resolveClient(avatar_name_color,client, this);
+ }
}
avatar_name_color.setAlpha(alpha);
mNameText->setColor(avatar_name_color);
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml
index 4eda819..3c3c002 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml
@@ -18,6 +18,10 @@
font="SansSerifSmall" height="16" initial_value="false"
label="Show Client Names in Name Tag" left="12" mouse_opaque="true"
name="client_name_tag_check" radio_style="false" width="217" />
+