Add Marketplace option to toolbar and add to world menu

Also hidden in this commit is the ability to add buttons/menu entries for
your favorite websites to be opened in the in-viewer browser
Just make a button that calls "ShowWebFloater" and passes the URL as param
This commit is contained in:
Lirusaito
2019-08-03 18:37:22 -04:00
parent 01b4f52fb0
commit bcf301ce6a
8 changed files with 59 additions and 3 deletions

View File

@@ -8988,6 +8988,37 @@ class VisibleInvFloaterType : public view_listener_t
}
};
void show_web_floater(const std::string& type)
{
auto p = LLFloaterWebContent::Params();
if (!type.empty()) p.id = type;
if (type == "marketplace")
{
if (gHippoGridManager->getConnectedGrid()->isSecondLife())
p.url = "https://marketplace.secondlife.com";
else if (LLViewerRegion* region = gAgent.getRegion())
{
LLSD info;
region->getSimulatorFeatures(info);
p.url = info["MarketplaceURL"];
}
}
else if (!type.empty() && type != "dict web")
{
p.url = type; // Simple web floaters with direct urls
}
LLFloaterWebContent::showInstance(type, p);
}
class ShowWebFloater : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
show_web_floater(userdata.asStringRef());
return true;
}
};
class VisibleSecondLife : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -9727,6 +9758,8 @@ void initialize_menus()
addMenu(new VisibleInvFloaterName, "InvFloaterVisible.Name");
addMenu(new VisibleInvFloaterType, "InvFloaterVisible.Type");
addMenu(new ShowWebFloater, "ShowWebFloater");
// [RLVa:KB] - Checked: 2010-01-18 (RLVa-1.1.0m) | Added: RLVa-1.1.0m | OK
if (rlv_handler_t::isEnabled())
{