diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index 2c91b68ef..120bfa2c9 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -598,7 +598,7 @@ bool llsd_equals(const LLSD& lhs, const LLSD& rhs, unsigned bits) case LLSD::TypeReal: // This is where the 'bits' argument comes in handy. If passed // explicitly, it means to use is_approx_equal_fraction() to compare. - if (bits >= 0) + if (bits != -1) { return is_approx_equal_fraction(lhs.asReal(), rhs.asReal(), bits); } diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index 5a77d0f50..dd8d4e606 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -268,7 +268,7 @@ Value 1 - AscentUseTag + AscentBroadcastTag Comment Broadcast client tag diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index 2d9b32144..449745d5a 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -193,7 +193,7 @@ void LLPrefsAscentVan::refreshValues() mAnnounceStreamMetadata = gSavedSettings.getBOOL("AnnounceStreamMetadata"); //Tags\Colors ---------------------------------------------------------------------------- - mAscentUseTag = gSavedSettings.getBOOL("AscentUseTag"); + mAscentBroadcastTag = gSavedSettings.getBOOL("AscentBroadcastTag"); mReportClientUUID = gSavedSettings.getString("AscentReportClientUUID"); mSelectedClient = gSavedSettings.getU32("AscentReportClientIndex"); mShowSelfClientTag = gSavedSettings.getBOOL("AscentShowSelfTag"); @@ -276,7 +276,7 @@ void LLPrefsAscentVan::cancel() gSavedSettings.setBOOL("AnnounceStreamMetadata", mAnnounceStreamMetadata); //Tags\Colors ---------------------------------------------------------------------------- - gSavedSettings.setBOOL("AscentUseTag", mAscentUseTag); + gSavedSettings.setBOOL("AscentBroadcastTag", mAscentBroadcastTag); gSavedSettings.setString("AscentReportClientUUID", mReportClientUUID); gSavedSettings.setU32("AscentReportClientIndex", mSelectedClient); gSavedSettings.setBOOL("AscentShowSelfTag", mShowSelfClientTag); diff --git a/indra/newview/ascentprefsvan.h b/indra/newview/ascentprefsvan.h index 62600a264..4439205cc 100644 --- a/indra/newview/ascentprefsvan.h +++ b/indra/newview/ascentprefsvan.h @@ -63,7 +63,7 @@ protected: bool mAnnounceSnapshots; bool mAnnounceStreamMetadata; //Tags\Colors - BOOL mAscentUseTag; + BOOL mAscentBroadcastTag; std::string mReportClientUUID; U32 mSelectedClient; BOOL mShowSelfClientTag; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8108d2bd3..fee8c5253 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -567,10 +567,15 @@ SHClientTagMgr::SHClientTagMgr() gSavedSettings.getControl("AscentFriendColor")->getSignal()->connect(boost::bind(&LLVOAvatar::invalidateNameTags)); gSavedSettings.getControl("AscentMutedColor")->getSignal()->connect(boost::bind(&LLVOAvatar::invalidateNameTags)); + //Following group of settings all actually manipulate the tag cache for agent avatar. Even if the tag system is 'disabled', we still allow an + //entry to exist for the agent avatar. gSavedSettings.getControl("AscentUseCustomTag")->getSignal()->connect(boost::bind(&SHClientTagMgr::updateAgentAvatarTag, this)); gSavedSettings.getControl("AscentCustomTagColor")->getSignal()->connect(boost::bind(&SHClientTagMgr::updateAgentAvatarTag, this)); gSavedSettings.getControl("AscentCustomTagLabel")->getSignal()->connect(boost::bind(&SHClientTagMgr::updateAgentAvatarTag, this)); + //And because there can be an entry for the self avatar, always perform this as well. + gSavedSettings.getControl("AscentShowSelfTag")->getSignal()->connect(boost::bind(&LLVOAvatar::invalidateNameTags)); + if(!getIsEnabled()) return; @@ -578,12 +583,14 @@ SHClientTagMgr::SHClientTagMgr() fetchDefinitions(); parseDefinitions(); - //These only matter to the agent avatar. Don't iterate over everything. - gSavedSettings.getControl("AscentUseTag")->getSignal()->connect(boost::bind(&SHClientTagMgr::updateAgentAvatarTag, this)); + //Tags for other users only exist if the tag system is enabled. No point in registering this callback if non-agent avatars can't have tags. + gSavedSettings.getControl("AscentShowOthersTag")->getSignal()->connect(boost::bind(&LLVOAvatar::invalidateNameTags)); + + //Update the cached tag for the agent avatar. AscentReportClientUUID dictates what tag the agent avatar sees on their self. gSavedSettings.getControl("AscentReportClientUUID")->getSignal()->connect(boost::bind(&SHClientTagMgr::updateAgentAvatarTag, this)); - //Fire off a AgentSetAppearance update if these change. - gSavedSettings.getControl("AscentUseTag")->getSignal()->connect(boost::bind(&LLAgent::sendAgentSetAppearance, &gAgent)); + //Fire off a AgentSetAppearance update if these change. Essentially, forces the new clientid (or lack thereof) to be sent off to the server for others to see. + gSavedSettings.getControl("AscentBroadcastTag")->getSignal()->connect(boost::bind(&LLAgent::sendAgentSetAppearance, &gAgent)); gSavedSettings.getControl("AscentReportClientUUID")->getSignal()->connect(boost::bind(&LLAgent::sendAgentSetAppearance, &gAgent)); } @@ -682,7 +689,6 @@ const LLSD SHClientTagMgr::generateClientTag(const LLVOAvatar* pAvatar) const if (pAvatar->isSelf()) { - static const LLCachedControl ascent_use_tag("AscentUseTag",true); static const LLCachedControl ascent_use_custom_tag("AscentUseCustomTag", false); static const LLCachedControl ascent_custom_tag_color("AscentCustomTagColor", LLColor4(.5f,1.f,.25f,1.f)); static const LLCachedControl ascent_custom_tag_label("AscentCustomTagLabel","custom"); @@ -699,7 +705,7 @@ const LLSD SHClientTagMgr::generateClientTag(const LLVOAvatar* pAvatar) const { return LLSD(); } - else if (ascent_use_tag) + else { id.set(ascent_report_client_uuid,false); } @@ -796,24 +802,32 @@ void SHClientTagMgr::updateAvatarTag(LLVOAvatar* pAvatar) if(new_tag.isUndefined()) mAvatarTags.erase(id); else - mAvatarTags.insert(std::pair(id, new_tag)); + mAvatarTags[id]=new_tag; pAvatar->clearNameTag(); //LLVOAvatar::idleUpdateNameTag will pick up on mNameString being cleared. } } const std::string SHClientTagMgr::getClientName(const LLVOAvatar* pAvatar, bool is_friend) const { static LLCachedControl ascent_show_friends_tag("AscentShowFriendsTag", false); + static LLCachedControl ascent_show_self_tag("AscentShowSelfTag", false); + static LLCachedControl ascent_show_others_tag("AscentShowOthersTag", false); if(is_friend && ascent_show_friends_tag) return "Friend"; else { - LLSD tag; - std::map::const_iterator it = mAvatarTags.find(pAvatar->getID()); - if(it != mAvatarTags.end()) + if((!pAvatar->isSelf() && ascent_show_others_tag) || + (pAvatar->isSelf() && ascent_show_self_tag)) { - tag = it->second.get("name"); + LLSD tag; + std::map::const_iterator it = mAvatarTags.find(pAvatar->getID()); + if(it != mAvatarTags.end()) + { + tag = it->second.get("name"); + } + return tag.asString(); } - return tag.asString(); + else + return std::string(); } } const LLUUID SHClientTagMgr::getClientID(const LLVOAvatar* pAvatar) const @@ -3222,7 +3236,13 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) while ((index = line.find("%f")) != std::string::npos) line.replace(index, 2, firstnameText); while ((index = line.find("%l")) != std::string::npos) - line.replace(index, 2, lastnameText); + { + llinfos << "'" << line.substr(index) << "'" << llendl; + if(lastnameText.empty() && line[index+2] == ' ') //Entire displayname string crammed into firstname + line.replace(index, 3, ""); //so eat the extra space. + else + line.replace(index, 2, lastnameText); + } while ((index = line.find("%g")) != std::string::npos) line.replace(index, 2, groupText); while ((index = line.find("%t")) != std::string::npos) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 78daf033c..566f773b1 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2589,7 +2589,7 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const { LLTextureEntry* entry = getTE((U8) index); texture_id[index] = entry->getID(); - if (SHClientTagMgr::instance().getIsEnabled() && index == 0 && gSavedSettings.getBOOL("AscentUseTag")) + if (SHClientTagMgr::instance().getIsEnabled() && index == 0 && gSavedSettings.getBOOL("AscentBroadcastTag")) entry->setID(LLUUID(gSavedSettings.getString("AscentReportClientUUID"))); else entry->setID(IMG_DEFAULT_AVATAR); diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml index 0d730c4bb..3735092d5 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml @@ -14,11 +14,11 @@ - + Singularity - +