diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llmessage/llavatarnamecache.cpp | 15 | ||||
-rw-r--r-- | indra/llmessage/llavatarnamecache.h | 4 | ||||
-rw-r--r-- | indra/llui/llurlentry.cpp | 6 | ||||
-rw-r--r-- | indra/llui/tests/llurlentry_stub.cpp | 5 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 35 | ||||
-rw-r--r-- | indra/newview/llinspectavatar.cpp | 3 | ||||
-rw-r--r-- | indra/newview/lltoolpie.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llviewerdisplay.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 60 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 9 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_general.xml | 85 |
12 files changed, 177 insertions, 56 deletions
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 0d6981a9d9..0941dff0fa 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -44,8 +44,7 @@ namespace LLAvatarNameCache { - // base URL for name lookup service - std::string sNameServiceURL; + bool sUseDisplayNames = false; // accumulated agent IDs for next query against service typedef std::set<LLUUID> ask_queue_t; @@ -300,3 +299,15 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) void LLAvatarNameCache::get(const LLUUID& agent_id, name_cache_callback_t callback) { } + +void LLAvatarNameCache::toggleDisplayNames() +{ + sUseDisplayNames = !sUseDisplayNames; + // flush our cache + sCache.clear(); +} + +bool LLAvatarNameCache::useDisplayNames() +{ + return sUseDisplayNames; +} diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index a0e6abf303..9f0472095d 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -55,6 +55,10 @@ namespace LLAvatarNameCache // If name information is in cache, callback will be called immediately. typedef void (*name_cache_callback_t)(const LLUUID& agent_id, const LLAvatarName& av_name); void get(const LLUUID& agent_id, name_cache_callback_t callback); + + // HACK: turn display names on and off + void toggleDisplayNames(); + bool useDisplayNames(); } #endif diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index ef48f6cd4f..74b9468c26 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -326,7 +326,8 @@ void LLUrlEntryAgent::onNameCache(const LLUUID& id, { // IDEVO demo code LLAvatarName av_name; - if (LLAvatarNameCache::get(id, &av_name)) + if (LLAvatarNameCache::useDisplayNames() + && LLAvatarNameCache::get(id, &av_name)) { std::string label = av_name.mDisplayName + " (" + av_name.mSLID + ")"; // use custom icon if available @@ -364,7 +365,8 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa else if (gCacheName->getFullName(agent_id, full_name)) { LLAvatarName av_name; - if (LLAvatarNameCache::get(agent_id, &av_name)) + if (LLAvatarNameCache::useDisplayNames() + && LLAvatarNameCache::get(agent_id, &av_name)) return av_name.mDisplayName + " (" + av_name.mSLID + ")"; else return full_name; diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index 1f8c4d2f22..280554b954 100644 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -34,6 +34,11 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) return false; } +bool LLAvatarNameCache::useDisplayNames() +{ + return false; +} + // // Stub implementation for LLCacheName // diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d0c2f3cb34..0df53559df 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7089,7 +7089,7 @@ <key>Value</key> <integer>0</integer> </map> - <key>RenderShowGroupTitleAll</key> + <key>NameTagShowGroupTitles</key> <map> <key>Comment</key> <string>Show group titles in name labels</string> @@ -7098,6 +7098,39 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> + <integer>0</integer> + </map> + <key>NameTagShowDisplayNames</key> + <map> + <key>Comment</key> + <string>Show display names in name labels</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>NameTagShowSLIDs</key> + <map> + <key>Comment</key> + <string>Show Second Life IDs in name labels</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>NameTagShowStatus</key> + <map> + <key>Comment</key> + <string>Show status (AFK, Busy) in name labels</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> <integer>1</integer> </map> <key>RenderInitError</key> diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 6dddc133c2..c4fd5a07c1 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -613,7 +613,8 @@ void LLInspectAvatar::onNameCache( // IDEVO JAMESDEBUG - need to always display a display name LLAvatarName av_name; - if (LLAvatarNameCache::get(mAvatarID, &av_name)) + if (LLAvatarNameCache::useDisplayNames() + && LLAvatarNameCache::get(mAvatarID, &av_name)) { getChild<LLUICtrl>("user_name")->setValue(av_name.mDisplayName); getChild<LLUICtrl>("user_slid")->setValue(av_name.mSLID); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 9480ca0fdf..1ddf6db0e2 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -873,7 +873,8 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l } } LLAvatarName av_name; - if (LLAvatarNameCache::get(hover_object->getID(), &av_name)) + if (LLAvatarNameCache::useDisplayNames() + && LLAvatarNameCache::get(hover_object->getID(), &av_name)) { final_name = av_name.mDisplayName + " (" + av_name.mSLID + ")"; } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index ba256d70e8..b0a143438b 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -324,7 +324,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLImageGL::updateStats(gFrameTimeSeconds); LLVOAvatar::sRenderName = gSavedSettings.getS32("AvatarNameTagMode"); - LLVOAvatar::sRenderGroupTitles = (gSavedSettings.getBOOL("RenderShowGroupTitleAll") && gSavedSettings.getS32("AvatarNameTagMode")); + LLVOAvatar::sRenderGroupTitles = (gSavedSettings.getBOOL("NameTagShowGroupTitles") && gSavedSettings.getS32("AvatarNameTagMode")); gPipeline.mBackfaceCull = TRUE; gFrameCount++; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 7fc7f2101a..974413141f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -34,6 +34,7 @@ #include "llviewermenu.h" // linden library includes +#include "llavatarnamecache.h" // IDEVO #include "llfloaterreg.h" #include "llcombobox.h" #include "llinventorypanel.h" @@ -7716,6 +7717,11 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedToggleConsole(), "Advanced.ToggleConsole"); view_listener_t::addMenu(new LLAdvancedCheckConsole(), "Advanced.CheckConsole"); view_listener_t::addMenu(new LLAdvancedDumpInfoToConsole(), "Advanced.DumpInfoToConsole"); + + // IDEVO + commit.add("IDEVO.ToggleDisplayNames", boost::bind(&LLAvatarNameCache::toggleDisplayNames)); + enable.add("IDEVO.CheckDisplayNames", boost::bind(&LLAvatarNameCache::useDisplayNames)); + // Advanced > HUD Info view_listener_t::addMenu(new LLAdvancedToggleHUDInfo(), "Advanced.ToggleHUDInfo"); view_listener_t::addMenu(new LLAdvancedCheckHUDInfo(), "Advanced.CheckHUDInfo"); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e4de75d173..04809caa6f 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2805,50 +2805,62 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += "\n"; } + static LLUICachedControl<bool> show_display_names("NameTagShowDisplayNames"); + static LLUICachedControl<bool> show_slids("NameTagShowSLIDs"); + LLAvatarName av_name; - if (LLAvatarNameCache::get(getID(), &av_name)) + if (LLAvatarNameCache::useDisplayNames() + && LLAvatarNameCache::get(getID(), &av_name)) { - line += av_name.mDisplayName; + if (show_display_names) + { + line += av_name.mDisplayName; + line += "\n"; + } + if (show_slids) + { + line += "("; + line += av_name.mSLID; + line += ")\n"; + } } else { - line += LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); + if (show_display_names || show_slids) + { + line += LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); + line += "\n"; + } } - BOOL need_comma = FALSE; - - if (is_away || is_muted || is_busy) + static LLUICachedControl<bool> show_status("NameTagShowStatus"); + if (show_status + && (is_away || is_muted || is_busy || is_appearance) ) { - line += " ("; + //line += "("; if (is_away) { line += LLTrans::getString("AvatarAway"); - need_comma = TRUE; + line += ", "; } if (is_busy) { - if (need_comma) - { - line += ", "; - } line += LLTrans::getString("AvatarBusy"); - need_comma = TRUE; + line += ", "; } if (is_muted) { - if (need_comma) - { - line += ", "; - } line += LLTrans::getString("AvatarMuted"); - need_comma = TRUE; + line += ", "; } - line += ")"; - } - if (is_appearance) - { - line += "\n"; - line += LLTrans::getString("AvatarEditingAppearance"); + if (is_appearance) + { + line += LLTrans::getString("AvatarEditingAppearance"); + line += ", "; + } + // trim last ", " + line.resize( line.length() - 2 ); + //line += ")"; } mNameAway = is_away; mNameBusy = is_busy; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 95ce6d6ff4..21c2ba51e3 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -9,6 +9,15 @@ layout="topleft" name="Me" tear_off="true"> + <menu_item_check + label="IDEVO Display Name Prototype" + name="display_name_prototype"> + <menu_item_check.on_check + function="IDEVO.CheckDisplayNames" /> + <menu_item_check.on_click + function="IDEVO.ToggleDisplayNames" /> + </menu_item_check> + <menu_item_separator /> <menu_item_call label="Preferences" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 099c789e4b..acc9321abd 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -195,60 +195,97 @@ </text> <radio_group control_name="AvatarNameTagMode" - height="20" + height="45" layout="topleft" left="50" name="Name_Tag_Preference"> <radio_item label="Off" - layout="topleft" name="radio" value="0" width="75" /> <radio_item label="On" - layout="topleft" - left_pad="12" + left_delta="0" name="radio2" + top_pad="5" value="1" width="75" /> <radio_item label="Show briefly" - layout="topleft" - left_pad="12" + left_delta="0" name="radio3" + top_pad="5" value="2" width="160" /> </radio_group> <check_box enabled_control="AvatarNameTagMode" - control_name="RenderNameShowSelf" - height="16" - label="Show my name" - layout="topleft" - left="50" - name="show_my_name_checkbox1" - width="300" /> - <check_box - enabled_control="AvatarNameTagMode" control_name="SmallAvatarNames" height="16" initial_value="true" label="Small name tags" layout="topleft" - left_delta="175" + left="70" name="small_avatar_names_checkbox" + top_pad="4" width="200" /> - <check_box + <check_box enabled_control="AvatarNameTagMode" - control_name="RenderShowGroupTitleAll" + control_name="RenderNameShowSelf" height="16" - label="Show group titles" + label="Show my name" layout="topleft" - left_delta="-175" - name="show_all_title_checkbox1" - top_pad="5" + left="70" + name="show_my_name_checkbox1" + top_pad="4" width="300" /> + <text + follows="left|top" + height="15" + layout="topleft" + left="250" + name="name_tags_textbox" + top="175" + width="200"> + Tags show: + </text> + <check_box + control_name="NameTagShowGroupTitles" + enabled_control="AvatarNameTagMode" + height="16" + label="Group titles" + left="265" + name="show_all_title_checkbox1" + tool_tip="Show group titles, like Officer or Member" + top_pad="5" /> + <check_box + control_name="NameTagShowDisplayNames" + enabled_control="AvatarNameTagMode" + height="16" + label="Display names" + left_delta="0" + name="show_display_names" + tool_tip="Show display names, like José Sanchez" + top_pad="5" /> + <check_box + control_name="NameTagShowSLIDs" + enabled_control="AvatarNameTagMode" + height="16" + label="Second Life IDs" + left_delta="0" + name="show_slids" + tool_tip="Show SL ID, like bobsmith123" + top_pad="5" /> + <check_box + control_name="NameTagShowStatus" + enabled_control="AvatarNameTagMode" + height="16" + label="Status" + left_delta="0" + name="show_status" + tool_tip="Show status, like AFK or Busy" + top_pad="5" /> <text type="string" length="1" @@ -257,7 +294,7 @@ layout="topleft" left="30" name="effects_color_textbox" - top_pad="15" + top="290" width="200"> My effects: </text> @@ -339,7 +376,7 @@ hover="false" commit_on_focus_lost = "true" follows="left|top" - height="60" + height="45" layout="topleft" left="50" name="busy_response" |