diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 59af2b244..e14993dcf 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -29,6 +29,7 @@ #include "llcachename.h" // linden library includes +#include "llcontrol.h" // For LLCachedControl #include "lldbstrings.h" #include "llframetimer.h" #include "llhost.h" @@ -506,9 +507,10 @@ BOOL LLCacheName::getUUID(const std::string& full_name, LLUUID& id) //static std::string LLCacheName::buildFullName(const std::string& first, const std::string& last) { + static const LLCachedControl show_resident("LiruShowLastNameResident", false); std::string fullname = first; if (!last.empty() - && last != "Resident") + && (show_resident || last != "Resident")) { fullname += ' '; fullname += last; @@ -519,6 +521,8 @@ std::string LLCacheName::buildFullName(const std::string& first, const std::stri //static std::string LLCacheName::cleanFullName(const std::string& full_name) { + static const LLCachedControl show_resident("LiruShowLastNameResident", false); + if (show_resident) return full_name; return full_name.substr(0, full_name.find(" Resident")); } @@ -539,7 +543,8 @@ std::string LLCacheName::buildUsername(const std::string& full_name) username = full_name.substr(0, index); std::string lastname = full_name.substr(index+1); - if (lastname != "Resident") + static const LLCachedControl show_resident("LiruShowLastNameResident", false); + if (lastname != "Resident" || show_resident) { username = username + "." + lastname; } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 22e1ec682..4d0e2041a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -763,6 +763,17 @@ Found in Advanced->Rendering->Info Displays Value 1 + LiruShowLastNameResident + + Comment + Whether or not to bypass stripping out the last name Resident + Persist + 1 + Type + Boolean + Value + 0 + ContactsUseHorizontalButtons Comment diff --git a/indra/newview/llpanelgeneral.cpp b/indra/newview/llpanelgeneral.cpp index 559dba021..bd6f1be43 100644 --- a/indra/newview/llpanelgeneral.cpp +++ b/indra/newview/llpanelgeneral.cpp @@ -62,6 +62,8 @@ BOOL LLPanelGeneral::postBuild() LLComboBox* namesystem_combobox = getChild("namesystem_combobox"); namesystem_combobox->setCurrentByIndex(gSavedSettings.getS32("PhoenixNameSystem")); + getChild("show_resident_checkbox")->setValue(gSavedSettings.getBOOL("LiruShowLastNameResident")); + std::string login_location = gSavedSettings.getString("LoginLocation"); if(login_location != "last" && login_location != "home") login_location = "last"; @@ -141,8 +143,10 @@ void LLPanelGeneral::apply() gSavedSettings.setS32("RenderName", fade_out_combobox->getCurrentIndex()); LLComboBox* namesystem_combobox = getChild("namesystem_combobox"); - if(gSavedSettings.getS32("PhoenixNameSystem")!=namesystem_combobox->getCurrentIndex()){ + LLUICtrl* show_resident_checkbox = getChild("show_resident_checkbox"); + if(gSavedSettings.getS32("PhoenixNameSystem")!=namesystem_combobox->getCurrentIndex() || gSavedSettings.getBOOL("LiruShowLastNameResident")!=show_resident_checkbox->getValue().asBoolean()){ gSavedSettings.setS32("PhoenixNameSystem", namesystem_combobox->getCurrentIndex()); + gSavedSettings.setBOOL("LiruShowLastNameResident", show_resident_checkbox->getValue()); if(gAgent.getRegion()){ if(namesystem_combobox->getCurrentIndex()<=0 || namesystem_combobox->getCurrentIndex()>2) LLAvatarNameCache::setUseDisplayNames(false); else LLAvatarNameCache::setUseDisplayNames(true); diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml index 390b42561..f4d32272e 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml @@ -15,6 +15,7 @@ Display Names(w/Username) Display Names only + Group Titles: