From 39e0e4ad9e70c058703367284760aaae57c5e7d8 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 10 Nov 2014 13:36:23 -0500 Subject: [PATCH 1/4] LFSimFeatureHandler cleanup~ --- indra/newview/lfsimfeaturehandler.cpp | 30 --------------------------- indra/newview/lfsimfeaturehandler.h | 12 +++++------ 2 files changed, 6 insertions(+), 36 deletions(-) diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index e06fe5891..40c4c8a15 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -104,33 +104,3 @@ void LFSimFeatureHandler::setSupportedFeatures() } } } - -boost::signals2::connection LFSimFeatureHandler::setSupportsExportCallback(const SignaledType::slot_t& slot) -{ - return mSupportsExport.connect(slot); -} - -boost::signals2::connection LFSimFeatureHandler::setDestinationGuideURLCallback(const SignaledType::slot_t& slot) -{ - return mDestinationGuideURL.connect(slot); -} - -boost::signals2::connection LFSimFeatureHandler::setSearchURLCallback(const SignaledType::slot_t& slot) -{ - return mSearchURL.connect(slot); -} - -boost::signals2::connection LFSimFeatureHandler::setSayRangeCallback(const SignaledType::slot_t& slot) -{ - return mSayRange.connect(slot); -} - -boost::signals2::connection LFSimFeatureHandler::setShoutRangeCallback(const SignaledType::slot_t& slot) -{ - return mShoutRange.connect(slot); -} - -boost::signals2::connection LFSimFeatureHandler::setWhisperRangeCallback(const SignaledType::slot_t& slot) -{ - return mWhisperRange.connect(slot); -} diff --git a/indra/newview/lfsimfeaturehandler.h b/indra/newview/lfsimfeaturehandler.h index c1260d4cc..72b75a9c2 100644 --- a/indra/newview/lfsimfeaturehandler.h +++ b/indra/newview/lfsimfeaturehandler.h @@ -61,12 +61,12 @@ public: void setSupportedFeatures(); // Connection setters - boost::signals2::connection setSupportsExportCallback(const SignaledType::slot_t& slot); - boost::signals2::connection setDestinationGuideURLCallback(const SignaledType::slot_t& slot); - boost::signals2::connection setSearchURLCallback(const SignaledType::slot_t& slot); - boost::signals2::connection setSayRangeCallback(const SignaledType::slot_t& slot); - boost::signals2::connection setShoutRangeCallback(const SignaledType::slot_t& slot); - boost::signals2::connection setWhisperRangeCallback(const SignaledType::slot_t& slot); + boost::signals2::connection setSupportsExportCallback(const SignaledType::slot_t& slot) { return mSupportsExport.connect(slot); } + boost::signals2::connection setDestinationGuideURLCallback(const SignaledType::slot_t& slot) { return mDestinationGuideURL.connect(slot); } + boost::signals2::connection setSearchURLCallback(const SignaledType::slot_t& slot) { return mSearchURL.connect(slot); } + boost::signals2::connection setSayRangeCallback(const SignaledType::slot_t& slot) { return mSayRange.connect(slot); } + boost::signals2::connection setShoutRangeCallback(const SignaledType::slot_t& slot) { return mShoutRange.connect(slot); } + boost::signals2::connection setWhisperRangeCallback(const SignaledType::slot_t& slot) { return mWhisperRange.connect(slot); } // Accessors bool simSupportsExport() const { return mSupportsExport; } From 23f070128a744f25d587c8691db423f53a787168 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 10 Nov 2014 14:46:49 -0500 Subject: [PATCH 2/4] Clean up and optimize more draw call logic in llstatusbar.cpp --- indra/newview/llstatusbar.cpp | 56 +++++++---------------------------- 1 file changed, 11 insertions(+), 45 deletions(-) diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 252ee313c..b36de1028 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -528,48 +528,23 @@ void LLStatusBar::refresh() else mBuyLand->setVisible(false); std::string location_name; - if (region) + if (region && parcel) { - const LLVector3& agent_pos_region = gAgent.getPositionAgent(); - S32 pos_x = lltrunc( agent_pos_region.mV[VX] ); - S32 pos_y = lltrunc( agent_pos_region.mV[VY] ); - S32 pos_z = lltrunc( agent_pos_region.mV[VZ] ); - - // Round the numbers based on the velocity - LLVector3 agent_velocity = gAgent.getVelocity(); - F32 velocity_mag_sq = agent_velocity.magVecSquared(); - - const F32 FLY_CUTOFF = 6.f; // meters/sec - const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; - const F32 WALK_CUTOFF = 1.5f; // meters/sec - const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; - - if (velocity_mag_sq > FLY_CUTOFF_SQ) +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-1.0.0a + if (RlvActions::hasBehaviour(RLV_BHVR_SHOWLOC)) { - pos_x -= pos_x % 4; - pos_y -= pos_y % 4; - } - else if (velocity_mag_sq > WALK_CUTOFF_SQ) - { - pos_x -= pos_x % 2; - pos_y -= pos_y % 2; - } - - if (parcel) - { - if (!LLAgentUI::buildLocationString(location_name, LLAgentUI::LOCATION_FORMAT_FULL)) - { - location_name = "???"; - } + location_name = llformat("%s (%s) - %s", + RlvStrings::getString(RLV_STRING_HIDDEN_REGION).c_str(), region->getSimAccessString().c_str(), + RlvStrings::getString(RLV_STRING_HIDDEN).c_str()); } else +// [/RLVa:KB] + if (!LLAgentUI::buildLocationString(location_name, LLAgentUI::LOCATION_FORMAT_FULL)) + location_name = "???"; { - location_name = region->getName() - + llformat(" %d, %d, %d (%s)", - pos_x, pos_y, pos_z, - region->getSimAccessString().c_str()); } - static LLCachedControl show_channel("ShowSimChannel"); + + static const LLCachedControl show_channel("ShowSimChannel"); if (show_channel && !gLastVersionChannel.empty()) location_name += " - " + gLastVersionChannel; } else @@ -578,15 +553,6 @@ void LLStatusBar::refresh() location_name = "(Unknown)"; } -// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-1.0.0a - if ( (region) && (RlvActions::hasBehaviour(RLV_BHVR_SHOWLOC)) ) // region == NULL if we lose our connection to the grid - { - location_name = llformat("%s (%s) - %s", - RlvStrings::getString(RLV_STRING_HIDDEN_REGION).c_str(), region->getSimAccessString().c_str(), - RlvStrings::getString(RLV_STRING_HIDDEN).c_str()); - } -// [/RLVa:KB] - mTextParcelName->setText(location_name); // x = right edge From 60d9301646efb631695608025fd1967bb8489c46 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 10 Nov 2014 15:58:58 -0500 Subject: [PATCH 3/4] Support GridName sim feature, show grid name in status bar when hypergridded over to another grid. V3s will want to add this display to the NavBar, most likely. Adds const Type& ref() function to SignaledType to get a const reference from it where needed. --- indra/newview/lfsimfeaturehandler.cpp | 6 ++++++ indra/newview/lfsimfeaturehandler.h | 3 +++ indra/newview/llstatusbar.cpp | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index 40c4c8a15..83b17125d 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -84,6 +84,11 @@ void LFSimFeatureHandler::setSupportedFeatures() has_feature_or_default(mDestinationGuideURL, extras, "destination-guide-url"); mMapServerURL = extras.has("map-server-url") ? extras["map-server-url"].asString() : ""; has_feature_or_default(mSearchURL, extras, "search-server-url"); + if (extras.has("GridName")) + { + const std::string& grid_name(extras["GridName"]); + mGridName = gHippoGridManager->getConnectedGrid()->getGridName() != grid_name ? grid_name : ""; + } } has_feature_or_default(mSayRange, extras, "say-range"); has_feature_or_default(mShoutRange, extras, "shout-range"); @@ -97,6 +102,7 @@ void LFSimFeatureHandler::setSupportedFeatures() mDestinationGuideURL.reset(); mMapServerURL = ""; mSearchURL.reset(); + mGridName.reset(); } mSayRange.reset(); mShoutRange.reset(); diff --git a/indra/newview/lfsimfeaturehandler.h b/indra/newview/lfsimfeaturehandler.h index 72b75a9c2..893edb5a0 100644 --- a/indra/newview/lfsimfeaturehandler.h +++ b/indra/newview/lfsimfeaturehandler.h @@ -41,6 +41,7 @@ public: return *this; } operator Type() const { return mValue; } + const Type& ref() const { return mValue; } void reset() { *this = mDefaultValue; } const Type& getDefault() const { return mDefaultValue; } @@ -73,6 +74,7 @@ public: std::string destinationGuideURL() const { return mDestinationGuideURL; } std::string mapServerURL() const { return mMapServerURL; } std::string searchURL() const { return mSearchURL; } + const std::string& gridName() const { return mGridName.ref(); } U32 sayRange() const { return mSayRange; } U32 shoutRange() const { return mShoutRange; } U32 whisperRange() const { return mWhisperRange; } @@ -84,6 +86,7 @@ private: SignaledType mDestinationGuideURL; std::string mMapServerURL; SignaledType mSearchURL; + SignaledType mGridName; SignaledType mSayRange; SignaledType mShoutRange; SignaledType mWhisperRange; diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index b36de1028..2d76ba707 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -92,6 +92,7 @@ #include #include "hippogridmanager.h" +#include "lfsimfeaturehandler.h" // [RLVa:KB] #include "rlvactions.h" @@ -541,7 +542,10 @@ void LLStatusBar::refresh() // [/RLVa:KB] if (!LLAgentUI::buildLocationString(location_name, LLAgentUI::LOCATION_FORMAT_FULL)) location_name = "???"; + else { + const std::string& grid(LFSimFeatureHandler::instance().gridName()); + if (!grid.empty()) location_name += ", " + grid; } static const LLCachedControl show_channel("ShowSimChannel"); From e3d45d99da53d40a966dd5500282a86dbe76fdf4 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 10 Nov 2014 16:09:43 -0500 Subject: [PATCH 4/4] Address Issue 1732: Display name in the Communication box Adds Chat Tabs namesystem combobox to Adv. Chat->Chat UI. --- indra/newview/app_settings/settings_ascent.xml | 11 +++++++++++ indra/newview/ascentprefschat.cpp | 4 ++++ indra/newview/ascentprefschat.h | 1 + indra/newview/llimpanel.cpp | 12 +++++++++++- .../xui/en-us/panel_preferences_ascent_chat.xml | 7 +++++++ 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index 5d49b854c..41207d047 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -47,6 +47,17 @@ Value 1 + IMNameSystem + + Comment + For names in chat tabs. 0 = Old Style, 1 = Display Names and Username, 2 = Displayname only, 3 = Old Style (Display Name) + Persist + 1 + Type + S32 + Value + 0 + LandManagementNameSystem Comment diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index 8862d1604..c604a3260 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -265,6 +265,7 @@ void LLPrefsAscentChat::refreshValues() mLegacyEndScroll = gSavedSettings.getBOOL("LiruLegacyScrollToEnd"); mItalicizeActions = gSavedSettings.getBOOL("LiruItalicizeActions"); mLegacyLogLaunch = gSavedSettings.getBOOL("LiruLegacyLogLaunch"); + mChatTabNames = gSavedSettings.getS32("IMNameSystem"); mFriendNames = gSavedSettings.getS32("FriendNameSystem"); mGroupMembersNames = gSavedSettings.getS32("GroupMembersNameSystem"); mLandManagementNames = gSavedSettings.getS32("LandManagementNameSystem"); @@ -348,6 +349,8 @@ void LLPrefsAscentChat::refresh() } //Chat UI ----------------------------------------------------------------------------- + if (combo = getChild("chat_tabs_namesystem_combobox")) + combo->setCurrentByIndex(mChatTabNames); if (combo = getChild("friends_namesystem_combobox")) combo->setCurrentByIndex(mFriendNames); if (combo = getChild("group_members_namesystem_combobox")) @@ -501,6 +504,7 @@ void LLPrefsAscentChat::cancel() gSavedSettings.setBOOL("LiruLegacyScrollToEnd", mLegacyEndScroll); gSavedSettings.setBOOL("LiruItalicizeActions", mItalicizeActions); gSavedSettings.setBOOL("LiruLegacyLogLaunch", mLegacyLogLaunch); + gSavedSettings.setS32("IMNameSystem", mChatTabNames); gSavedSettings.setS32("FriendNameSystem", mFriendNames); gSavedSettings.setS32("GroupMembersNameSystem", mGroupMembersNames); gSavedSettings.setS32("LandManagementNameSystem", mLandManagementNames); diff --git a/indra/newview/ascentprefschat.h b/indra/newview/ascentprefschat.h index c04a2d297..709635d4f 100644 --- a/indra/newview/ascentprefschat.h +++ b/indra/newview/ascentprefschat.h @@ -87,6 +87,7 @@ private: bool mLegacyEndScroll; bool mItalicizeActions; bool mLegacyLogLaunch; + S32 mChatTabNames; S32 mFriendNames; S32 mGroupMembersNames; S32 mLandManagementNames; diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index da0f11280..ccc13b61c 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -404,7 +404,17 @@ void LLFloaterIMPanel::onAvatarNameLookup(const LLAvatarName& avatar_name) std::string title; LLAvatarNameCache::getPNSName(avatar_name, title); setTitle(title); - // Singu Note: We could set tab name here, too now. + const S32& ns(gSavedSettings.getS32("IMNameSystem")); + LLAvatarNameCache::getPNSName(avatar_name, title, ns); + if (!ns || ns == 3) // Remove Resident, if applicable. + { + size_t pos(title.find(" Resident")); + if (pos != std::string::npos && !gSavedSettings.getBOOL("LiruShowLastNameResident")) + title.erase(pos, 9); + } + setShortTitle(title); + if (LLMultiFloater* mf = dynamic_cast(getParent())) + mf->updateFloaterTitle(this); } LLFloaterIMPanel::~LLFloaterIMPanel() diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml index 024f4d5e7..8199d3d8d 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml @@ -56,6 +56,13 @@ Format for names in lists of/for: + Chat Tabs: + + Old Names + Display Names (w/Username) + Display Names only + Old Names (w/Display) + Friends: Old Names