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.
This commit is contained in:
Inusaito Sayori
2014-11-10 15:58:58 -05:00
parent 23f070128a
commit 60d9301646
3 changed files with 13 additions and 0 deletions

View File

@@ -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();

View File

@@ -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<std::string> mDestinationGuideURL;
std::string mMapServerURL;
SignaledType<std::string> mSearchURL;
SignaledType<std::string> mGridName;
SignaledType<U32> mSayRange;
SignaledType<U32> mShoutRange;
SignaledType<U32> mWhisperRange;

View File

@@ -92,6 +92,7 @@
#include <iomanip>
#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<bool> show_channel("ShowSimChannel");