From e7ab172b762bbbb87ca78889fdaecfda39a71233 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 19 Apr 2011 16:46:30 -0700 Subject: Added custom nametag coloring for Imprudence tags (local only) --- linden/indra/newview/app_settings/settings.xml | 18 +++++++++++++++++- linden/indra/newview/llprefsadvanced.cpp | 8 ++++++++ linden/indra/newview/llprefsadvanced.h | 2 ++ linden/indra/newview/llvoavatar.cpp | 5 +++-- .../default/xui/en-us/panel_preferences_advanced.xml | 13 +++++++++---- 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 79519fa..a4c9f98 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -1692,7 +1692,23 @@ - + + ImprudenceTagColor + + Comment + Color of Imprudence tags (displayed only locally) + Persist + 1 + Type + Color4 + Value + + 0.79 + 0.44 + 0.88 + 1 + + ShowClientColor Comment diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp index 89dc0b2..c3a9c0b 100644 --- a/linden/indra/newview/llprefsadvanced.cpp +++ b/linden/indra/newview/llprefsadvanced.cpp @@ -82,12 +82,16 @@ BOOL LLPrefsAdvanced::postBuild() { childSetValue("disable_log_screen_check", gSavedSettings.getBOOL("DisableLoginLogoutScreens")); childSetValue("disable_tp_screen_check", gSavedSettings.getBOOL("DisableTeleportScreens")); + static BOOL* sShowClientNameTag = rebind_llcontrol("ShowClientNameTag", &gSavedSettings, true); childSetValue("client_name_tag_check", (*sShowClientNameTag)); static BOOL* sShowClientColor = rebind_llcontrol("ShowClientColor", &gSavedSettings, true); childSetValue("client_name_color_check", (*sShowClientColor)); childSetValue("client_name_hover_check", gSavedSettings.getBOOL("ShowClientNameHoverTip")); childSetValue("client_name_tag_broadcast_check", gSavedSettings.getBOOL("ShowMyClientTagToOthers")); + getChild("client_tag_color")->set(gSavedSettings.getColor4("ImprudenceTagColor")); + mClientTagColor = gSavedSettings.getColor4("ImprudenceTagColor"); + childSetValue("http_texture_check", gSavedSettings.getBOOL("ImagePipelineUseHTTP")); childSetValue("speed_rez_check", gSavedSettings.getBOOL("SpeedRez")); childSetValue("speed_rez_interval_spinner", (F32)gSavedSettings.getU32("SpeedRezInterval")); @@ -127,6 +131,9 @@ void LLPrefsAdvanced::apply() 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.setColor4("ImprudenceTagColor", getChild("client_tag_color")->get()); + mClientTagColor = getChild("client_tag_color")->get(); + gSavedSettings.setBOOL("ImagePipelineUseHTTP", childGetValue("http_texture_check")); gSavedSettings.setBOOL("SpeedRez", childGetValue("speed_rez_check")); gSavedSettings.setU32("SpeedRezInterval", childGetValue("speed_rez_interval_spinner").asReal()); @@ -205,6 +212,7 @@ void LLPrefsAdvanced::apply() void LLPrefsAdvanced::cancel() { + gSavedSettings.setColor4("ImprudenceTagColor", mClientTagColor); } void LLPrefsAdvanced::refresh() diff --git a/linden/indra/newview/llprefsadvanced.h b/linden/indra/newview/llprefsadvanced.h index d76e602..22236ce 100644 --- a/linden/indra/newview/llprefsadvanced.h +++ b/linden/indra/newview/llprefsadvanced.h @@ -59,6 +59,8 @@ private: static void onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata); static void onAutoCorrectButton(void * data); + LLColor4 mClientTagColor; + protected: void initHelpBtn(const std::string& name, const std::string& xml_alert); static void onClickHelp(void* data); diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index c0ddac5..9c6d646 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -3243,7 +3243,8 @@ void LLVOAvatar::resolveClient(LLColor4& avatar_name_color, std::string& client, if(idx == LLUUID("cc7a030f-282f-c165-44d2-b5ee572e72bf")) { - avatar_name_color = LLColor4(0.79f,0.44f,0.88f);//Imprudence + // defaults to LLColor4(0.79f,0.44f,0.88f) + avatar_name_color = gSavedSettings.getColor4("ImprudenceTagColor"); //Imprudence client = "Imprudence"; }else if(idx == LLUUID("2a9a406c-f448-68f2-4e38-878f8c46c190") || @@ -3567,7 +3568,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) else { // Set your own name to the Imprudence color -- MC - client_color = LLColor4(0.79f,0.44f,0.88f); + client_color = gSavedSettings.getColor4("ImprudenceTagColor"); } static BOOL* sShowClientColor = rebind_llcontrol("ShowClientColor", &gSavedSettings, true); 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 b8f6e7d..ab9c834 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 @@ -24,16 +24,21 @@ name="client_name_tag_check" radio_style="false" width="160" /> - + +