From 000b378f59bcd8bbdb4b50e5e5b60376ba239976 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Fri, 30 Jul 2010 14:05:09 +0200 Subject: small show client name of others tweaking --- linden/indra/newview/app_settings/settings.xml | 25 ++++++++++++++++-- linden/indra/newview/llhoverview.cpp | 26 +++++++++++++++++++ linden/indra/newview/llprefsadvanced.cpp | 4 +++ linden/indra/newview/llvoavatar.cpp | 30 ++++++++++++++-------- linden/indra/newview/llvoavatar.h | 3 ++- .../xui/en-us/panel_preferences_advanced.xml | 20 ++++++++++++--- 6 files changed, 91 insertions(+), 17 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 1f5c7b2..dcbda36 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -1055,7 +1055,28 @@ - + ShowClientColor + + Comment + Show *others* clients specific color in the name tag + Persist + 1 + Type + Boolean + Value + 1 + + ShowClientNameHoverTip + + Comment + Show *others* client in the hovertip + Persist + 1 + Type + Boolean + Value + 1 + ShowClientNameTag Comment @@ -1067,7 +1088,7 @@ Value 1 - + ShowMyClientTagToOthers Comment diff --git a/linden/indra/newview/llhoverview.cpp b/linden/indra/newview/llhoverview.cpp index 5d59818..8c367ab 100644 --- a/linden/indra/newview/llhoverview.cpp +++ b/linden/indra/newview/llhoverview.cpp @@ -64,6 +64,7 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llviewerwindow.h" +#include "llvoavatar.h" #include "llglheaders.h" #include "llviewerimagelist.h" //#include "lltoolobjpicker.h" @@ -272,6 +273,31 @@ void LLHoverView::updateText() line.append(LLTrans::getString("TooltipPerson")); } mText.push_back(line); + + if (gSavedSettings.getBOOL("ShowClientNameHoverTip")) + { + LLColor4 color; + std::string client; + LLVOAvatar* avatar = (LLVOAvatar*)hit_object; + if (avatar->isSelf()) + { + client="Client: Imprudence"; + } + else + { + LLVOAvatar::resolveClient(color, client, avatar); + if(client.empty() ||client == "Invalid" || client == "Failure") + { + client = "Client: "; + } + else + { + client = "Client: " + client; + } + } + mText.push_back(client); + + } } else { diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp index 7830c29..34c8eb2 100644 --- a/linden/indra/newview/llprefsadvanced.cpp +++ b/linden/indra/newview/llprefsadvanced.cpp @@ -58,6 +58,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("ShowClientNameTag")); + childSetValue("client_name_color_check", gSavedSettings.getBOOL("ShowClientColor")); + childSetValue("client_name_hover_check", gSavedSettings.getBOOL("ShowClientNameHoverTip")); childSetValue("client_name_tag_broadcast_check", gSavedSettings.getBOOL("ShowMyClientTagToOthers")); childSetValue("http_texture_check", gSavedSettings.getBOOL("ImagePipelineUseHTTP")); childSetValue("speed_rez_check", gSavedSettings.getBOOL("SpeedRez")); @@ -81,6 +83,8 @@ void LLPrefsAdvanced::apply() gSavedSettings.setBOOL("DisableLoginLogoutScreens", childGetValue("disable_log_screen_check")); gSavedSettings.setBOOL("DisableTeleportScreens", childGetValue("disable_tp_screen_check")); gSavedSettings.setBOOL("ShowClientNameTag", childGetValue("client_name_tag_check")); + gSavedSettings.setBOOL("ShowClientColor", childGetValue("client_name_color_check")); + gSavedSettings.setBOOL("ShowClientNameHoverTip", childGetValue("client_name_hover_check")); gSavedSettings.setBOOL("ImagePipelineUseHTTP", childGetValue("http_texture_check")); gSavedSettings.setBOOL("SpeedRez", childGetValue("speed_rez_check")); gSavedSettings.setU32("SpeedRezInterval", childGetValue("speed_rez_interval_spinner").asReal()); diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 200b3a6..53962a9 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -3544,21 +3544,29 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } LLColor4 avatar_name_color = gColors.getColor( "AvatarNameColor" ); - if (gSavedSettings.getBOOL("ShowClientNameTag")) + LLColor4 client_color = avatar_name_color; + + if(!mIsSelf) //don't know your own client ? { - if(!mIsSelf) //don't know your own client ? + new_name = TRUE; //lol or see the last client used { - new_name = TRUE; //lol or see the last client used - { - resolveClient(avatar_name_color,client, this); - } - } - else - { - // Set your own name to the Imprudence color -- MC - avatar_name_color = LLColor4(0.79f,0.44f,0.88f); + resolveClient(client_color,client, this); } } + else + { + // Set your own name to the Imprudence color -- MC + client_color = LLColor4(0.79f,0.44f,0.88f); + } + if (gSavedSettings.getBOOL("ShowClientColor")) + { + avatar_name_color = client_color; + } + if (!gSavedSettings.getBOOL("ShowClientNameTag")) + { + client.clear(); + } + avatar_name_color.setAlpha(alpha); mNameText->setColor(avatar_name_color); diff --git a/linden/indra/newview/llvoavatar.h b/linden/indra/newview/llvoavatar.h index 36ed22a..0c32244 100644 --- a/linden/indra/newview/llvoavatar.h +++ b/linden/indra/newview/llvoavatar.h @@ -658,10 +658,11 @@ private: static LLVector3d sBeamLastAt; static LLSD sClientResolutionList; +public: //anything against having this public? static void resolveClient(LLColor4& avatar_name_color, std::string& client, LLVOAvatar* avatar); //Imprudence FIXME // friend class LLFloaterAvatarList; - +// friend class LLHoverView; protected: LLPointer mBeam; LLFrameTimer mBeamTimer; 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 de34ebd..7528809 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 @@ -14,10 +14,24 @@ font="SansSerifSmall" height="16" initial_value="false" label="Disable teleport screen" left="12" mouse_opaque="true" name="disable_tp_screen_check" radio_style="false" width="217" /> - + Show client names: + + + + + label="in tooltip" left_delta="140" mouse_opaque="true" + name="client_name_hover_check" radio_style="false" width="160" />